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

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

Issue 2479353003: Revert of Window prerequisites for ShelfWindowWatcher panel support. (Closed)
Patch Set: 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 24288c8fe5d137072d4abc5acf72f9af81670f41..345ec9c431285011a9826b41163c27d7e90bffcc 100644
--- a/ui/views/widget/native_widget_aura.cc
+++ b/ui/views/widget/native_widget_aura.cc
@@ -74,15 +74,6 @@
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
////////////////////////////////////////////////////////////////////////////////
@@ -111,10 +102,17 @@
void NativeWidgetAura::AssignIconToAuraWindow(aura::Window* window,
const gfx::ImageSkia& window_icon,
const gfx::ImageSkia& app_icon) {
- if (window) {
- SetIcon(window, aura::client::kWindowIconKey, window_icon);
- SetIcon(window, aura::client::kAppIconKey, app_icon);
- }
+ if (!window)
+ return;
+
+ if (window_icon.isNull() && app_icon.isNull()) {
+ window->ClearProperty(aura::client::kWindowIconKey);
+ return;
+ }
+
+ 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