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 #ifndef CHROME_BROWSER_UI_VIEWS_NEW_TASK_MANAGER_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_NEW_TASK_MANAGER_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_NEW_TASK_MANAGER_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_NEW_TASK_MANAGER_VIEW_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "chrome/browser/ui/host_desktop.h" | |
12 #include "chrome/browser/ui/task_manager/task_manager_table_model.h" | 11 #include "chrome/browser/ui/task_manager/task_manager_table_model.h" |
13 #include "ui/base/models/simple_menu_model.h" | 12 #include "ui/base/models/simple_menu_model.h" |
14 #include "ui/base/models/table_model.h" | 13 #include "ui/base/models/table_model.h" |
15 #include "ui/views/context_menu_controller.h" | 14 #include "ui/views/context_menu_controller.h" |
16 #include "ui/views/controls/button/label_button.h" | 15 #include "ui/views/controls/button/label_button.h" |
17 #include "ui/views/controls/link_listener.h" | 16 #include "ui/views/controls/link_listener.h" |
18 #include "ui/views/controls/menu/menu_runner.h" | 17 #include "ui/views/controls/menu/menu_runner.h" |
19 #include "ui/views/controls/table/table_grouper.h" | 18 #include "ui/views/controls/table/table_grouper.h" |
20 #include "ui/views/controls/table/table_view_observer.h" | 19 #include "ui/views/controls/table/table_view_observer.h" |
21 #include "ui/views/window/dialog_delegate.h" | 20 #include "ui/views/window/dialog_delegate.h" |
22 | 21 |
| 22 class Browser; |
| 23 |
23 namespace views { | 24 namespace views { |
24 class LabelButton; | 25 class LabelButton; |
25 class Link; | 26 class Link; |
26 class TableView; | 27 class TableView; |
27 class View; | 28 class View; |
28 } // namespace views | 29 } // namespace views |
29 | 30 |
30 namespace task_management { | 31 namespace task_management { |
31 | 32 |
32 class TaskManagerTableModel; | 33 class TaskManagerTableModel; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 // ui::SimpleMenuModel::Delegate: | 98 // ui::SimpleMenuModel::Delegate: |
98 bool IsCommandIdChecked(int id) const override; | 99 bool IsCommandIdChecked(int id) const override; |
99 bool IsCommandIdEnabled(int id) const override; | 100 bool IsCommandIdEnabled(int id) const override; |
100 bool GetAcceleratorForCommandId(int command_id, | 101 bool GetAcceleratorForCommandId(int command_id, |
101 ui::Accelerator* accelerator) override; | 102 ui::Accelerator* accelerator) override; |
102 void ExecuteCommand(int id, int event_flags) override; | 103 void ExecuteCommand(int id, int event_flags) override; |
103 | 104 |
104 private: | 105 private: |
105 friend class NewTaskManagerViewTest; | 106 friend class NewTaskManagerViewTest; |
106 | 107 |
107 explicit NewTaskManagerView(chrome::HostDesktopType desktop_type); | 108 NewTaskManagerView(); |
108 | 109 |
109 static NewTaskManagerView* GetInstanceForTests(); | 110 static NewTaskManagerView* GetInstanceForTests(); |
110 | 111 |
111 // Creates the child controls. | 112 // Creates the child controls. |
112 void Init(); | 113 void Init(); |
113 | 114 |
114 // Initializes the state of the always-on-top setting as the window is shown. | 115 // Initializes the state of the always-on-top setting as the window is shown. |
115 void InitAlwaysOnTopState(); | 116 void InitAlwaysOnTopState(); |
116 | 117 |
117 // Activates the tab associated with the focused row. | 118 // Activates the tab associated with the focused row. |
(...skipping 10 matching lines...) Expand all Loading... |
128 base::string16 always_on_top_menu_text_; | 129 base::string16 always_on_top_menu_text_; |
129 | 130 |
130 views::LabelButton* kill_button_; | 131 views::LabelButton* kill_button_; |
131 views::Link* about_memory_link_; | 132 views::Link* about_memory_link_; |
132 views::TableView* tab_table_; | 133 views::TableView* tab_table_; |
133 views::View* tab_table_parent_; | 134 views::View* tab_table_parent_; |
134 | 135 |
135 // all possible columns, not necessarily visible | 136 // all possible columns, not necessarily visible |
136 std::vector<ui::TableColumn> columns_; | 137 std::vector<ui::TableColumn> columns_; |
137 | 138 |
138 // The host desktop type this task manager belongs to. | |
139 const chrome::HostDesktopType desktop_type_; | |
140 | |
141 // True when the Task Manager window should be shown on top of other windows. | 139 // True when the Task Manager window should be shown on top of other windows. |
142 bool is_always_on_top_; | 140 bool is_always_on_top_; |
143 | 141 |
144 DISALLOW_COPY_AND_ASSIGN(NewTaskManagerView); | 142 DISALLOW_COPY_AND_ASSIGN(NewTaskManagerView); |
145 }; | 143 }; |
146 | 144 |
147 } // namespace task_management | 145 } // namespace task_management |
148 | 146 |
149 #endif // CHROME_BROWSER_UI_VIEWS_NEW_TASK_MANAGER_VIEW_H_ | 147 #endif // CHROME_BROWSER_UI_VIEWS_NEW_TASK_MANAGER_VIEW_H_ |
OLD | NEW |