diff options
author | rafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-26 22:50:40 +0000 |
---|---|---|
committer | rafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-26 22:50:40 +0000 |
commit | 7e7a62b46abc05baaa5e969fd64cff485857c1b6 (patch) | |
tree | 3536a4a5a4e443e46cfa20726db17fb43b33d0e8 | |
parent | 21ca982c8b2d52d5acb0a36d3b5a09d30107e44e (diff) | |
download | chromium_src-7e7a62b46abc05baaa5e969fd64cff485857c1b6.zip chromium_src-7e7a62b46abc05baaa5e969fd64cff485857c1b6.tar.gz chromium_src-7e7a62b46abc05baaa5e969fd64cff485857c1b6.tar.bz2 |
Code Cleanup: Browser::CreateForApp can no longer create TYPE_APP_POPUP windows
This cleans up the interface for BrowserCreateForApp() which now longer takes a final argument of is_popup. The code has changed so that it is no caller is ever passing in true, so the code has been simplified.
BUG=5739
TEST=Ensure steps in bug report still no longer produce the bug.
Review URL: http://codereview.chromium.org/556024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37163 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/browser.cc | 12 | ||||
-rw-r--r-- | chrome/browser/browser.h | 5 |
2 files changed, 8 insertions, 9 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index 88c9c6e..6ee2d6a 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -234,8 +234,8 @@ Browser* Browser::CreateForPopup(Profile* profile) { // static Browser* Browser::CreateForApp(const std::wstring& app_name, - Profile* profile, bool is_popup) { - Browser* browser = new Browser(is_popup? TYPE_APP_POPUP : TYPE_APP, profile); + Profile* profile) { + Browser* browser = new Browser(TYPE_APP, profile); browser->app_name_ = app_name; browser->CreateBrowserWindow(); return browser; @@ -351,7 +351,7 @@ void Browser::OpenApplicationWindow(Profile* profile, const GURL& url) { std::wstring app_name = web_app::GenerateApplicationNameFromURL(url); RegisterAppPrefs(app_name); - Browser* browser = Browser::CreateForApp(app_name, profile, false); + Browser* browser = Browser::CreateForApp(app_name, profile); browser->AddTabWithURL(url, GURL(), PageTransition::START_PAGE, true, -1, false, NULL); @@ -1729,8 +1729,8 @@ void Browser::DuplicateContentsAt(int index) { } else { Browser* browser = NULL; if (type_ & TYPE_APP) { - browser = Browser::CreateForApp(app_name_, profile_, - !!(type_ & TYPE_POPUP)); + DCHECK((type_ & TYPE_POPUP) == 0); + browser = Browser::CreateForApp(app_name_, profile_); } else if (type_ == TYPE_POPUP) { browser = Browser::CreateForPopup(profile_); } @@ -2185,7 +2185,7 @@ void Browser::ConvertContentsToApplication(TabContents* contents) { RegisterAppPrefs(app_name); DetachContents(contents); - Browser* browser = Browser::CreateForApp(app_name, profile_, false); + Browser* browser = Browser::CreateForApp(app_name, profile_); browser->tabstrip_model()->AppendTabContents(contents, true); TabContents* tab_contents = browser->GetSelectedTabContents(); tab_contents->GetMutableRendererPrefs()->can_accept_load_drops = false; diff --git a/chrome/browser/browser.h b/chrome/browser/browser.h index cea9389..23e7388 100644 --- a/chrome/browser/browser.h +++ b/chrome/browser/browser.h @@ -101,9 +101,8 @@ class Browser : public TabStripModelDelegate, static Browser* CreateForPopup(Profile* profile); // Like Create, but creates a tabstrip-less and toolbar-less "app" window for - // the specified app. Passing popup=true will create a TYPE_APP_POPUP browser - static Browser* CreateForApp(const std::wstring& app_name, Profile* profile, - bool is_popup); + // the specified app. + static Browser* CreateForApp(const std::wstring& app_name, Profile* profile); // Like Create, but creates a tabstrip-less and toolbar-less // DevTools "app" window. |