summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-17 11:56:09 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-17 11:56:09 +0000
commit3c6a09508732a8a4196d8f17d185983bdebd2941 (patch)
tree8121f0dc2dee3b06f6d6c7790deaa23e4328e526
parentddfd713b214ba718410cee06a4c43f967c3b345b (diff)
downloadchromium_src-3c6a09508732a8a4196d8f17d185983bdebd2941.zip
chromium_src-3c6a09508732a8a4196d8f17d185983bdebd2941.tar.gz
chromium_src-3c6a09508732a8a4196d8f17d185983bdebd2941.tar.bz2
browser: Move two other functions from browser_finder.h into chrome namespace.
BUG=133088 TBR=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/11587006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173445 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/app_controller_mac.mm2
-rw-r--r--chrome/browser/chrome_browser_main.cc2
-rw-r--r--chrome/browser/extensions/api/tab_capture/tab_capture_api.cc6
-rw-r--r--chrome/browser/extensions/api/tabs/tabs.cc2
-rw-r--r--chrome/browser/extensions/extension_function.cc4
-rw-r--r--chrome/browser/ui/browser_finder.cc12
-rw-r--r--chrome/browser/ui/browser_finder.h13
-rw-r--r--chrome/browser/ui/extensions/application_launch.cc2
-rw-r--r--chrome/browser/ui/startup/startup_browser_creator_win.cc2
-rw-r--r--chrome/browser/ui/toolbar/wrench_menu_model.cc2
-rw-r--r--chrome/browser/ui/views/frame/browser_view_layout.cc2
11 files changed, 24 insertions, 25 deletions
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm
index 09ca8aa..9031dc0 100644
--- a/chrome/browser/app_controller_mac.mm
+++ b/chrome/browser/app_controller_mac.mm
@@ -652,7 +652,7 @@ void RecordLastRunAppBundlePath() {
if ([self userWillWaitForInProgressDownloads:downloadCount]) {
// Create a new browser window (if necessary) and navigate to the
// downloads page if the user chooses to wait.
- Browser* browser = browser::FindBrowserWithProfile(
+ Browser* browser = chrome::FindBrowserWithProfile(
profiles[i], chrome::HOST_DESKTOP_TYPE_NATIVE);
if (!browser) {
browser = new Browser(Browser::CreateParams(profiles[i]));
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 7fc84e8..b5b1682 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -943,7 +943,7 @@ void ChromeBrowserMainParts::RunPageCycler() {
CommandLine* command_line = CommandLine::ForCurrentProcess();
// We assume a native desktop for tests, but we will need to find a way to
// get the proper host desktop type once we start running these tests in ASH.
- Browser* browser = browser::FindBrowserWithProfile(
+ Browser* browser = chrome::FindBrowserWithProfile(
profile_, chrome::HOST_DESKTOP_TYPE_NATIVE);
DCHECK(browser);
PageCycler* page_cycler = NULL;
diff --git a/chrome/browser/extensions/api/tab_capture/tab_capture_api.cc b/chrome/browser/extensions/api/tab_capture/tab_capture_api.cc
index e9c28fb..1c75983 100644
--- a/chrome/browser/extensions/api/tab_capture/tab_capture_api.cc
+++ b/chrome/browser/extensions/api/tab_capture/tab_capture_api.cc
@@ -54,9 +54,9 @@ bool TabCaptureCaptureFunction::RunImpl() {
EXTENSION_FUNCTION_VALIDATE(params.get());
// Figure out the active WebContents and retrieve the needed ids.
- Browser* target_browser = browser::FindAnyBrowser(profile(),
- include_incognito(),
- chrome::GetActiveDesktop());
+ Browser* target_browser = chrome::FindAnyBrowser(profile(),
+ include_incognito(),
+ chrome::GetActiveDesktop());
if (!target_browser) {
error_ = kFindingTabError;
return false;
diff --git a/chrome/browser/extensions/api/tabs/tabs.cc b/chrome/browser/extensions/api/tabs/tabs.cc
index d6827db..b7871dc 100644
--- a/chrome/browser/extensions/api/tabs/tabs.cc
+++ b/chrome/browser/extensions/api/tabs/tabs.cc
@@ -300,7 +300,7 @@ bool GetLastFocusedWindowFunction::RunImpl() {
// Note: currently this returns the last active browser. If we decide to
// include other window types (e.g. panels), we will need to add logic to
// WindowControllerList that mirrors the active behavior of BrowserList.
- Browser* browser = browser::FindAnyBrowser(
+ Browser* browser = chrome::FindAnyBrowser(
profile(), include_incognito(), chrome::GetActiveDesktop());
if (!browser || !browser->window()) {
error_ = keys::kNoLastFocusedWindowError;
diff --git a/chrome/browser/extensions/extension_function.cc b/chrome/browser/extensions/extension_function.cc
index 5af06a0..c1738d3 100644
--- a/chrome/browser/extensions/extension_function.cc
+++ b/chrome/browser/extensions/extension_function.cc
@@ -214,8 +214,8 @@ Browser* UIThreadExtensionFunction::GetCurrentBrowser() {
if (render_view_host_) {
Profile* profile = Profile::FromBrowserContext(
render_view_host_->GetProcess()->GetBrowserContext());
- Browser* browser = browser::FindAnyBrowser(profile, include_incognito_,
- chrome::GetActiveDesktop());
+ Browser* browser = chrome::FindAnyBrowser(profile, include_incognito_,
+ chrome::GetActiveDesktop());
if (browser)
return browser;
}
diff --git a/chrome/browser/ui/browser_finder.cc b/chrome/browser/ui/browser_finder.cc
index 97b3939..17141a5 100644
--- a/chrome/browser/ui/browser_finder.cc
+++ b/chrome/browser/ui/browser_finder.cc
@@ -147,9 +147,13 @@ Browser* FindOrCreateTabbedBrowser(Profile* profile,
return browser;
}
+} // namespace browser
+
+namespace chrome {
+
Browser* FindAnyBrowser(Profile* profile,
bool match_original_profiles,
- chrome::HostDesktopType type) {
+ HostDesktopType type) {
return FindBrowserWithTabbedOrAnyType(profile,
type,
false,
@@ -157,14 +161,10 @@ Browser* FindAnyBrowser(Profile* profile,
}
Browser* FindBrowserWithProfile(Profile* profile,
- chrome::HostDesktopType desktop_type) {
+ HostDesktopType desktop_type) {
return FindBrowserWithTabbedOrAnyType(profile, desktop_type, false, false);
}
-} // namespace browser
-
-namespace chrome {
-
Browser* FindBrowserWithID(SessionID::id_type desired_id) {
for (BrowserList::const_iterator i = BrowserList::begin();
i != BrowserList::end(); ++i) {
diff --git a/chrome/browser/ui/browser_finder.h b/chrome/browser/ui/browser_finder.h
index cb89827..a07353f 100644
--- a/chrome/browser/ui/browser_finder.h
+++ b/chrome/browser/ui/browser_finder.h
@@ -39,22 +39,21 @@ Browser* FindOrCreateTabbedBrowserDeprecated(Profile* profile);
Browser* FindOrCreateTabbedBrowser(Profile* profile,
chrome::HostDesktopType type);
+} // namespace browser
+
+namespace chrome {
+
// Finds an existing browser window of any kind.
// |type| refers to the host desktop the returned browser should belong to.
Browser* FindAnyBrowser(Profile* profile,
bool match_original_profiles,
- chrome::HostDesktopType type);
+ HostDesktopType type);
// Find an existing browser window with the provided profile and hosted in the
// given desktop. Searches in the order of last activation. Only browsers that
// have been active can be returned. Returns NULL if no such browser currently
// exists.
-Browser* FindBrowserWithProfile(Profile* profile,
- chrome::HostDesktopType type);
-
-} // namespace browser
-
-namespace chrome {
+Browser* FindBrowserWithProfile(Profile* profile, HostDesktopType type);
// Find an existing browser with the provided ID. Returns NULL if no such
// browser currently exists.
diff --git a/chrome/browser/ui/extensions/application_launch.cc b/chrome/browser/ui/extensions/application_launch.cc
index a8b3aa2..4549ed2 100644
--- a/chrome/browser/ui/extensions/application_launch.cc
+++ b/chrome/browser/ui/extensions/application_launch.cc
@@ -115,7 +115,7 @@ WebContents* OpenApplicationWindow(
// windows to be created. We instead attempt to reuse an existing Browser
// window.
if (win8::IsSingleWindowMetroMode()) {
- browser = browser::FindBrowserWithProfile(
+ browser = chrome::FindBrowserWithProfile(
profile, chrome::HOST_DESKTOP_TYPE_NATIVE);
}
#endif
diff --git a/chrome/browser/ui/startup/startup_browser_creator_win.cc b/chrome/browser/ui/startup/startup_browser_creator_win.cc
index 661ce43..fdf5540 100644
--- a/chrome/browser/ui/startup/startup_browser_creator_win.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator_win.cc
@@ -57,7 +57,7 @@ bool StartupBrowserCreatorImpl::OpenStartupURLsInExistingBrowser(
if (startup_urls[0] != GURL(chrome::kChromeUINewTabURL))
return false;
- Browser* browser = browser::FindBrowserWithProfile(
+ Browser* browser = chrome::FindBrowserWithProfile(
profile, chrome::HOST_DESKTOP_TYPE_NATIVE);
if (!browser)
diff --git a/chrome/browser/ui/toolbar/wrench_menu_model.cc b/chrome/browser/ui/toolbar/wrench_menu_model.cc
index 3cd9c2d..5046cbc 100644
--- a/chrome/browser/ui/toolbar/wrench_menu_model.cc
+++ b/chrome/browser/ui/toolbar/wrench_menu_model.cc
@@ -474,7 +474,7 @@ void WrenchMenuModel::Build(bool is_new_menu, bool supports_new_separators) {
// if there isn't already a window of the requested type (incognito or not)
// that is available.
if (browser_->profile()->IsOffTheRecord()) {
- if (browser::FindBrowserWithProfile(
+ if (chrome::FindBrowserWithProfile(
browser_->profile()->GetOriginalProfile(),
browser_->host_desktop_type()) == NULL) {
AddItemWithStringId(IDC_NEW_WINDOW, IDS_NEW_WINDOW);
diff --git a/chrome/browser/ui/views/frame/browser_view_layout.cc b/chrome/browser/ui/views/frame/browser_view_layout.cc
index 763836e..90cd90d 100644
--- a/chrome/browser/ui/views/frame/browser_view_layout.cc
+++ b/chrome/browser/ui/views/frame/browser_view_layout.cc
@@ -345,7 +345,7 @@ int BrowserViewLayout::LayoutTabStripRegion() {
views::Button* switcher_button = browser_view_->window_switcher_button_;
if (switcher_button) {
if (browser()->profile()->HasOffTheRecordProfile() &&
- browser::FindBrowserWithProfile(
+ chrome::FindBrowserWithProfile(
browser()->profile()->GetOriginalProfile(),
browser()->host_desktop_type()) != NULL) {
switcher_button->SetVisible(true);