| OLD | NEW |
| 1 // Copyright (c) 2011 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_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> |
| 11 | 11 |
| 12 #import "base/mac/cocoa_protocols.h" | 12 #import "base/mac/cocoa_protocols.h" |
| 13 #include "base/memory/scoped_nsobject.h" | 13 #include "base/memory/scoped_nsobject.h" |
| 14 #include "chrome/browser/task_manager/task_manager.h" | 14 #include "chrome/browser/task_manager/task_manager.h" |
| 15 #include "chrome/browser/ui/cocoa/table_row_nsimage_cache.h" | 15 #include "chrome/browser/ui/cocoa/table_row_nsimage_cache.h" |
| 16 | 16 |
| 17 @class WindowSizeAutosaver; | 17 @class WindowSizeAutosaver; |
| 18 class SkBitmap; | |
| 19 class TaskManagerMac; | 18 class TaskManagerMac; |
| 20 | 19 |
| 20 namespace gfx { |
| 21 class ImageSkia; |
| 22 } |
| 23 |
| 21 // This class is responsible for loading the task manager window and for | 24 // This class is responsible for loading the task manager window and for |
| 22 // managing it. | 25 // managing it. |
| 23 @interface TaskManagerWindowController : | 26 @interface TaskManagerWindowController : |
| 24 NSWindowController<NSTableViewDataSource, | 27 NSWindowController<NSTableViewDataSource, |
| 25 NSTableViewDelegate> { | 28 NSTableViewDelegate> { |
| 26 @private | 29 @private |
| 27 IBOutlet NSTableView* tableView_; | 30 IBOutlet NSTableView* tableView_; |
| 28 IBOutlet NSButton* endProcessButton_; | 31 IBOutlet NSButton* endProcessButton_; |
| 29 TaskManagerMac* taskManagerObserver_; // weak | 32 TaskManagerMac* taskManagerObserver_; // weak |
| 30 TaskManager* taskManager_; // weak | 33 TaskManager* taskManager_; // weak |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 virtual void OnItemsChanged(int start, int length) OVERRIDE; | 81 virtual void OnItemsChanged(int start, int length) OVERRIDE; |
| 79 virtual void OnItemsAdded(int start, int length) OVERRIDE; | 82 virtual void OnItemsAdded(int start, int length) OVERRIDE; |
| 80 virtual void OnItemsRemoved(int start, int length) OVERRIDE; | 83 virtual void OnItemsRemoved(int start, int length) OVERRIDE; |
| 81 | 84 |
| 82 // Called by the cocoa window controller when its window closes and the | 85 // Called by the cocoa window controller when its window closes and the |
| 83 // controller destroyed itself. Informs the model to stop updating. | 86 // controller destroyed itself. Informs the model to stop updating. |
| 84 void WindowWasClosed(); | 87 void WindowWasClosed(); |
| 85 | 88 |
| 86 // TableRowNSImageCache::Table | 89 // TableRowNSImageCache::Table |
| 87 virtual int RowCount() const OVERRIDE; | 90 virtual int RowCount() const OVERRIDE; |
| 88 virtual SkBitmap GetIcon(int r) const OVERRIDE; | 91 virtual gfx::ImageSkia GetIcon(int r) const OVERRIDE; |
| 89 | 92 |
| 90 // Creates the task manager if it doesn't exist; otherwise, it activates the | 93 // Creates the task manager if it doesn't exist; otherwise, it activates the |
| 91 // existing task manager window. Highlights background resources if | 94 // existing task manager window. Highlights background resources if |
| 92 // |highlight_background_resources| is true. | 95 // |highlight_background_resources| is true. |
| 93 static void Show(bool highlight_background_resources); | 96 static void Show(bool highlight_background_resources); |
| 94 | 97 |
| 95 // Returns the TaskManager observed by |this|. | 98 // Returns the TaskManager observed by |this|. |
| 96 TaskManager* task_manager() { return task_manager_; } | 99 TaskManager* task_manager() { return task_manager_; } |
| 97 | 100 |
| 98 // Lazily converts the image at the given row and caches it in |icon_cache_|. | 101 // 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_; | 124 bool highlight_background_resources_; |
| 122 | 125 |
| 123 // An open task manager window. There can only be one open at a time. This | 126 // 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. | 127 // is reset to NULL when the window is closed. |
| 125 static TaskManagerMac* instance_; | 128 static TaskManagerMac* instance_; |
| 126 | 129 |
| 127 DISALLOW_COPY_AND_ASSIGN(TaskManagerMac); | 130 DISALLOW_COPY_AND_ASSIGN(TaskManagerMac); |
| 128 }; | 131 }; |
| 129 | 132 |
| 130 #endif // CHROME_BROWSER_UI_COCOA_TASK_MANAGER_MAC_H_ | 133 #endif // CHROME_BROWSER_UI_COCOA_TASK_MANAGER_MAC_H_ |
| OLD | NEW |