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

Unified Diff: chrome/browser/ui/browser.cc

Issue 10197003: ash: Ensure LAUNCH_WINDOW opens in normal window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 1dd945744ed3d6adbfce12c3a12fa449f719eab6..d3e8a63215c8ddd0ec0f4ba785e1bd08ab653128 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -777,6 +777,22 @@ WebContents* Browser::OpenApplicationWindow(
CreateParams params(type, profile);
params.app_name = app_name;
params.initial_bounds = window_bounds;
+
+#if defined(USE_ASH)
+ if (extension &&
+ container == extension_misc::LAUNCH_WINDOW) {
+ // In ash, LAUNCH_FULLSCREEN launches in a maximized app window and
+ // LAUNCH_WINDOW launches in a normal app window.
+ ExtensionPrefs::LaunchType launch_type =
+ profile->GetExtensionService()->extension_prefs()->GetLaunchType(
+ extension->id(), ExtensionPrefs::LAUNCH_DEFAULT);
+ if (launch_type == ExtensionPrefs::LAUNCH_FULLSCREEN)
+ params.initial_show_state = ui::SHOW_STATE_MAXIMIZED;
+ else if (launch_type == ExtensionPrefs::LAUNCH_WINDOW)
+ params.initial_show_state = ui::SHOW_STATE_NORMAL;
+ }
+#endif
+
Browser* browser = Browser::CreateWithParams(params);
if (app_browser)
@@ -792,18 +808,6 @@ WebContents* Browser::OpenApplicationWindow(
if (extension && type == TYPE_PANEL)
wrapper->extension_tab_helper()->SetExtensionAppIconById(extension->id());
-#if defined(USE_ASH)
- if (extension &&
- container == extension_misc::LAUNCH_WINDOW) {
- // In ash, LAUNCH_FULLSCREEN launches in a maximized app window.
- ExtensionPrefs::LaunchType launch_type =
- profile->GetExtensionService()->extension_prefs()->GetLaunchType(
- extension->id(), ExtensionPrefs::LAUNCH_DEFAULT);
- if (launch_type == ExtensionPrefs::LAUNCH_FULLSCREEN)
- browser->window()->Maximize();
- }
-#endif
-
browser->window()->Show();
// TODO(jcampan): http://crbug.com/8123 we should not need to set the initial
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698