diff options
author | mmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-10 21:21:59 +0000 |
---|---|---|
committer | mmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-10 21:21:59 +0000 |
commit | 1953f41fe9518b8eea972e94fef627eebb00a8fa (patch) | |
tree | 8f2d8f54bd7288b35eb78b153c94210a84e6a9f9 | |
parent | 2c887330e92fea0b55f678e04b60f49b347d6e11 (diff) | |
download | chromium_src-1953f41fe9518b8eea972e94fef627eebb00a8fa.zip chromium_src-1953f41fe9518b8eea972e94fef627eebb00a8fa.tar.gz chromium_src-1953f41fe9518b8eea972e94fef627eebb00a8fa.tar.bz2 |
Rename and document Browser::GetTabbedBrowser()'s
|match_incognito| parameter, and do the same for the
corresponding BrowserList functions.
Also fix incorrect comment for BrowserList::FindTabbedBrowser.
R=sky@chromium.org
BUG=none
Review URL: https://chromiumcodereview.appspot.com/10384090
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136392 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/ui/browser.cc | 5 | ||||
-rw-r--r-- | chrome/browser/ui/browser.h | 8 | ||||
-rw-r--r-- | chrome/browser/ui/browser_list.cc | 17 | ||||
-rw-r--r-- | chrome/browser/ui/browser_list.h | 17 |
4 files changed, 31 insertions, 16 deletions
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index 22bfbd3..99e0aa3 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc @@ -2523,8 +2523,9 @@ Browser* Browser::GetBrowserForController( } // static -Browser* Browser::GetTabbedBrowser(Profile* profile, bool match_incognito) { - return BrowserList::FindTabbedBrowser(profile, match_incognito); +Browser* Browser::GetTabbedBrowser(Profile* profile, + bool match_original_profiles) { + return BrowserList::FindTabbedBrowser(profile, match_original_profiles); } // static diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h index ddb3241..8225f6f 100644 --- a/chrome/browser/ui/browser.h +++ b/chrome/browser/ui/browser.h @@ -693,7 +693,13 @@ class Browser : public TabStripModelDelegate, const content::NavigationController* controller, int* index); // Retrieve the last active tabbed browser with a profile matching |profile|. - static Browser* GetTabbedBrowser(Profile* profile, bool match_incognito); + // If |match_original_profiles| is true, matching is done based on the + // original profile, eg profile->GetOriginalProfile() == + // browser->profile()->GetOriginalProfile(). This has the effect of matching + // against both non-incognito and incognito profiles. If + // |match_original_profiles| is false, only an exact match may be returned. + static Browser* GetTabbedBrowser(Profile* profile, + bool match_original_profiles); // Retrieve the last active tabbed browser with a profile matching |profile|. // Creates a new Browser if none are available. diff --git a/chrome/browser/ui/browser_list.cc b/chrome/browser/ui/browser_list.cc index bf9875c..fd9eead 100644 --- a/chrome/browser/ui/browser_list.cc +++ b/chrome/browser/ui/browser_list.cc @@ -188,11 +188,11 @@ Browser* FindBrowserMatching(const T& begin, Browser* FindBrowserWithTabbedOrAnyType(Profile* profile, bool match_tabbed, - bool match_incognito) { + bool match_original_profiles) { uint32 match_types = kMatchAny; if (match_tabbed) match_types |= kMatchTabbed; - if (match_incognito) + if (match_original_profiles) match_types |= kMatchOriginalProfile; Browser* browser = FindBrowserMatching( BrowserList::begin_last_active(), BrowserList::end_last_active(), @@ -700,13 +700,18 @@ Browser* BrowserList::GetLastActiveWithProfile(Profile* profile) { // static Browser* BrowserList::FindTabbedBrowser(Profile* profile, - bool match_incognito) { - return FindBrowserWithTabbedOrAnyType(profile, true, match_incognito); + bool match_original_profiles) { + return FindBrowserWithTabbedOrAnyType(profile, + true, + match_original_profiles); } // static -Browser* BrowserList::FindAnyBrowser(Profile* profile, bool match_incognito) { - return FindBrowserWithTabbedOrAnyType(profile, false, match_incognito); +Browser* BrowserList::FindAnyBrowser(Profile* profile, + bool match_original_profiles) { + return FindBrowserWithTabbedOrAnyType(profile, + false, + match_original_profiles); } // static diff --git a/chrome/browser/ui/browser_list.h b/chrome/browser/ui/browser_list.h index 1e3609d..2cbc704 100644 --- a/chrome/browser/ui/browser_list.h +++ b/chrome/browser/ui/browser_list.h @@ -67,16 +67,19 @@ class BrowserList { // WARNING: see warnings in GetLastActive(). static Browser* GetLastActiveWithProfile(Profile* profile); - // Find an existing browser window with tabbed type. Searches in the - // order of last activation. Only browsers that have been active can be - // returned. If |match_incognito| is true, will match a browser with either - // a regular or incognito profile that matches the given one. Returns NULL if - // no such browser currently exists. - static Browser* FindTabbedBrowser(Profile* profile, bool match_incognito); + // Retrieve the last active tabbed browser with a profile matching |profile|. + // If |match_original_profiles| is true, matching is done based on the + // original profile, eg profile->GetOriginalProfile() == + // browser->profile()->GetOriginalProfile(). This has the effect of matching + // against both non-incognito and incognito profiles. If + // |match_original_profiles| is false, only an exact match may be returned. + static Browser* FindTabbedBrowser(Profile* profile, + bool match_original_profiles); // Find an existing browser window with any type. See comment above for // additional information. - static Browser* FindAnyBrowser(Profile* profile, bool match_incognito); + static Browser* FindAnyBrowser(Profile* profile, + bool match_original_profiles); // Find an existing browser window that can provide the specified type (this // uses Browser::CanSupportsWindowFeature, not |