| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/views/task_manager_view.h" | 5 #include "chrome/browser/ui/views/task_manager_view.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 views::HWNDForWidget(g_task_manager_view->GetWidget())); | 97 views::HWNDForWidget(g_task_manager_view->GetWidget())); |
| 98 } | 98 } |
| 99 #endif | 99 #endif |
| 100 | 100 |
| 101 g_task_manager_view->SelectTaskOfActiveTab(browser); | 101 g_task_manager_view->SelectTaskOfActiveTab(browser); |
| 102 g_task_manager_view->GetWidget()->Show(); | 102 g_task_manager_view->GetWidget()->Show(); |
| 103 | 103 |
| 104 #if defined(USE_ASH) | 104 #if defined(USE_ASH) |
| 105 aura::Window* window = g_task_manager_view->GetWidget()->GetNativeWindow(); | 105 aura::Window* window = g_task_manager_view->GetWidget()->GetNativeWindow(); |
| 106 // An app id for task manager windows, also used to identify the shelf item. | 106 // An app id for task manager windows, also used to identify the shelf item. |
| 107 static constexpr char kTaskManagerId[] = "TaskManagerId"; | 107 // Generated as crx_file::id_util::GenerateId("org.chromium.taskmanager") |
| 108 static constexpr char kTaskManagerId[] = "ijaigheoohcacdnplfbdimmcfldnnhdi"; |
| 108 window->SetProperty(ash::kShelfIDKey, new ash::ShelfID(kTaskManagerId)); | 109 window->SetProperty(ash::kShelfIDKey, new ash::ShelfID(kTaskManagerId)); |
| 109 window->SetProperty<int>(ash::kShelfItemTypeKey, ash::TYPE_DIALOG); | 110 window->SetProperty<int>(ash::kShelfItemTypeKey, ash::TYPE_DIALOG); |
| 110 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 111 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 111 gfx::ImageSkia* icon = rb.GetImageSkiaNamed(IDR_ASH_SHELF_ICON_TASK_MANAGER); | 112 gfx::ImageSkia* icon = rb.GetImageSkiaNamed(IDR_ASH_SHELF_ICON_TASK_MANAGER); |
| 112 // The new gfx::ImageSkia instance is owned by the window itself. | 113 // The new gfx::ImageSkia instance is owned by the window itself. |
| 113 window->SetProperty(aura::client::kWindowIconKey, new gfx::ImageSkia(*icon)); | 114 window->SetProperty(aura::client::kWindowIconKey, new gfx::ImageSkia(*icon)); |
| 114 #endif | 115 #endif |
| 115 return g_task_manager_view->table_model_.get(); | 116 return g_task_manager_view->table_model_.get(); |
| 116 } | 117 } |
| 117 | 118 |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 if (!g_browser_process->local_state()) | 369 if (!g_browser_process->local_state()) |
| 369 return; | 370 return; |
| 370 | 371 |
| 371 const base::DictionaryValue* dictionary = | 372 const base::DictionaryValue* dictionary = |
| 372 g_browser_process->local_state()->GetDictionary(GetWindowName()); | 373 g_browser_process->local_state()->GetDictionary(GetWindowName()); |
| 373 if (dictionary) | 374 if (dictionary) |
| 374 dictionary->GetBoolean("always_on_top", &is_always_on_top_); | 375 dictionary->GetBoolean("always_on_top", &is_always_on_top_); |
| 375 } | 376 } |
| 376 | 377 |
| 377 } // namespace task_manager | 378 } // namespace task_manager |
| OLD | NEW |