| OLD | NEW | 
|---|
| (Empty) |  | 
|  | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 
|  | 2 // Use of this source code is governed by a BSD-style license that can be | 
|  | 3 // found in the LICENSE file. | 
|  | 4 | 
|  | 5 #ifndef CHROME_BROWSER_COCOA_TASK_MANAGER_MAC_H_ | 
|  | 6 #define CHROME_BROWSER_COCOA_TASK_MANAGER_MAC_H_ | 
|  | 7 | 
|  | 8 #import <Cocoa/Cocoa.h> | 
|  | 9 #include "base/scoped_nsobject.h" | 
|  | 10 #include "chrome/browser/task_manager.h" | 
|  | 11 | 
|  | 12 // This class is responsible for loading the task manager window and for | 
|  | 13 // managing it. | 
|  | 14 @interface TaskManagerWindowController : NSWindowController { | 
|  | 15 } | 
|  | 16 | 
|  | 17 // Creates and shows the task manager's window. | 
|  | 18 - (id)init; | 
|  | 19 @end | 
|  | 20 | 
|  | 21 // This class listens to task changed events sent by chrome. | 
|  | 22 class TaskManagerMac : public TaskManagerModelObserver { | 
|  | 23  public: | 
|  | 24   TaskManagerMac(); | 
|  | 25   virtual ~TaskManagerMac(); | 
|  | 26 | 
|  | 27   // TaskManagerModelObserver | 
|  | 28   virtual void OnModelChanged(); | 
|  | 29   virtual void OnItemsChanged(int start, int length); | 
|  | 30   virtual void OnItemsAdded(int start, int length); | 
|  | 31   virtual void OnItemsRemoved(int start, int length); | 
|  | 32 | 
|  | 33   // Creates the task manager if it doesn't exist; otherwise, it activates the | 
|  | 34   // existing task manager window. | 
|  | 35   static void Show(); | 
|  | 36 | 
|  | 37  private: | 
|  | 38   // The task manager. | 
|  | 39   TaskManager* task_manager_;  // weak | 
|  | 40 | 
|  | 41   // Our model. | 
|  | 42   TaskManagerModel* model_;  // weak | 
|  | 43 | 
|  | 44   // Controller of our window. | 
|  | 45   scoped_nsobject<TaskManagerWindowController> window_controller_; | 
|  | 46 | 
|  | 47   // An open task manager window. There can only be one open at a time. This | 
|  | 48   // is reset to NULL when the window is closed. | 
|  | 49   static TaskManagerMac* instance_; | 
|  | 50 | 
|  | 51   DISALLOW_COPY_AND_ASSIGN(TaskManagerMac); | 
|  | 52 }; | 
|  | 53 | 
|  | 54 #endif  // CHROME_BROWSER_COCOA_TASK_MANAGER_MAC_H_ | 
| OLD | NEW | 
|---|