1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/extensions/api/browser/browser_api.h"
7 #include "chrome/browser/extensions/extension_tab_util.h"
12 BrowserOpenTabFunction::~BrowserOpenTabFunction() {
15 bool BrowserOpenTabFunction::RunSync() {
16 scoped_ptr<browser::OpenTab::Params> params(
17 browser::OpenTab::Params::Create(*args_));
18 EXTENSION_FUNCTION_VALIDATE(params.get());
20 ExtensionTabUtil::OpenTabParams options;
21 options.create_browser_if_needed = true;
22 options.url.reset(new std::string(params->options.url));
25 scoped_ptr<base::DictionaryValue> result(
26 ExtensionTabUtil::OpenTab(this, options, &error));
36 } // namespace extensions