Commit 5ff2851a authored by benwells@chromium.org's avatar benwells@chromium.org

Don't set app window WS_CAPTION style when running in ash mode.

This is not necessary, and causes the entire ash mode to get WS_CAPTION
as ash mode shares a single HWND.

BUG=385557

Review URL: https://codereview.chromium.org/346713002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278384 0039d316-1c4b-4281-b951-d872f2087c98
parent 332ef4cd
...@@ -40,17 +40,10 @@ ChromeNativeAppWindowViewsWin::ChromeNativeAppWindowViewsWin() ...@@ -40,17 +40,10 @@ ChromeNativeAppWindowViewsWin::ChromeNativeAppWindowViewsWin()
} }
void ChromeNativeAppWindowViewsWin::ActivateParentDesktopIfNecessary() { 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 // 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. // Metro mode can only be done by launching a process from Metro mode itself.
// This is done for launching apps, but not regular activations. // 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::GetActiveDesktop() == chrome::HOST_DESKTOP_TYPE_NATIVE) {
chrome::ActivateMetroChrome(); chrome::ActivateMetroChrome();
} }
...@@ -60,6 +53,17 @@ HWND ChromeNativeAppWindowViewsWin::GetNativeAppWindowHWND() const { ...@@ -60,6 +53,17 @@ HWND ChromeNativeAppWindowViewsWin::GetNativeAppWindowHWND() const {
return views::HWNDForWidget(widget()->GetTopLevelWidget()); 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() { void ChromeNativeAppWindowViewsWin::EnsureCaptionStyleSet() {
// Windows seems to have issues maximizing windows without WS_CAPTION. // Windows seems to have issues maximizing windows without WS_CAPTION.
// The default views / Aura implementation will remove this if we are using // The default views / Aura implementation will remove this if we are using
...@@ -121,7 +125,7 @@ void ChromeNativeAppWindowViewsWin::InitializeDefaultWindow( ...@@ -121,7 +125,7 @@ void ChromeNativeAppWindowViewsWin::InitializeDefaultWindow(
web_app::UpdateRelaunchDetailsForApp(profile, extension, hwnd); web_app::UpdateRelaunchDetailsForApp(profile, extension, hwnd);
if (!create_params.transparent_background) if (!create_params.transparent_background && !IsRunningInAsh())
EnsureCaptionStyleSet(); EnsureCaptionStyleSet();
UpdateShelfMenu(); UpdateShelfMenu();
} }
......
...@@ -30,6 +30,7 @@ class ChromeNativeAppWindowViewsWin : public ChromeNativeAppWindowViews { ...@@ -30,6 +30,7 @@ class ChromeNativeAppWindowViewsWin : public ChromeNativeAppWindowViews {
const web_app::ShortcutInfo& shortcut_info); const web_app::ShortcutInfo& shortcut_info);
HWND GetNativeAppWindowHWND() const; HWND GetNativeAppWindowHWND() const;
bool IsRunningInAsh();
void EnsureCaptionStyleSet(); void EnsureCaptionStyleSet();
// Overridden from ChromeNativeAppWindowViews: // Overridden from ChromeNativeAppWindowViews:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment