Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Side by Side Diff: chrome/browser/extensions/api/browser/browser_api.cc

Issue 2685333005: ash: fix regression where ctrl+n put new window on wrong desktop (Closed)
Patch Set: Rebase to ToT Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/api/browser/browser_api.h" 5 #include "chrome/browser/extensions/api/browser/browser_api.h"
6 6
7 #include "chrome/browser/extensions/extension_tab_util.h" 7 #include "chrome/browser/extensions/extension_tab_util.h"
8 #include "chrome/common/extensions/api/browser.h" 8 #include "chrome/common/extensions/api/browser.h"
9 9
10 namespace extensions { 10 namespace extensions {
11 namespace api { 11 namespace api {
12 12
13 BrowserOpenTabFunction::~BrowserOpenTabFunction() { 13 BrowserOpenTabFunction::~BrowserOpenTabFunction() {
14 } 14 }
15 15
16 ExtensionFunction::ResponseAction BrowserOpenTabFunction::Run() { 16 ExtensionFunction::ResponseAction BrowserOpenTabFunction::Run() {
17 std::unique_ptr<browser::OpenTab::Params> params( 17 std::unique_ptr<browser::OpenTab::Params> params(
18 browser::OpenTab::Params::Create(*args_)); 18 browser::OpenTab::Params::Create(*args_));
19 EXTENSION_FUNCTION_VALIDATE(params.get()); 19 EXTENSION_FUNCTION_VALIDATE(params.get());
20 20
21 ExtensionTabUtil::OpenTabParams options; 21 ExtensionTabUtil::OpenTabParams options;
22 options.create_browser_if_needed = true; 22 options.create_browser_if_needed = true;
23 options.url.reset(new std::string(params->options.url)); 23 options.url.reset(new std::string(params->options.url));
24 24
25 std::string error; 25 std::string error;
26 std::unique_ptr<base::DictionaryValue> result( 26 std::unique_ptr<base::DictionaryValue> result(
27 ExtensionTabUtil::OpenTab(this, options, &error)); 27 ExtensionTabUtil::OpenTab(this, options, user_gesture(), &error));
28 if (!result) 28 if (!result)
29 return RespondNow(Error(error)); 29 return RespondNow(Error(error));
30 30
31 return RespondNow(NoArguments()); 31 return RespondNow(NoArguments());
32 } 32 }
33 33
34 } // namespace api 34 } // namespace api
35 } // namespace extensions 35 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/download/download_crx_util.cc ('k') | chrome/browser/extensions/api/debugger/debugger_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698