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

Unified Diff: chrome/browser/ui/ash/launcher/settings_window_observer.cc

Issue 2514473003: Replace IDR window property use with gfx::ImageSkia icons. (Closed)
Patch Set: Remove TODOs let mash Task Manager and Settings icons temporarily regress. 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
Index: chrome/browser/ui/ash/launcher/settings_window_observer.cc
diff --git a/chrome/browser/ui/ash/launcher/settings_window_observer.cc b/chrome/browser/ui/ash/launcher/settings_window_observer.cc
index 39b2b829b690ecec2bb507d440c39442ad32094b..bf21df23b05c24eea6ddbd4a35faf5efa83c45a3 100644
--- a/chrome/browser/ui/ash/launcher/settings_window_observer.cc
+++ b/chrome/browser/ui/ash/launcher/settings_window_observer.cc
@@ -17,10 +17,13 @@
#include "services/ui/public/cpp/window.h"
#include "services/ui/public/cpp/window_property.h"
#include "services/ui/public/interfaces/window_manager.mojom.h"
+#include "ui/aura/client/aura_constants.h"
#include "ui/aura/mus/mus_util.h"
#include "ui/aura/window.h"
#include "ui/aura/window_property.h"
#include "ui/base/l10n/l10n_util.h"
+#include "ui/base/resource/resource_bundle.h"
+#include "ui/gfx/image/image_skia.h"
namespace {
@@ -84,8 +87,9 @@ void SettingsWindowObserver::OnNewSettingsWindow(Browser* settings_browser) {
l10n_util::GetStringUTF16(IDS_SETTINGS_TITLE));
property_util::SetIntProperty(window, ash::kShelfItemTypeKey,
ash::TYPE_DIALOG);
- property_util::SetIntProperty(window, ash::kShelfIconResourceIdKey,
- IDR_ASH_SHELF_ICON_SETTINGS);
+ ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
+ gfx::ImageSkia* icon = rb.GetImageSkiaNamed(IDR_ASH_SHELF_ICON_SETTINGS);
+ window->SetProperty(aura::client::kWindowIconKey, new gfx::ImageSkia(*icon));
James Cook 2016/11/18 00:34:49 nit: Maybe a comment about ownership of the icon p
msw 2016/11/18 00:51:40 Done. (though this is a fairly common pattern; tit
if (chrome::IsRunningInMash())
ui_window_tracker_->Add(aura::GetMusWindow(window));

Powered by Google App Engine
This is Rietveld 408576698