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 #ifndef CHROME_BROWSER_UI_GTK_TASK_MANAGER_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_TASK_MANAGER_GTK_H_ |
6 #define CHROME_BROWSER_UI_GTK_TASK_MANAGER_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_TASK_MANAGER_GTK_H_ |
7 | 7 |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "chrome/browser/task_manager/task_manager.h" | 14 #include "chrome/browser/task_manager/task_manager.h" |
15 #include "grit/generated_resources.h" | 15 #include "grit/generated_resources.h" |
16 #include "ui/base/gtk/gtk_signal.h" | 16 #include "ui/base/gtk/gtk_signal.h" |
17 | 17 |
18 namespace gfx { | 18 namespace gfx { |
19 class Point; | 19 class Point; |
20 } | 20 } |
21 | 21 |
22 class TaskManagerGtk : public TaskManagerModelObserver { | 22 class TaskManagerGtk : public TaskManagerModelObserver { |
23 public: | 23 public: |
24 explicit TaskManagerGtk(bool highlight_background_resources); | 24 TaskManagerGtk(); |
25 virtual ~TaskManagerGtk(); | 25 virtual ~TaskManagerGtk(); |
26 | 26 |
27 // TaskManagerModelObserver | 27 // TaskManagerModelObserver |
28 virtual void OnModelChanged() OVERRIDE; | 28 virtual void OnModelChanged() OVERRIDE; |
29 virtual void OnItemsChanged(int start, int length) OVERRIDE; | 29 virtual void OnItemsChanged(int start, int length) OVERRIDE; |
30 virtual void OnItemsAdded(int start, int length) OVERRIDE; | 30 virtual void OnItemsAdded(int start, int length) OVERRIDE; |
31 virtual void OnItemsRemoved(int start, int length) OVERRIDE; | 31 virtual void OnItemsRemoved(int start, int length) OVERRIDE; |
32 | 32 |
33 // Closes the task manager window. | 33 // Closes the task manager window. |
34 void Close(); | 34 void Close(); |
35 | 35 |
36 // Creates the task manager if it doesn't exist; otherwise, it activates the | 36 // Creates the task manager if it doesn't exist; otherwise, it activates the |
37 // existing task manager window. If |highlight_background_resources| is true, | 37 // existing task manager window. |
38 // background resources are rendered with a yellow highlight (for the | 38 static void Show(); |
39 // "View Background Pages" menu item). | |
40 static void Show(bool highlight_background_resources); | |
41 | 39 |
42 private: | 40 private: |
43 class ContextMenuController; | 41 class ContextMenuController; |
44 friend class ContextMenuController; | 42 friend class ContextMenuController; |
45 | 43 |
46 // Initializes the task manager dialog. | 44 // Initializes the task manager dialog. |
47 void Init(); | 45 void Init(); |
48 | 46 |
49 // Set |dialog_|'s initial size, using its previous size if that was saved. | 47 // Set |dialog_|'s initial size, using its previous size if that was saved. |
50 void SetInitialDialogSize(); | 48 void SetInitialDialogSize(); |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 | 240 |
243 // An open task manager window. There can only be one open at a time. This | 241 // An open task manager window. There can only be one open at a time. This |
244 // is reset to NULL when the window is closed. | 242 // is reset to NULL when the window is closed. |
245 static TaskManagerGtk* instance_; | 243 static TaskManagerGtk* instance_; |
246 | 244 |
247 // We edit the selection in the OnSelectionChanged handler, and we use this | 245 // We edit the selection in the OnSelectionChanged handler, and we use this |
248 // variable to prevent ourselves from handling further changes that we | 246 // variable to prevent ourselves from handling further changes that we |
249 // ourselves caused. | 247 // ourselves caused. |
250 bool ignore_selection_changed_; | 248 bool ignore_selection_changed_; |
251 | 249 |
252 // If true, background resources are rendered with a yellow highlight. | |
253 bool highlight_background_resources_; | |
254 | |
255 DISALLOW_COPY_AND_ASSIGN(TaskManagerGtk); | 250 DISALLOW_COPY_AND_ASSIGN(TaskManagerGtk); |
256 }; | 251 }; |
257 | 252 |
258 #endif // CHROME_BROWSER_UI_GTK_TASK_MANAGER_GTK_H_ | 253 #endif // CHROME_BROWSER_UI_GTK_TASK_MANAGER_GTK_H_ |
OLD | NEW |