| 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" |
| 11 #include "chrome/browser/profiles/profile_manager.h" | 11 #include "chrome/browser/profiles/profile_manager.h" |
| 12 #include "chrome/browser/profiles/profile_window.h" | 12 #include "chrome/browser/profiles/profile_window.h" |
| 13 #include "chrome/browser/task_manager/task_manager_interface.h" | 13 #include "chrome/browser/task_manager/task_manager_interface.h" |
| 14 #include "chrome/browser/task_manager/task_manager_observer.h" | 14 #include "chrome/browser/task_manager/task_manager_observer.h" |
| 15 #include "chrome/browser/ui/browser_dialogs.h" |
| 15 #include "chrome/browser/ui/browser_finder.h" | 16 #include "chrome/browser/ui/browser_finder.h" |
| 16 #include "chrome/browser/ui/browser_navigator_params.h" | 17 #include "chrome/browser/ui/browser_navigator_params.h" |
| 17 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 18 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 18 #include "chrome/browser/ui/task_manager/task_manager_columns.h" | 19 #include "chrome/browser/ui/task_manager/task_manager_columns.h" |
| 19 #include "chrome/browser/ui/user_manager.h" | 20 #include "chrome/browser/ui/user_manager.h" |
| 20 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" | 21 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" |
| 21 #include "chrome/common/pref_names.h" | 22 #include "chrome/common/pref_names.h" |
| 22 #include "chrome/common/url_constants.h" | 23 #include "chrome/common/url_constants.h" |
| 23 #include "chrome/grit/chromium_strings.h" | 24 #include "chrome/grit/chromium_strings.h" |
| 24 #include "chrome/grit/generated_resources.h" | 25 #include "chrome/grit/generated_resources.h" |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 void TaskManagerView::MenuClosed(ui::SimpleMenuModel* source) { | 296 void TaskManagerView::MenuClosed(ui::SimpleMenuModel* source) { |
| 296 menu_model_.reset(); | 297 menu_model_.reset(); |
| 297 menu_runner_.reset(); | 298 menu_runner_.reset(); |
| 298 } | 299 } |
| 299 | 300 |
| 300 TaskManagerView::TaskManagerView() | 301 TaskManagerView::TaskManagerView() |
| 301 : tab_table_(nullptr), | 302 : tab_table_(nullptr), |
| 302 tab_table_parent_(nullptr), | 303 tab_table_parent_(nullptr), |
| 303 is_always_on_top_(false) { | 304 is_always_on_top_(false) { |
| 304 Init(); | 305 Init(); |
| 306 chrome::RecordDialogCreation(chrome::DialogIdentifier::TASK_MANAGER); |
| 305 } | 307 } |
| 306 | 308 |
| 307 // static | 309 // static |
| 308 TaskManagerView* TaskManagerView::GetInstanceForTests() { | 310 TaskManagerView* TaskManagerView::GetInstanceForTests() { |
| 309 return g_task_manager_view; | 311 return g_task_manager_view; |
| 310 } | 312 } |
| 311 | 313 |
| 312 void TaskManagerView::Init() { | 314 void TaskManagerView::Init() { |
| 313 // Create the table columns. | 315 // Create the table columns. |
| 314 for (size_t i = 0; i < kColumnsSize; ++i) { | 316 for (size_t i = 0; i < kColumnsSize; ++i) { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 if (!g_browser_process->local_state()) | 372 if (!g_browser_process->local_state()) |
| 371 return; | 373 return; |
| 372 | 374 |
| 373 const base::DictionaryValue* dictionary = | 375 const base::DictionaryValue* dictionary = |
| 374 g_browser_process->local_state()->GetDictionary(GetWindowName()); | 376 g_browser_process->local_state()->GetDictionary(GetWindowName()); |
| 375 if (dictionary) | 377 if (dictionary) |
| 376 dictionary->GetBoolean("always_on_top", &is_always_on_top_); | 378 dictionary->GetBoolean("always_on_top", &is_always_on_top_); |
| 377 } | 379 } |
| 378 | 380 |
| 379 } // namespace task_manager | 381 } // namespace task_manager |
| OLD | NEW |