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

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: Add owership comments. 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 | « ash/wm/window_properties.cc ('k') | chrome/browser/ui/ash/property_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..4d07c963fef7a1e67702791d3f7f9649516fb78b 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,10 @@ 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);
+ // The new gfx::ImageSkia instance is owned by the window itself.
+ window->SetProperty(aura::client::kWindowIconKey, new gfx::ImageSkia(*icon));
if (chrome::IsRunningInMash())
ui_window_tracker_->Add(aura::GetMusWindow(window));
« no previous file with comments | « ash/wm/window_properties.cc ('k') | chrome/browser/ui/ash/property_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698