| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/task_manager/task_manager.h" | 5 #include "chrome/browser/task_manager/task_manager.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/metrics/stats_table.h" | 8 #include "base/metrics/stats_table.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/prefs/scoped_user_pref_update.h" | 10 #include "base/prefs/scoped_user_pref_update.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 : model_(model), | 66 : model_(model), |
| 67 observer_(NULL) { | 67 observer_(NULL) { |
| 68 model_->AddObserver(this); | 68 model_->AddObserver(this); |
| 69 } | 69 } |
| 70 | 70 |
| 71 virtual ~TaskManagerTableModel() { | 71 virtual ~TaskManagerTableModel() { |
| 72 model_->RemoveObserver(this); | 72 model_->RemoveObserver(this); |
| 73 } | 73 } |
| 74 | 74 |
| 75 // TableModel overrides: | 75 // TableModel overrides: |
| 76 virtual int RowCount() OVERRIDE; | 76 virtual int RowCount() override; |
| 77 virtual base::string16 GetText(int row, int column) OVERRIDE; | 77 virtual base::string16 GetText(int row, int column) override; |
| 78 virtual gfx::ImageSkia GetIcon(int row) OVERRIDE; | 78 virtual gfx::ImageSkia GetIcon(int row) override; |
| 79 virtual void SetObserver(ui::TableModelObserver* observer) OVERRIDE; | 79 virtual void SetObserver(ui::TableModelObserver* observer) override; |
| 80 virtual int CompareValues(int row1, int row2, int column_id) OVERRIDE; | 80 virtual int CompareValues(int row1, int row2, int column_id) override; |
| 81 | 81 |
| 82 // TableGrouper overrides: | 82 // TableGrouper overrides: |
| 83 virtual void GetGroupRange(int model_index, | 83 virtual void GetGroupRange(int model_index, |
| 84 views::GroupRange* range) OVERRIDE; | 84 views::GroupRange* range) override; |
| 85 | 85 |
| 86 // TaskManagerModelObserver overrides: | 86 // TaskManagerModelObserver overrides: |
| 87 virtual void OnModelChanged() OVERRIDE; | 87 virtual void OnModelChanged() override; |
| 88 virtual void OnItemsChanged(int start, int length) OVERRIDE; | 88 virtual void OnItemsChanged(int start, int length) override; |
| 89 virtual void OnItemsAdded(int start, int length) OVERRIDE; | 89 virtual void OnItemsAdded(int start, int length) override; |
| 90 virtual void OnItemsRemoved(int start, int length) OVERRIDE; | 90 virtual void OnItemsRemoved(int start, int length) override; |
| 91 | 91 |
| 92 private: | 92 private: |
| 93 TaskManagerModel* model_; | 93 TaskManagerModel* model_; |
| 94 ui::TableModelObserver* observer_; | 94 ui::TableModelObserver* observer_; |
| 95 | 95 |
| 96 DISALLOW_COPY_AND_ASSIGN(TaskManagerTableModel); | 96 DISALLOW_COPY_AND_ASSIGN(TaskManagerTableModel); |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 int TaskManagerTableModel::RowCount() { | 99 int TaskManagerTableModel::RowCount() { |
| 100 return model_->ResourceCount(); | 100 return model_->ResourceCount(); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 public views::ContextMenuController, | 152 public views::ContextMenuController, |
| 153 public ui::SimpleMenuModel::Delegate { | 153 public ui::SimpleMenuModel::Delegate { |
| 154 public: | 154 public: |
| 155 explicit TaskManagerView(chrome::HostDesktopType desktop_type); | 155 explicit TaskManagerView(chrome::HostDesktopType desktop_type); |
| 156 virtual ~TaskManagerView(); | 156 virtual ~TaskManagerView(); |
| 157 | 157 |
| 158 // Shows the Task manager window, or re-activates an existing one. | 158 // Shows the Task manager window, or re-activates an existing one. |
| 159 static void Show(Browser* browser); | 159 static void Show(Browser* browser); |
| 160 | 160 |
| 161 // views::View: | 161 // views::View: |
| 162 virtual void Layout() OVERRIDE; | 162 virtual void Layout() override; |
| 163 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 163 virtual gfx::Size GetPreferredSize() const override; |
| 164 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; | 164 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) override; |
| 165 virtual void ViewHierarchyChanged( | 165 virtual void ViewHierarchyChanged( |
| 166 const ViewHierarchyChangedDetails& details) OVERRIDE; | 166 const ViewHierarchyChangedDetails& details) override; |
| 167 | 167 |
| 168 // views::ButtonListener: | 168 // views::ButtonListener: |
| 169 virtual void ButtonPressed(views::Button* sender, | 169 virtual void ButtonPressed(views::Button* sender, |
| 170 const ui::Event& event) OVERRIDE; | 170 const ui::Event& event) override; |
| 171 | 171 |
| 172 // views::DialogDelegateView: | 172 // views::DialogDelegateView: |
| 173 virtual bool CanResize() const OVERRIDE; | 173 virtual bool CanResize() const override; |
| 174 virtual bool CanMaximize() const OVERRIDE; | 174 virtual bool CanMaximize() const override; |
| 175 virtual bool CanMinimize() const OVERRIDE; | 175 virtual bool CanMinimize() const override; |
| 176 virtual bool ExecuteWindowsCommand(int command_id) OVERRIDE; | 176 virtual bool ExecuteWindowsCommand(int command_id) override; |
| 177 virtual base::string16 GetWindowTitle() const OVERRIDE; | 177 virtual base::string16 GetWindowTitle() const override; |
| 178 virtual std::string GetWindowName() const OVERRIDE; | 178 virtual std::string GetWindowName() const override; |
| 179 virtual int GetDialogButtons() const OVERRIDE; | 179 virtual int GetDialogButtons() const override; |
| 180 virtual void WindowClosing() OVERRIDE; | 180 virtual void WindowClosing() override; |
| 181 virtual bool UseNewStyleForThisDialog() const OVERRIDE; | 181 virtual bool UseNewStyleForThisDialog() const override; |
| 182 | 182 |
| 183 // views::TableViewObserver: | 183 // views::TableViewObserver: |
| 184 virtual void OnSelectionChanged() OVERRIDE; | 184 virtual void OnSelectionChanged() override; |
| 185 virtual void OnDoubleClick() OVERRIDE; | 185 virtual void OnDoubleClick() override; |
| 186 virtual void OnKeyDown(ui::KeyboardCode keycode) OVERRIDE; | 186 virtual void OnKeyDown(ui::KeyboardCode keycode) override; |
| 187 | 187 |
| 188 // views::LinkListener: | 188 // views::LinkListener: |
| 189 virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; | 189 virtual void LinkClicked(views::Link* source, int event_flags) override; |
| 190 | 190 |
| 191 // Called by the column picker to pick up any new stat counters that | 191 // Called by the column picker to pick up any new stat counters that |
| 192 // may have appeared since last time. | 192 // may have appeared since last time. |
| 193 void UpdateStatsCounters(); | 193 void UpdateStatsCounters(); |
| 194 | 194 |
| 195 // views::ContextMenuController: | 195 // views::ContextMenuController: |
| 196 virtual void ShowContextMenuForView(views::View* source, | 196 virtual void ShowContextMenuForView(views::View* source, |
| 197 const gfx::Point& point, | 197 const gfx::Point& point, |
| 198 ui::MenuSourceType source_type) OVERRIDE; | 198 ui::MenuSourceType source_type) override; |
| 199 | 199 |
| 200 // ui::SimpleMenuModel::Delegate: | 200 // ui::SimpleMenuModel::Delegate: |
| 201 virtual bool IsCommandIdChecked(int id) const OVERRIDE; | 201 virtual bool IsCommandIdChecked(int id) const override; |
| 202 virtual bool IsCommandIdEnabled(int id) const OVERRIDE; | 202 virtual bool IsCommandIdEnabled(int id) const override; |
| 203 virtual bool GetAcceleratorForCommandId( | 203 virtual bool GetAcceleratorForCommandId( |
| 204 int command_id, | 204 int command_id, |
| 205 ui::Accelerator* accelerator) OVERRIDE; | 205 ui::Accelerator* accelerator) override; |
| 206 virtual void ExecuteCommand(int id, int event_flags) OVERRIDE; | 206 virtual void ExecuteCommand(int id, int event_flags) override; |
| 207 | 207 |
| 208 private: | 208 private: |
| 209 // Creates the child controls. | 209 // Creates the child controls. |
| 210 void Init(); | 210 void Init(); |
| 211 | 211 |
| 212 // Initializes the state of the always-on-top setting as the window is shown. | 212 // Initializes the state of the always-on-top setting as the window is shown. |
| 213 void InitAlwaysOnTopState(); | 213 void InitAlwaysOnTopState(); |
| 214 | 214 |
| 215 // Activates the tab associated with the focused row. | 215 // Activates the tab associated with the focused row. |
| 216 void ActivateFocusedTab(); | 216 void ActivateFocusedTab(); |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 } // namespace | 656 } // namespace |
| 657 | 657 |
| 658 namespace chrome { | 658 namespace chrome { |
| 659 | 659 |
| 660 // Declared in browser_dialogs.h so others don't need to depend on our header. | 660 // Declared in browser_dialogs.h so others don't need to depend on our header. |
| 661 void ShowTaskManager(Browser* browser) { | 661 void ShowTaskManager(Browser* browser) { |
| 662 TaskManagerView::Show(browser); | 662 TaskManagerView::Show(browser); |
| 663 } | 663 } |
| 664 | 664 |
| 665 } // namespace chrome | 665 } // namespace chrome |
| OLD | NEW |