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

Unified Diff: ui/views/widget/native_widget_aura.cc

Issue 2480713003: Window prerequisites for ShelfWindowWatcher panel support. (Closed)
Patch Set: Support and test pre-widget exo ShellSurface::SetApplicationId. Created 4 years, 1 month 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 | « ui/views/mus/desktop_window_tree_host_mus.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/native_widget_aura.cc
diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc
index 345ec9c431285011a9826b41163c27d7e90bffcc..24288c8fe5d137072d4abc5acf72f9af81670f41 100644
--- a/ui/views/widget/native_widget_aura.cc
+++ b/ui/views/widget/native_widget_aura.cc
@@ -74,6 +74,15 @@ void SetRestoreBounds(aura::Window* window, const gfx::Rect& bounds) {
window->SetProperty(aura::client::kRestoreBoundsKey, new gfx::Rect(bounds));
}
+void SetIcon(aura::Window* window,
+ const aura::WindowProperty<gfx::ImageSkia*>* key,
+ const gfx::ImageSkia& value) {
+ if (value.isNull())
+ window->ClearProperty(key);
+ else
+ window->SetProperty(key, new gfx::ImageSkia(value));
+}
+
} // namespace
////////////////////////////////////////////////////////////////////////////////
@@ -102,17 +111,10 @@ void NativeWidgetAura::RegisterNativeWidgetForWindow(
void NativeWidgetAura::AssignIconToAuraWindow(aura::Window* window,
const gfx::ImageSkia& window_icon,
const gfx::ImageSkia& app_icon) {
- if (!window)
- return;
-
- if (window_icon.isNull() && app_icon.isNull()) {
- window->ClearProperty(aura::client::kWindowIconKey);
- return;
+ if (window) {
+ SetIcon(window, aura::client::kWindowIconKey, window_icon);
+ SetIcon(window, aura::client::kAppIconKey, app_icon);
}
-
- window->SetProperty(
- aura::client::kWindowIconKey,
- new gfx::ImageSkia(!window_icon.isNull() ? window_icon : app_icon));
}
////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « ui/views/mus/desktop_window_tree_host_mus.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698