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

Unified Diff: ash/system/tray/system_tray_item.h

Issue 11415014: Stop using shell::GetInstance()->system_tray() in system tray items (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Modified CL to provide TrayItems and Tray*Views with parent pointers instead. Created 8 years, 1 month 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: ash/system/tray/system_tray_item.h
diff --git a/ash/system/tray/system_tray_item.h b/ash/system/tray/system_tray_item.h
index 6361529f8448798a6063310228fa3a620f136eb6..72c1aea15e8c635cf4e3503604e92a32507d6a76 100644
--- a/ash/system/tray/system_tray_item.h
+++ b/ash/system/tray/system_tray_item.h
@@ -17,13 +17,15 @@ class View;
namespace ash {
+class SystemTray;
msw 2012/11/16 17:10:06 nit: this forward decl should make a lot of the ot
bartfab (slow) 2012/11/16 17:16:01 It does make them unnecessary in that the forward
msw 2012/11/16 17:41:35 True, but for some straightforward cases, you can
stevenjb 2012/11/16 17:41:43 I mentioned this earlier also. Forward declaration
bartfab (slow) 2012/11/16 18:45:34 Done.
+
namespace internal {
class TrayItemView;
}
class ASH_EXPORT SystemTrayItem {
public:
- SystemTrayItem();
+ explicit SystemTrayItem(SystemTray* system_tray);
virtual ~SystemTrayItem();
// Create* functions may return NULL if nothing should be displayed for the
@@ -100,7 +102,12 @@ class ASH_EXPORT SystemTrayItem {
// the launcher is in the auto-hide state. Default is true.
virtual bool ShouldShowLauncher() const;
+ // Returns the system tray that this item belongs to.
+ SystemTray* system_tray() const { return system_tray_; }
+
private:
+ SystemTray* system_tray_;
+
DISALLOW_COPY_AND_ASSIGN(SystemTrayItem);
};

Powered by Google App Engine
This is Rietveld 408576698