Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5557)

Unified Diff: chrome/browser/cocoa/task_manager_mac.h

Issue 200094: Some scaffolding for the task manager. (Closed)
Patch Set: DAMN YOU GIT Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/cocoa/task_manager_mac.h
diff --git a/chrome/browser/cocoa/task_manager_mac.h b/chrome/browser/cocoa/task_manager_mac.h
new file mode 100644
index 0000000000000000000000000000000000000000..dbf34f9d5c513f6188b779f2954f774b15c4c7ff
--- /dev/null
+++ b/chrome/browser/cocoa/task_manager_mac.h
@@ -0,0 +1,54 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_COCOA_TASK_MANAGER_MAC_H_
+#define CHROME_BROWSER_COCOA_TASK_MANAGER_MAC_H_
+
+#import <Cocoa/Cocoa.h>
+#include "base/scoped_nsobject.h"
+#include "chrome/browser/task_manager.h"
+
+// This class is responsible for loading the task manager window and for
+// managing it.
+@interface TaskManagerWindowController : NSWindowController {
+}
+
+// Creates and shows the task manager's window.
+- (id)init;
+@end
+
+// This class listens to task changed events sent by chrome.
+class TaskManagerMac : public TaskManagerModelObserver {
+ public:
+ TaskManagerMac();
+ virtual ~TaskManagerMac();
+
+ // TaskManagerModelObserver
+ virtual void OnModelChanged();
+ virtual void OnItemsChanged(int start, int length);
+ virtual void OnItemsAdded(int start, int length);
+ virtual void OnItemsRemoved(int start, int length);
+
+ // Creates the task manager if it doesn't exist; otherwise, it activates the
+ // existing task manager window.
+ static void Show();
+
+ private:
+ // The task manager.
+ TaskManager* task_manager_; // weak
+
+ // Our model.
+ TaskManagerModel* model_; // weak
+
+ // Controller of our window.
+ scoped_nsobject<TaskManagerWindowController> window_controller_;
+
+ // An open task manager window. There can only be one open at a time. This
+ // is reset to NULL when the window is closed.
+ static TaskManagerMac* instance_;
+
+ DISALLOW_COPY_AND_ASSIGN(TaskManagerMac);
+};
+
+#endif // CHROME_BROWSER_COCOA_TASK_MANAGER_MAC_H_

Powered by Google App Engine
This is Rietveld 408576698