Chromium Code Reviews| Index: chrome/browser/ui/views/apps/chrome_native_app_window_views_win.cc |
| diff --git a/chrome/browser/ui/views/apps/chrome_native_app_window_views_win.cc b/chrome/browser/ui/views/apps/chrome_native_app_window_views_win.cc |
| index b048fb4cc4cea58a64bfa2a3bf6763abc5c928f3..512da964a06a663741736a3bac1b6ae639f0863b 100644 |
| --- a/chrome/browser/ui/views/apps/chrome_native_app_window_views_win.cc |
| +++ b/chrome/browser/ui/views/apps/chrome_native_app_window_views_win.cc |
| @@ -40,17 +40,7 @@ ChromeNativeAppWindowViewsWin::ChromeNativeAppWindowViewsWin() |
| } |
| void ChromeNativeAppWindowViewsWin::ActivateParentDesktopIfNecessary() { |
| - if (!ash::Shell::HasInstance()) |
| - return; |
| - |
| - views::Widget* widget = |
| - implicit_cast<views::WidgetDelegate*>(this)->GetWidget(); |
| - chrome::HostDesktopType host_desktop_type = |
| - chrome::GetHostDesktopTypeForNativeWindow(widget->GetNativeWindow()); |
| - // Only switching into Ash from Native is supported. Tearing the user out of |
| - // Metro mode can only be done by launching a process from Metro mode itself. |
| - // This is done for launching apps, but not regular activations. |
|
calamity
2014/06/19 07:43:06
nit: Any reason for removing this condition's comm
benwells
2014/06/19 08:33:37
No good reason :) Added the comment back.
|
| - if (host_desktop_type == chrome::HOST_DESKTOP_TYPE_ASH && |
| + if (IsRunningInAsh() && |
| chrome::GetActiveDesktop() == chrome::HOST_DESKTOP_TYPE_NATIVE) { |
| chrome::ActivateMetroChrome(); |
| } |
| @@ -60,6 +50,17 @@ HWND ChromeNativeAppWindowViewsWin::GetNativeAppWindowHWND() const { |
| return views::HWNDForWidget(widget()->GetTopLevelWidget()); |
| } |
| +bool ChromeNativeAppWindowViewsWin::IsRunningInAsh() { |
| + if (!ash::Shell::HasInstance()) |
| + return false; |
| + |
| + views::Widget* widget = |
| + implicit_cast<views::WidgetDelegate*>(this)->GetWidget(); |
| + chrome::HostDesktopType host_desktop_type = |
| + chrome::GetHostDesktopTypeForNativeWindow(widget->GetNativeWindow()); |
| + return host_desktop_type == chrome::HOST_DESKTOP_TYPE_ASH; |
| +} |
| + |
| void ChromeNativeAppWindowViewsWin::EnsureCaptionStyleSet() { |
| // Windows seems to have issues maximizing windows without WS_CAPTION. |
| // The default views / Aura implementation will remove this if we are using |
| @@ -121,7 +122,7 @@ void ChromeNativeAppWindowViewsWin::InitializeDefaultWindow( |
| web_app::UpdateRelaunchDetailsForApp(profile, extension, hwnd); |
| - if (!create_params.transparent_background) |
| + if (!create_params.transparent_background && !IsRunningInAsh()) |
| EnsureCaptionStyleSet(); |
| UpdateShelfMenu(); |
| } |