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

Unified Diff: chrome/browser/ui/views/task_manager_view.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/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..c4b9aaeb6e6d8908c72bc950f0ed34f03b19a08a 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,12 @@ 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);
+ window->SetProperty(aura::client::kWindowIconKey, new gfx::ImageSkia(*icon));
James Cook 2016/11/18 00:34:49 ditto
msw 2016/11/18 00:51:40 Done.
#endif
return g_task_manager_view->table_model_.get();
}

Powered by Google App Engine
This is Rietveld 408576698