| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 browser->profile()->GetPath()), | 96 browser->profile()->GetPath()), |
| 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. |
| 107 static constexpr char kTaskManagerId[] = "TaskManagerId"; |
| 108 window->SetProperty(ash::kShelfIDKey, new ash::ShelfID(kTaskManagerId)); |
| 106 window->SetProperty<int>(ash::kShelfItemTypeKey, ash::TYPE_DIALOG); | 109 window->SetProperty<int>(ash::kShelfItemTypeKey, ash::TYPE_DIALOG); |
| 107 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 110 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 108 gfx::ImageSkia* icon = rb.GetImageSkiaNamed(IDR_ASH_SHELF_ICON_TASK_MANAGER); | 111 gfx::ImageSkia* icon = rb.GetImageSkiaNamed(IDR_ASH_SHELF_ICON_TASK_MANAGER); |
| 109 // The new gfx::ImageSkia instance is owned by the window itself. | 112 // The new gfx::ImageSkia instance is owned by the window itself. |
| 110 window->SetProperty(aura::client::kWindowIconKey, new gfx::ImageSkia(*icon)); | 113 window->SetProperty(aura::client::kWindowIconKey, new gfx::ImageSkia(*icon)); |
| 111 #endif | 114 #endif |
| 112 return g_task_manager_view->table_model_.get(); | 115 return g_task_manager_view->table_model_.get(); |
| 113 } | 116 } |
| 114 | 117 |
| 115 // static | 118 // static |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 if (!g_browser_process->local_state()) | 368 if (!g_browser_process->local_state()) |
| 366 return; | 369 return; |
| 367 | 370 |
| 368 const base::DictionaryValue* dictionary = | 371 const base::DictionaryValue* dictionary = |
| 369 g_browser_process->local_state()->GetDictionary(GetWindowName()); | 372 g_browser_process->local_state()->GetDictionary(GetWindowName()); |
| 370 if (dictionary) | 373 if (dictionary) |
| 371 dictionary->GetBoolean("always_on_top", &is_always_on_top_); | 374 dictionary->GetBoolean("always_on_top", &is_always_on_top_); |
| 372 } | 375 } |
| 373 | 376 |
| 374 } // namespace task_manager | 377 } // namespace task_manager |
| OLD | NEW |