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

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

Issue 10383045: Add support to SystemTray for a second notification bubble. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 7 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 | « no previous file | ash/system/tray/system_tray.cc » ('j') | ash/system/tray/system_tray.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/tray/system_tray.h
diff --git a/ash/system/tray/system_tray.h b/ash/system/tray/system_tray.h
index ee76e0e90e9323a599279e274e175e02d65e91ce..c76c7a32ae01de9094c3a4ad818eb6e3cc09b53e 100644
--- a/ash/system/tray/system_tray.h
+++ b/ash/system/tray/system_tray.h
@@ -38,6 +38,7 @@ class SystemTrayItem;
namespace internal {
class SystemTrayBackground;
class SystemTrayBubble;
+class SystemTrayLayerAnimationObserver;
}
class ASH_EXPORT SystemTray : public internal::ActionableView,
@@ -71,6 +72,12 @@ class ASH_EXPORT SystemTray : public internal::ActionableView,
// seconds.
void SetDetailedViewCloseDelay(int close_delay);
+ // Shows the notification view for |item|.
+ void ShowNotificationView(SystemTrayItem* item);
+
+ // Hides the notification view for |item|.
+ void HideNotificationView(SystemTrayItem* item);
+
// Updates the items when the login status of the system changes.
void UpdateAfterLoginStatusChange(user::LoginStatus login_status);
@@ -130,6 +137,7 @@ class ASH_EXPORT SystemTray : public internal::ActionableView,
bool CloseBubbleForTest() const;
private:
+ friend class internal::SystemTrayLayerAnimationObserver;
friend class internal::SystemTrayBubble;
// Called when the widget associated with |bubble| closes. |bubble| should
@@ -139,10 +147,18 @@ class ASH_EXPORT SystemTray : public internal::ActionableView,
const ScopedVector<SystemTrayItem>& items() const { return items_; }
+ // Constructs or re-constructs |bubble_| and populates it with |items|.
void ShowItems(const std::vector<SystemTrayItem*>& items,
bool details,
bool activate);
+ // Constructs or re-constructs |notification_bubble_| and populates it with
+ // |notification_items_|, or destroys it if there are no notification items.
+ void ShowNotifications();
+
+ // Called when the anchor (tray or bubble) may have moved or changed.
+ void UpdateNotificationAnchor();
+
// Overridden from internal::ActionableView.
virtual bool PerformAction(const views::Event& event) OVERRIDE;
@@ -158,8 +174,10 @@ class ASH_EXPORT SystemTray : public internal::ActionableView,
ScopedVector<SystemTrayItem> items_;
+ std::vector<SystemTrayItem*> notification_items_;
+
// The container for all the tray views of the items.
- views::View* container_;
+ views::View* tray_container_;
// These observers are not owned by the tray.
AccessibilityObserver* accessibility_observer_;
@@ -178,9 +196,12 @@ class ASH_EXPORT SystemTray : public internal::ActionableView,
// The widget hosting the tray.
views::Widget* widget_;
- // The popup widget and the delegate.
+ // Bubble for default and detailed views.
scoped_ptr<internal::SystemTrayBubble> bubble_;
+ // Buble for notifications.
+ scoped_ptr<internal::SystemTrayBubble> notification_bubble_;
+
// Owned by the view it's installed on.
internal::SystemTrayBackground* background_;
@@ -189,6 +210,8 @@ class ASH_EXPORT SystemTray : public internal::ActionableView,
internal::BackgroundAnimator hide_background_animator_;
internal::BackgroundAnimator hover_background_animator_;
+ scoped_ptr<internal::SystemTrayLayerAnimationObserver>
+ layer_animation_observer_;
DISALLOW_COPY_AND_ASSIGN(SystemTray);
};
« no previous file with comments | « no previous file | ash/system/tray/system_tray.cc » ('j') | ash/system/tray/system_tray.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698