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

Unified Diff: chrome/browser/ui/views/apps/chrome_native_app_window_views_win.cc

Issue 346713002: Don't set app window WS_CAPTION style when running in ash mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added comment back Created 6 years, 6 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 | « chrome/browser/ui/views/apps/chrome_native_app_window_views_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d13b495c8295d617b2aaf36e6d530d0452c5ccb6 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,10 @@ 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.
- if (host_desktop_type == chrome::HOST_DESKTOP_TYPE_ASH &&
+ if (IsRunningInAsh() &&
chrome::GetActiveDesktop() == chrome::HOST_DESKTOP_TYPE_NATIVE) {
chrome::ActivateMetroChrome();
}
@@ -60,6 +53,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 +125,7 @@ void ChromeNativeAppWindowViewsWin::InitializeDefaultWindow(
web_app::UpdateRelaunchDetailsForApp(profile, extension, hwnd);
- if (!create_params.transparent_background)
+ if (!create_params.transparent_background && !IsRunningInAsh())
EnsureCaptionStyleSet();
UpdateShelfMenu();
}
« no previous file with comments | « chrome/browser/ui/views/apps/chrome_native_app_window_views_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698