summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-12 01:32:20 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-12 01:32:20 +0000
commitaebced3ed6d39cbd3bf7ce47d3799a7804e390f0 (patch)
treed03996884df44d35c3a0c7a59301adf2efe71c61
parent2ff600aa2c0e06e850fa73979a9d938655aca6cc (diff)
downloadchromium_src-aebced3ed6d39cbd3bf7ce47d3799a7804e390f0.zip
chromium_src-aebced3ed6d39cbd3bf7ce47d3799a7804e390f0.tar.gz
chromium_src-aebced3ed6d39cbd3bf7ce47d3799a7804e390f0.tar.bz2
browser: Move FindLastActiveWithProfile() into chrome namespace.
BUG=133088 TBR=ben@chromium.org Review URL: https://codereview.chromium.org/11363188 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167131 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--PRESUBMIT.py2
-rw-r--r--chrome/browser/app_controller_mac.mm2
-rw-r--r--chrome/browser/background/background_contents_service.cc2
-rw-r--r--chrome/browser/background/background_mode_manager.cc2
-rw-r--r--chrome/browser/chromeos/drive/drive_file_system_util.cc2
-rw-r--r--chrome/browser/chromeos/extensions/file_manager_util.cc2
-rw-r--r--chrome/browser/download/chrome_download_manager_delegate.cc2
-rw-r--r--chrome/browser/download/download_crx_util.cc2
-rw-r--r--chrome/browser/extensions/bundle_installer.cc2
-rw-r--r--chrome/browser/extensions/extension_error_ui_default.cc2
-rw-r--r--chrome/browser/extensions/extension_install_ui_default.cc4
-rw-r--r--chrome/browser/notifications/balloon_host.cc2
-rw-r--r--chrome/browser/notifications/notification_options_menu_model.cc3
-rw-r--r--chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc2
-rw-r--r--chrome/browser/ui/browser_finder.cc8
-rw-r--r--chrome/browser/ui/browser_finder.h8
16 files changed, 23 insertions, 24 deletions
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index f534343..08f3452 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -142,7 +142,7 @@ _BANNED_CPP_FUNCTIONS = (
False,
),
(
- 'browser::FindLastActiveWithProfile',
+ 'chrome::FindLastActiveWithProfile',
(
'This function is deprecated and we\'re working on removing it. Pass',
'more context to get a Browser*, like a WebContents, window, or session',
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm
index c89bb11..f9e4df1 100644
--- a/chrome/browser/app_controller_mac.mm
+++ b/chrome/browser/app_controller_mac.mm
@@ -103,7 +103,7 @@ bool g_is_opening_new_window = false;
// not possible. If the last active browser is minimized (in particular, if
// there are only minimized windows), it will unminimize it.
Browser* ActivateBrowser(Profile* profile) {
- Browser* browser = browser::FindLastActiveWithProfile(profile);
+ Browser* browser = chrome::FindLastActiveWithProfile(profile);
if (browser)
browser->window()->Activate();
return browser;
diff --git a/chrome/browser/background/background_contents_service.cc b/chrome/browser/background/background_contents_service.cc
index 6accc45..3263305 100644
--- a/chrome/browser/background/background_contents_service.cc
+++ b/chrome/browser/background/background_contents_service.cc
@@ -614,7 +614,7 @@ void BackgroundContentsService::AddWebContents(
const gfx::Rect& initial_pos,
bool user_gesture,
bool* was_blocked) {
- Browser* browser = browser::FindLastActiveWithProfile(
+ Browser* browser = chrome::FindLastActiveWithProfile(
Profile::FromBrowserContext(new_contents->GetBrowserContext()));
if (browser) {
chrome::AddWebContents(browser, NULL, new_contents, disposition,
diff --git a/chrome/browser/background/background_mode_manager.cc b/chrome/browser/background/background_mode_manager.cc
index b77ba7e..d687f64 100644
--- a/chrome/browser/background/background_mode_manager.cc
+++ b/chrome/browser/background/background_mode_manager.cc
@@ -93,7 +93,7 @@ void BackgroundModeManager::BackgroundModeData::ExecuteCommand(int item) {
}
Browser* BackgroundModeManager::BackgroundModeData::GetBrowserWindow() {
- Browser* browser = browser::FindLastActiveWithProfile(profile_);
+ Browser* browser = chrome::FindLastActiveWithProfile(profile_);
return browser ? browser : chrome::OpenEmptyWindow(profile_);
}
diff --git a/chrome/browser/chromeos/drive/drive_file_system_util.cc b/chrome/browser/chromeos/drive/drive_file_system_util.cc
index fe3ec96..6519eac 100644
--- a/chrome/browser/chromeos/drive/drive_file_system_util.cc
+++ b/chrome/browser/chromeos/drive/drive_file_system_util.cc
@@ -98,7 +98,7 @@ void GetHostedDocumentURLBlockingThread(const FilePath& drive_cache_path,
}
void OpenEditURLUIThread(Profile* profile, const GURL* edit_url) {
- Browser* browser = browser::FindLastActiveWithProfile(profile);
+ Browser* browser = chrome::FindLastActiveWithProfile(profile);
if (browser) {
browser->OpenURL(content::OpenURLParams(*edit_url, content::Referrer(),
CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false));
diff --git a/chrome/browser/chromeos/extensions/file_manager_util.cc b/chrome/browser/chromeos/extensions/file_manager_util.cc
index 2a0a5e7..a82c151 100644
--- a/chrome/browser/chromeos/extensions/file_manager_util.cc
+++ b/chrome/browser/chromeos/extensions/file_manager_util.cc
@@ -612,7 +612,7 @@ bool ExecuteDefaultHandler(Profile* profile, const FilePath& path) {
std::string extension_id = handler->extension_id();
std::string action_id = handler->id();
- Browser* browser = browser::FindLastActiveWithProfile(profile);
+ Browser* browser = chrome::FindLastActiveWithProfile(profile);
// If there is no browsers for the profile, bail out. Return true so warning
// about file type not being supported is not displayed.
diff --git a/chrome/browser/download/chrome_download_manager_delegate.cc b/chrome/browser/download/chrome_download_manager_delegate.cc
index 27e1105..98bb3f2 100644
--- a/chrome/browser/download/chrome_download_manager_delegate.cc
+++ b/chrome/browser/download/chrome_download_manager_delegate.cc
@@ -261,7 +261,7 @@ WebContents* ChromeDownloadManagerDelegate::
#else
// Start the download in the last active browser. This is not ideal but better
// than fully hiding the download from the user.
- Browser* last_active = browser::FindLastActiveWithProfile(profile_);
+ Browser* last_active = chrome::FindLastActiveWithProfile(profile_);
return last_active ? chrome::GetActiveWebContents(last_active) : NULL;
#endif
}
diff --git a/chrome/browser/download/download_crx_util.cc b/chrome/browser/download/download_crx_util.cc
index 107c4db..3542052 100644
--- a/chrome/browser/download/download_crx_util.cc
+++ b/chrome/browser/download/download_crx_util.cc
@@ -44,7 +44,7 @@ ExtensionInstallPrompt* CreateExtensionInstallPrompt(
} else {
content::WebContents* web_contents = download_item.GetWebContents();
if (!web_contents) {
- Browser* browser = browser::FindLastActiveWithProfile(profile);
+ Browser* browser = chrome::FindLastActiveWithProfile(profile);
if (!browser)
browser = new Browser(Browser::CreateParams(profile));
web_contents = browser->tab_strip_model()->GetActiveWebContents();
diff --git a/chrome/browser/extensions/bundle_installer.cc b/chrome/browser/extensions/bundle_installer.cc
index e2d0594..b9c3f5f 100644
--- a/chrome/browser/extensions/bundle_installer.cc
+++ b/chrome/browser/extensions/bundle_installer.cc
@@ -272,7 +272,7 @@ void BundleInstaller::ShowPrompt() {
if (!browser) {
// The browser that we got initially could have gone away during our
// thread hopping.
- browser = browser::FindLastActiveWithProfile(profile_);
+ browser = chrome::FindLastActiveWithProfile(profile_);
}
content::WebContents* web_contents = NULL;
if (browser)
diff --git a/chrome/browser/extensions/extension_error_ui_default.cc b/chrome/browser/extensions/extension_error_ui_default.cc
index 704454f..9ce25d0 100644
--- a/chrome/browser/extensions/extension_error_ui_default.cc
+++ b/chrome/browser/extensions/extension_error_ui_default.cc
@@ -23,7 +23,7 @@ ExtensionErrorUIDefault::~ExtensionErrorUIDefault() {
bool ExtensionErrorUIDefault::ShowErrorInBubbleView() {
Browser* browser =
- browser::FindLastActiveWithProfile(extension_service()->profile());
+ chrome::FindLastActiveWithProfile(extension_service()->profile());
if (!browser)
return false;
diff --git a/chrome/browser/extensions/extension_install_ui_default.cc b/chrome/browser/extensions/extension_install_ui_default.cc
index 6bc7b5a..6929832 100644
--- a/chrome/browser/extensions/extension_install_ui_default.cc
+++ b/chrome/browser/extensions/extension_install_ui_default.cc
@@ -158,7 +158,7 @@ void ExtensionInstallUIDefault::OnInstallFailure(
if (disable_failure_ui_for_tests || skip_post_install_ui_)
return;
- Browser* browser = browser::FindLastActiveWithProfile(profile_);
+ Browser* browser = chrome::FindLastActiveWithProfile(profile_);
WebContents* web_contents = chrome::GetActiveWebContents(browser);
if (!web_contents)
return;
@@ -285,6 +285,6 @@ ExtensionInstallPrompt* ExtensionInstallUI::CreateInstallPromptWithBrowser(
// static
ExtensionInstallPrompt* ExtensionInstallUI::CreateInstallPromptWithProfile(
Profile* profile) {
- Browser* browser = browser::FindLastActiveWithProfile(profile);
+ Browser* browser = chrome::FindLastActiveWithProfile(profile);
return CreateInstallPromptWithBrowser(browser);
}
diff --git a/chrome/browser/notifications/balloon_host.cc b/chrome/browser/notifications/balloon_host.cc
index 1ae8bf9..5f8d48c 100644
--- a/chrome/browser/notifications/balloon_host.cc
+++ b/chrome/browser/notifications/balloon_host.cc
@@ -83,7 +83,7 @@ void BalloonHost::AddNewContents(WebContents* source,
const gfx::Rect& initial_pos,
bool user_gesture,
bool* was_blocked) {
- Browser* browser = browser::FindLastActiveWithProfile(
+ Browser* browser = chrome::FindLastActiveWithProfile(
Profile::FromBrowserContext(new_contents->GetBrowserContext()));
if (browser) {
chrome::AddWebContents(browser, NULL, new_contents, disposition,
diff --git a/chrome/browser/notifications/notification_options_menu_model.cc b/chrome/browser/notifications/notification_options_menu_model.cc
index db21a66..0cbaea6 100644
--- a/chrome/browser/notifications/notification_options_menu_model.cc
+++ b/chrome/browser/notifications/notification_options_menu_model.cc
@@ -249,8 +249,7 @@ void NotificationOptionsMenuModel::ExecuteCommand(int command_id) {
break;
}
case kOpenContentSettingsCommand: {
- Browser* browser =
- browser::FindLastActiveWithProfile(balloon_->profile());
+ Browser* browser = chrome::FindLastActiveWithProfile(balloon_->profile());
if (!browser) {
// It is possible that there is no browser window (e.g. when there are
// background pages, or for a chrome frame process on windows).
diff --git a/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc b/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc
index 6979f05..caa9967 100644
--- a/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc
+++ b/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc
@@ -62,7 +62,7 @@ CloudPrintSetupFlow* CloudPrintSetupFlow::OpenDialog(
const base::WeakPtr<Delegate>& delegate,
gfx::NativeWindow parent_window) {
DCHECK(profile);
- Browser* browser = browser::FindLastActiveWithProfile(profile);
+ Browser* browser = chrome::FindLastActiveWithProfile(profile);
// Set the arguments for showing the gaia login page.
DictionaryValue args;
args.SetString("user", "");
diff --git a/chrome/browser/ui/browser_finder.cc b/chrome/browser/ui/browser_finder.cc
index 0fde677..081d019 100644
--- a/chrome/browser/ui/browser_finder.cc
+++ b/chrome/browser/ui/browser_finder.cc
@@ -194,6 +194,10 @@ Browser* FindBrowserWithWebContents(const WebContents* web_contents) {
return NULL;
}
+} // namespace browser
+
+namespace chrome {
+
Browser* FindLastActiveWithProfile(Profile* profile) {
// We are only interested in last active browsers, so we don't fall back to
// all browsers like FindBrowserWith* do.
@@ -202,10 +206,6 @@ Browser* FindLastActiveWithProfile(Profile* profile) {
Browser::FEATURE_NONE, kMatchAny);
}
-} // namespace browser
-
-namespace chrome {
-
Browser* FindLastActiveWithHostDesktopType(HostDesktopType type) {
BrowserListImpl* browser_list_impl = BrowserListImpl::GetInstance(type);
if (browser_list_impl)
diff --git a/chrome/browser/ui/browser_finder.h b/chrome/browser/ui/browser_finder.h
index 771db9d..093b34c 100644
--- a/chrome/browser/ui/browser_finder.h
+++ b/chrome/browser/ui/browser_finder.h
@@ -64,15 +64,15 @@ Browser* FindBrowserWithWindow(gfx::NativeWindow window);
// |web_contents| must not be NULL.
Browser* FindBrowserWithWebContents(const content::WebContents* web_contents);
+} // namespace browser
+
+namespace chrome {
+
// Identical in behavior to BrowserList::GetLastActive(), except that the most
// recently open browser owned by |profile| is returned. If none exist, returns
// NULL. WARNING: see warnings in BrowserList::GetLastActive().
Browser* FindLastActiveWithProfile(Profile* profile);
-} // namespace browser
-
-namespace chrome {
-
// Identical in behavior to BrowserList::GetLastActive(), except that the most
// recently open browser owned on the desktop described by |type| is returned.
// If none exist, returns NULL. WARNING: see warnings in