Commit 3e7dcc3d authored by Sammie Quon's avatar Sammie Quon Committed by Commit Bot

overview: Display the correct settings icon in overview.

Previously the settings icon would have its own icon set, but entering
overview would change its icon to the favicon.

Introduce a new window property kHasOverviewIcon which apps that do not
need the favicon would set to true (currently only know to be settings).

Test: manual
Bug: 827619
Change-Id: I9ef99a7491ca3e3513a883c1d84e3e48894ae81a
Reviewed-on: https://chromium-review.googlesource.com/991260Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Sammie Quon <sammiequon@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548180}
parent 1e02fc12
...@@ -62,5 +62,6 @@ void SettingsWindowObserver::OnNewSettingsWindow(Browser* settings_browser) { ...@@ -62,5 +62,6 @@ void SettingsWindowObserver::OnNewSettingsWindow(Browser* settings_browser) {
window->SetProperty( window->SetProperty(
aura::client::kWindowIconKey, aura::client::kWindowIconKey,
new gfx::ImageSkia(*rb.GetImageSkiaNamed(IDR_ASH_SHELF_ICON_SETTINGS))); new gfx::ImageSkia(*rb.GetImageSkiaNamed(IDR_ASH_SHELF_ICON_SETTINGS)));
window->SetProperty(aura::client::kHasOverviewIcon, true);
aura_window_tracker_->Add(window); aura_window_tracker_->Add(window);
} }
...@@ -441,10 +441,13 @@ void BrowserNonClientFrameViewAsh::ChildPreferredSizeChanged( ...@@ -441,10 +441,13 @@ void BrowserNonClientFrameViewAsh::ChildPreferredSizeChanged(
void BrowserNonClientFrameViewAsh::OnOverviewModeStarting() { void BrowserNonClientFrameViewAsh::OnOverviewModeStarting() {
in_overview_mode_ = true; in_overview_mode_ = true;
// Update the window icon so that overview mode can grab the icon from // Update the window icon if needed so that overview mode can grab the icon
// aura::client::kWindowIcon to display. // from kAppIconKey or kWindowIconKey to display.
if (base::FeatureList::IsEnabled(ash::features::kNewOverviewUi)) if (base::FeatureList::IsEnabled(ash::features::kNewOverviewUi) &&
!frame()->GetNativeWindow()->GetProperty(
aura::client::kHasOverviewIcon)) {
frame()->UpdateWindowIcon(); frame()->UpdateWindowIcon();
}
frame()->GetNativeWindow()->SetProperty(aura::client::kTopViewColor, frame()->GetNativeWindow()->SetProperty(aura::client::kTopViewColor,
GetFrameColor()); GetFrameColor());
......
...@@ -48,6 +48,7 @@ DEFINE_UI_CLASS_PROPERTY_KEY(bool, kCreatedByUserGesture, false); ...@@ -48,6 +48,7 @@ DEFINE_UI_CLASS_PROPERTY_KEY(bool, kCreatedByUserGesture, false);
DEFINE_UI_CLASS_PROPERTY_KEY(bool, kDrawAttentionKey, false); DEFINE_UI_CLASS_PROPERTY_KEY(bool, kDrawAttentionKey, false);
DEFINE_UI_CLASS_PROPERTY_KEY(FocusClient*, kFocusClientKey, nullptr); DEFINE_UI_CLASS_PROPERTY_KEY(FocusClient*, kFocusClientKey, nullptr);
DEFINE_UI_CLASS_PROPERTY_KEY(bool, kHasBackdrop, false); DEFINE_UI_CLASS_PROPERTY_KEY(bool, kHasBackdrop, false);
DEFINE_UI_CLASS_PROPERTY_KEY(bool, kHasOverviewIcon, false);
DEFINE_UI_CLASS_PROPERTY_KEY(Window*, kHostWindowKey, nullptr); DEFINE_UI_CLASS_PROPERTY_KEY(Window*, kHostWindowKey, nullptr);
DEFINE_UI_CLASS_PROPERTY_KEY(bool, kImmersiveFullscreenKey, false); DEFINE_UI_CLASS_PROPERTY_KEY(bool, kImmersiveFullscreenKey, false);
DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(gfx::Size, kMinimumSize, nullptr); DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(gfx::Size, kMinimumSize, nullptr);
......
...@@ -81,6 +81,10 @@ AURA_EXPORT extern const WindowProperty<FocusClient*>* const kFocusClientKey; ...@@ -81,6 +81,10 @@ AURA_EXPORT extern const WindowProperty<FocusClient*>* const kFocusClientKey;
// (typically black) that covers the desktop behind the window. // (typically black) that covers the desktop behind the window.
AURA_EXPORT extern const WindowProperty<bool>* const kHasBackdrop; AURA_EXPORT extern const WindowProperty<bool>* const kHasBackdrop;
// A bool property key to specify if the window has a icon set for displaying in
// overivew mode.
AURA_EXPORT extern const WindowProperty<bool>* const kHasOverviewIcon;
// A property key to store the host window of a window. This lets // A property key to store the host window of a window. This lets
// WebContentsViews find the windows that should constrain NPAPI plugins. // WebContentsViews find the windows that should constrain NPAPI plugins.
AURA_EXPORT extern const WindowProperty<Window*>* const kHostWindowKey; AURA_EXPORT extern const WindowProperty<Window*>* const kHostWindowKey;
......
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