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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 // Generated as crx_file::id_util::GenerateId("org.chromium.taskmanager") | 107 // Generated as crx_file::id_util::GenerateId("org.chromium.taskmanager") |
108 static constexpr char kTaskManagerId[] = "ijaigheoohcacdnplfbdimmcfldnnhdi"; | 108 static constexpr char kTaskManagerId[] = "ijaigheoohcacdnplfbdimmcfldnnhdi"; |
109 window->SetProperty(ash::kShelfIDKey, new ash::ShelfID(kTaskManagerId)); | 109 const ash::ShelfID shelf_id(kTaskManagerId); |
| 110 window->SetProperty(ash::kShelfIDKey, new std::string(shelf_id.Serialize())); |
110 window->SetProperty<int>(ash::kShelfItemTypeKey, ash::TYPE_DIALOG); | 111 window->SetProperty<int>(ash::kShelfItemTypeKey, ash::TYPE_DIALOG); |
111 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 112 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
112 gfx::ImageSkia* icon = rb.GetImageSkiaNamed(IDR_ASH_SHELF_ICON_TASK_MANAGER); | 113 gfx::ImageSkia* icon = rb.GetImageSkiaNamed(IDR_ASH_SHELF_ICON_TASK_MANAGER); |
113 // The new gfx::ImageSkia instance is owned by the window itself. | 114 // The new gfx::ImageSkia instance is owned by the window itself. |
114 window->SetProperty(aura::client::kWindowIconKey, new gfx::ImageSkia(*icon)); | 115 window->SetProperty(aura::client::kWindowIconKey, new gfx::ImageSkia(*icon)); |
115 #endif | 116 #endif |
116 return g_task_manager_view->table_model_.get(); | 117 return g_task_manager_view->table_model_.get(); |
117 } | 118 } |
118 | 119 |
119 // static | 120 // static |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 if (!g_browser_process->local_state()) | 370 if (!g_browser_process->local_state()) |
370 return; | 371 return; |
371 | 372 |
372 const base::DictionaryValue* dictionary = | 373 const base::DictionaryValue* dictionary = |
373 g_browser_process->local_state()->GetDictionary(GetWindowName()); | 374 g_browser_process->local_state()->GetDictionary(GetWindowName()); |
374 if (dictionary) | 375 if (dictionary) |
375 dictionary->GetBoolean("always_on_top", &is_always_on_top_); | 376 dictionary->GetBoolean("always_on_top", &is_always_on_top_); |
376 } | 377 } |
377 | 378 |
378 } // namespace task_manager | 379 } // namespace task_manager |
OLD | NEW |