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

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: 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..5366e78a174b1d18145ed1ba9465514a349486c6 100644
--- a/ash/system/tray/system_tray_item.h
+++ b/ash/system/tray/system_tray_item.h
@@ -39,8 +39,9 @@ class ASH_EXPORT SystemTrayItem {
// Returns a view for the item to be displayed in the list. This view can be
// displayed with a number of other tray items, so this should not be too
- // big.
- virtual views::View* CreateDefaultView(user::LoginStatus status);
+ // big. |bubble_width| is the current width of the bubble.
+ virtual views::View* CreateDefaultView(user::LoginStatus status,
+ int bubble_width);
stevenjb 2012/11/15 21:42:04 This is a lot of changes for one use case, and see
bartfab (slow) 2012/11/16 14:56:24 Done. This is a much bigger refactor than I had be
stevenjb 2012/11/16 17:46:55 Yeah, sorry about that, but really appreciate it.
// Returns a detailed view for the item. This view is displayed standalone.
virtual views::View* CreateDetailedView(user::LoginStatus status);
@@ -100,6 +101,13 @@ class ASH_EXPORT SystemTrayItem {
// the launcher is in the auto-hide state. Default is true.
virtual bool ShouldShowLauncher() const;
+ // For views displayed in a bubble, the width is normally determined by a
+ // fixed bubble with. If this returns true, the bubble width is adjusted when
msw 2012/11/15 21:08:48 nit: s/with/width
+ // displaying this item's default view so that the view can be assigned at
+ // least its entire preferred size. Default is false.
stevenjb 2012/11/15 21:42:04 This feels awkward. How about a GetMinWidth() that
bartfab (slow) 2012/11/16 14:56:24 Now that Tray*View can walk up the pointer chain a
stevenjb 2012/11/16 17:46:55 That sounds reasonable also.
+ virtual bool GuaranteeDefaultViewPreferredSize(
+ user::LoginStatus status) const;
+
private:
DISALLOW_COPY_AND_ASSIGN(SystemTrayItem);
};

Powered by Google App Engine
This is Rietveld 408576698