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

Unified Diff: chrome/browser/ui/views/task_manager_view.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 | « chrome/browser/ui/ash/property_util.cc ('k') | services/ui/public/interfaces/window_manager.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/task_manager_view.cc
diff --git a/chrome/browser/ui/views/task_manager_view.cc b/chrome/browser/ui/views/task_manager_view.cc
index a25543d661ba35f1ae2f2c39845b3ca125af16a2..a1108fa3bd006b10cdb8e1a48165397bd47210ac 100644
--- a/chrome/browser/ui/views/task_manager_view.cc
+++ b/chrome/browser/ui/views/task_manager_view.cc
@@ -41,6 +41,9 @@
#include "ash/wm/window_util.h" // nogncheck
#include "chrome/browser/ui/ash/ash_util.h" // nogncheck
#include "chrome/browser/ui/ash/property_util.h" // nogncheck
+#include "ui/aura/client/aura_constants.h"
+#include "ui/base/resource/resource_bundle.h"
+#include "ui/gfx/image/image_skia.h"
#endif // defined(USE_ASH)
#if defined(OS_WIN)
@@ -73,14 +76,14 @@ task_manager::TaskManagerTableModel* TaskManagerView::Show(Browser* browser) {
g_task_manager_view = new TaskManagerView();
- gfx::NativeWindow window =
+ gfx::NativeWindow context =
browser ? browser->window()->GetNativeWindow() : nullptr;
#if defined(USE_ASH)
- if (!chrome::IsRunningInMash() && !window)
- window = ash::wm::GetActiveWindow();
+ if (!chrome::IsRunningInMash() && !context)
+ context = ash::wm::GetActiveWindow();
#endif
- DialogDelegate::CreateDialogWidget(g_task_manager_view, window, nullptr);
+ DialogDelegate::CreateDialogWidget(g_task_manager_view, context, nullptr);
g_task_manager_view->InitAlwaysOnTopState();
#if defined(OS_WIN)
@@ -104,12 +107,13 @@ task_manager::TaskManagerTableModel* TaskManagerView::Show(Browser* browser) {
focus_manager->SetFocusedView(g_task_manager_view->tab_table_);
#if defined(USE_ASH)
- aura::Window* aura_window =
- g_task_manager_view->GetWidget()->GetNativeWindow();
- property_util::SetIntProperty(aura_window, ash::kShelfItemTypeKey,
+ aura::Window* window = g_task_manager_view->GetWidget()->GetNativeWindow();
+ property_util::SetIntProperty(window, ash::kShelfItemTypeKey,
ash::TYPE_DIALOG);
- property_util::SetIntProperty(aura_window, ash::kShelfIconResourceIdKey,
- IDR_ASH_SHELF_ICON_TASK_MANAGER);
+ ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
+ gfx::ImageSkia* icon = rb.GetImageSkiaNamed(IDR_ASH_SHELF_ICON_TASK_MANAGER);
+ // The new gfx::ImageSkia instance is owned by the window itself.
+ window->SetProperty(aura::client::kWindowIconKey, new gfx::ImageSkia(*icon));
#endif
return g_task_manager_view->table_model_.get();
}
« no previous file with comments | « chrome/browser/ui/ash/property_util.cc ('k') | services/ui/public/interfaces/window_manager.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698