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

Unified Diff: chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.cc

Issue 2667743003: mash: Fix icon window property mirroring. (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.cc
diff --git a/chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.cc b/chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.cc
index 2916896e6254b008621429d0513620f8ad079155..721243149e751cbf8b319a70e1549792a532c52f 100644
--- a/chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.cc
+++ b/chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.cc
@@ -33,6 +33,20 @@
#include "ui/views/mus/mus_client.h"
#include "ui/views/mus/mus_property_mirror.h"
+namespace {
+
+void MirrorIcon(aura::Window* window,
+ aura::Window* root_window,
+ const aura::WindowProperty<gfx::ImageSkia*>* key) {
+ gfx::ImageSkia* value = window->GetProperty(key);
+ if (!value || value->isNull())
+ root_window->ClearProperty(key);
+ else
+ root_window->SetProperty(key, new gfx::ImageSkia(*value));
+}
+
+} // namespace
+
// Relays aura content window properties to its root window (the mash frame).
// Ash relies on various window properties for frame titles, shelf items, etc.
// These properties are read from the client's root, not child content windows.
@@ -52,8 +66,7 @@ class MusPropertyMirrorAsh : public views::MusPropertyMirror {
int32_t value = window->GetProperty(ash::kShelfItemTypeKey);
root_window->SetProperty(ash::kShelfItemTypeKey, value);
} else if (key == aura::client::kAppIconKey) {
- gfx::ImageSkia* value = window->GetProperty(aura::client::kAppIconKey);
- root_window->SetProperty(aura::client::kAppIconKey, value);
+ MirrorIcon(window, root_window, aura::client::kAppIconKey);
} else if (key == aura::client::kAppIdKey) {
std::string* value = window->GetProperty(aura::client::kAppIdKey);
root_window->SetProperty(aura::client::kAppIdKey, value);
@@ -64,8 +77,7 @@ class MusPropertyMirrorAsh : public views::MusPropertyMirror {
base::string16* value = window->GetProperty(aura::client::kTitleKey);
root_window->SetProperty(aura::client::kTitleKey, value);
} else if (key == aura::client::kWindowIconKey) {
- gfx::ImageSkia* value = window->GetProperty(aura::client::kWindowIconKey);
- root_window->SetProperty(aura::client::kWindowIconKey, value);
+ MirrorIcon(window, root_window, aura::client::kWindowIconKey);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698