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

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

Issue 2222703002: Aura Icon Capture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clear Property When Null Created 4 years, 4 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 | « ui/views/widget/native_widget_aura.h ('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 1f72f3a80b73b784d387dc4fb401b40ea312b728..5476d77f62ed44f9e1c5137192bbc479ffd28c24 100644
--- a/ui/views/widget/native_widget_aura.cc
+++ b/ui/views/widget/native_widget_aura.cc
@@ -97,6 +97,23 @@ void NativeWidgetAura::RegisterNativeWidgetForWindow(
window->set_user_data(native_widget);
}
+// static
+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;
+ }
+
+ window->SetProperty(
+ aura::client::kWindowIconKey,
+ new gfx::ImageSkia(!window_icon.isNull() ? window_icon : app_icon));
+}
+
////////////////////////////////////////////////////////////////////////////////
// NativeWidgetAura, internal::NativeWidgetPrivate implementation:
@@ -355,7 +372,7 @@ bool NativeWidgetAura::SetWindowTitle(const base::string16& title) {
void NativeWidgetAura::SetWindowIcons(const gfx::ImageSkia& window_icon,
const gfx::ImageSkia& app_icon) {
- // Aura doesn't have window icons.
+ AssignIconToAuraWindow(window_, window_icon, app_icon);
}
void NativeWidgetAura::InitModalType(ui::ModalType modal_type) {
« no previous file with comments | « ui/views/widget/native_widget_aura.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698