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(); |
} |