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

Unified Diff: chrome/browser/cocoa/status_icons/status_icon_mac.h

Issue 661454: Initial implementation of status tray functionality (mac-only, currently). (Closed)
Patch Set: more changes per review feedback Created 10 years, 10 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
« no previous file with comments | « chrome/browser/browser_process_impl.cc ('k') | chrome/browser/cocoa/status_icons/status_icon_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/status_icons/status_icon_mac.h
diff --git a/chrome/browser/cocoa/status_icons/status_icon_mac.h b/chrome/browser/cocoa/status_icons/status_icon_mac.h
new file mode 100644
index 0000000000000000000000000000000000000000..d606429046e0cbdeea3f14e87cf7a1467c7dc283
--- /dev/null
+++ b/chrome/browser/cocoa/status_icons/status_icon_mac.h
@@ -0,0 +1,48 @@
+// Copyright (c) 2010 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_STATUS_ICONS_STATUS_ICON_MAC_H_
+#define CHROME_BROWSER_COCOA_STATUS_ICONS_STATUS_ICON_MAC_H_
+
+#include <vector>
+
+#import <Cocoa/Cocoa.h>
+
+#include "base/scoped_nsobject.h"
+#include "base/string16.h"
+#include "chrome/browser/status_icons/status_icon.h"
+
+class SkBitmap;
+@class NSStatusItem;
+@class StatusItemController;
+
+class StatusIconMac : public StatusIcon {
+ public:
+ StatusIconMac();
+ virtual ~StatusIconMac();
+
+ // Sets the image associated with this status icon.
+ virtual void SetImage(const SkBitmap& image);
+
+ // Sets the hover text for this status icon.
+ virtual void SetToolTip(const string16& tool_tip);
+
+ // Adds/removes a observer for status bar events.
+ virtual void AddObserver(StatusIcon::StatusIconObserver* observer);
+ virtual void RemoveObserver(StatusIcon::StatusIconObserver* observer);
+
+ // Called back if the user clicks on the status bar icon.
+ void HandleClick();
+
+ private:
+ // Getter for item_ that allows lazy initialization.
+ NSStatusItem* item();
+ scoped_nsobject<NSStatusItem> item_;
+
+ scoped_nsobject<StatusItemController> controller_;
+ std::vector<StatusIcon::StatusIconObserver*> observers_;
+};
+
+
+#endif // CHROME_BROWSER_COCOA_STATUS_ICONS_STATUS_ICON_MAC_H_
« no previous file with comments | « chrome/browser/browser_process_impl.cc ('k') | chrome/browser/cocoa/status_icons/status_icon_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698