OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_COCOA_TASK_MANAGER_MAC_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_TASK_MANAGER_MAC_H_ |
6 #define CHROME_BROWSER_UI_COCOA_TASK_MANAGER_MAC_H_ | 6 #define CHROME_BROWSER_UI_COCOA_TASK_MANAGER_MAC_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
10 #include <vector> | 10 #include <vector> |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 @end | 67 @end |
68 | 68 |
69 // This class listens to task changed events sent by chrome. | 69 // This class listens to task changed events sent by chrome. |
70 class TaskManagerMac : public TaskManagerModelObserver, | 70 class TaskManagerMac : public TaskManagerModelObserver, |
71 public TableRowNSImageCache::Table { | 71 public TableRowNSImageCache::Table { |
72 public: | 72 public: |
73 TaskManagerMac(TaskManager* task_manager, bool highlight_background); | 73 TaskManagerMac(TaskManager* task_manager, bool highlight_background); |
74 virtual ~TaskManagerMac(); | 74 virtual ~TaskManagerMac(); |
75 | 75 |
76 // TaskManagerModelObserver | 76 // TaskManagerModelObserver |
77 virtual void OnModelChanged(); | 77 virtual void OnModelChanged() OVERRIDE; |
78 virtual void OnItemsChanged(int start, int length); | 78 virtual void OnItemsChanged(int start, int length) OVERRIDE; |
79 virtual void OnItemsAdded(int start, int length); | 79 virtual void OnItemsAdded(int start, int length) OVERRIDE; |
80 virtual void OnItemsRemoved(int start, int length); | 80 virtual void OnItemsRemoved(int start, int length) OVERRIDE; |
81 | 81 |
82 // Called by the cocoa window controller when its window closes and the | 82 // Called by the cocoa window controller when its window closes and the |
83 // controller destroyed itself. Informs the model to stop updating. | 83 // controller destroyed itself. Informs the model to stop updating. |
84 void WindowWasClosed(); | 84 void WindowWasClosed(); |
85 | 85 |
86 // TableRowNSImageCache::Table | 86 // TableRowNSImageCache::Table |
87 virtual int RowCount() const; | 87 virtual int RowCount() const OVERRIDE; |
88 virtual SkBitmap GetIcon(int r) const; | 88 virtual SkBitmap GetIcon(int r) const OVERRIDE; |
89 | 89 |
90 // Creates the task manager if it doesn't exist; otherwise, it activates the | 90 // Creates the task manager if it doesn't exist; otherwise, it activates the |
91 // existing task manager window. Highlights background resources if | 91 // existing task manager window. Highlights background resources if |
92 // |highlight_background_resources| is true. | 92 // |highlight_background_resources| is true. |
93 static void Show(bool highlight_background_resources); | 93 static void Show(bool highlight_background_resources); |
94 | 94 |
95 // Returns the TaskManager observed by |this|. | 95 // Returns the TaskManager observed by |this|. |
96 TaskManager* task_manager() { return task_manager_; } | 96 TaskManager* task_manager() { return task_manager_; } |
97 | 97 |
98 // Lazily converts the image at the given row and caches it in |icon_cache_|. | 98 // Lazily converts the image at the given row and caches it in |icon_cache_|. |
(...skipping 22 matching lines...) Expand all Loading... |
121 bool highlight_background_resources_; | 121 bool highlight_background_resources_; |
122 | 122 |
123 // An open task manager window. There can only be one open at a time. This | 123 // An open task manager window. There can only be one open at a time. This |
124 // is reset to NULL when the window is closed. | 124 // is reset to NULL when the window is closed. |
125 static TaskManagerMac* instance_; | 125 static TaskManagerMac* instance_; |
126 | 126 |
127 DISALLOW_COPY_AND_ASSIGN(TaskManagerMac); | 127 DISALLOW_COPY_AND_ASSIGN(TaskManagerMac); |
128 }; | 128 }; |
129 | 129 |
130 #endif // CHROME_BROWSER_UI_COCOA_TASK_MANAGER_MAC_H_ | 130 #endif // CHROME_BROWSER_UI_COCOA_TASK_MANAGER_MAC_H_ |
OLD | NEW |