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

Side by Side Diff: chrome/browser/extensions/chrome_extension_function.cc

Issue 1661713002: Remove the rest of HostDesktopType from c/b/ui/browser_finder.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-11
Patch Set: linux adl Created 4 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/chrome_extension_function.h" 5 #include "chrome/browser/extensions/chrome_extension_function.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "chrome/browser/extensions/chrome_extension_function_details.h" 9 #include "chrome/browser/extensions/chrome_extension_function_details.h"
10 #include "chrome/browser/extensions/window_controller.h" 10 #include "chrome/browser/extensions/window_controller.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 // is true, we will also search browsers in the incognito version of this 44 // is true, we will also search browsers in the incognito version of this
45 // profile. Note that the profile may already be incognito, in which case 45 // profile. Note that the profile may already be incognito, in which case
46 // we will search the incognito version only, regardless of the value of 46 // we will search the incognito version only, regardless of the value of
47 // |include_incognito|. Look only for browsers on the active desktop as it is 47 // |include_incognito|. Look only for browsers on the active desktop as it is
48 // preferable to pretend no browser is open then to return a browser on 48 // preferable to pretend no browser is open then to return a browser on
49 // another desktop. 49 // another desktop.
50 content::WebContents* web_contents = GetSenderWebContents(); 50 content::WebContents* web_contents = GetSenderWebContents();
51 if (web_contents) { 51 if (web_contents) {
52 Profile* profile = 52 Profile* profile =
53 Profile::FromBrowserContext(web_contents->GetBrowserContext()); 53 Profile::FromBrowserContext(web_contents->GetBrowserContext());
54 Browser* browser = chrome::FindAnyBrowser( 54 Browser* browser = chrome::FindAnyBrowser(profile, include_incognito_);
55 profile, include_incognito_, chrome::GetActiveDesktop());
56 if (browser) 55 if (browser)
57 return browser; 56 return browser;
58 } 57 }
59 58
60 // NOTE(rafaelw): This can return NULL in some circumstances. In particular, 59 // NOTE(rafaelw): This can return NULL in some circumstances. In particular,
61 // a background_page onload chrome.tabs api call can make it into here 60 // a background_page onload chrome.tabs api call can make it into here
62 // before the browser is sufficiently initialized to return here, or 61 // before the browser is sufficiently initialized to return here, or
63 // all of this profile's browser windows may have been closed. 62 // all of this profile's browser windows may have been closed.
64 // A similar situation may arise during shutdown. 63 // A similar situation may arise during shutdown.
65 // TODO(rafaelw): Delay creation of background_page until the browser 64 // TODO(rafaelw): Delay creation of background_page until the browser
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 ExtensionFunction::ResponseAction ChromeSyncExtensionFunction::Run() { 119 ExtensionFunction::ResponseAction ChromeSyncExtensionFunction::Run() {
121 return RespondNow(RunSync() ? ArgumentList(std::move(results_)) 120 return RespondNow(RunSync() ? ArgumentList(std::move(results_))
122 : Error(error_)); 121 : Error(error_));
123 } 122 }
124 123
125 // static 124 // static
126 bool ChromeSyncExtensionFunction::ValidationFailure( 125 bool ChromeSyncExtensionFunction::ValidationFailure(
127 ChromeSyncExtensionFunction* function) { 126 ChromeSyncExtensionFunction* function) {
128 return false; 127 return false;
129 } 128 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/app_process_apitest.cc ('k') | chrome/browser/extensions/chrome_extension_function_details.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698