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

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

Issue 10235010: Prepare SystemTray to support notifications (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 8 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: ash/system/tray/system_tray.h
diff --git a/ash/system/tray/system_tray.h b/ash/system/tray/system_tray.h
index b9dbab2a672805757c6b88f9820440078fbfe132..97a0046c0cf86d824220684218a1442e7ca8eee9 100644
--- a/ash/system/tray/system_tray.h
+++ b/ash/system/tray/system_tray.h
@@ -12,10 +12,8 @@
#include "ash/system/user/login_status.h"
#include "base/basictypes.h"
#include "base/compiler_specific.h"
-#include "base/message_pump_observer.h"
#include "base/memory/scoped_vector.h"
#include "ui/views/view.h"
-#include "ui/views/widget/widget.h"
#include <vector>
@@ -42,9 +40,7 @@ class SystemTrayBubble;
class ASH_EXPORT SystemTray : NON_EXPORTED_BASE(
public internal::ActionableView),
- public views::Widget::Observer,
- public internal::BackgroundAnimatorDelegate,
- public base::MessagePumpObserver {
+ public internal::BackgroundAnimatorDelegate {
public:
SystemTray();
virtual ~SystemTray();
@@ -77,6 +73,11 @@ class ASH_EXPORT SystemTray : NON_EXPORTED_BASE(
// Updates the items when the login status of the system changes.
void UpdateAfterLoginStatusChange(user::LoginStatus login_status);
+ // Called when the widget associated with |bubble| closes. |bubble| should
+ // always == |bubble_|. This triggers destroying |bubble_| and hiding the
+ // launcher if necessary.
+ void RemoveBubble(internal::SystemTrayBubble* bubble);
+
const ScopedVector<SystemTrayItem>& items() const { return items_; }
// Sets whether the tray paints a background. Default is true, but is set to
@@ -86,7 +87,7 @@ class ASH_EXPORT SystemTray : NON_EXPORTED_BASE(
internal::BackgroundAnimator::ChangeType change_type);
// Returns true if the launcher should show.
- bool should_show_launcher() const { return popup_ && should_show_launcher_; }
+ bool should_show_launcher() const { return bubble_ && should_show_launcher_; }
views::Widget* widget() const { return widget_; }
@@ -139,19 +140,9 @@ class ASH_EXPORT SystemTray : NON_EXPORTED_BASE(
virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
virtual void OnPaintFocusBorder(gfx::Canvas* canvas) OVERRIDE;
- // Overridden from views::Widget::Observer.
- virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE;
- virtual void OnWidgetVisibilityChanged(views::Widget* widget,
- bool visible) OVERRIDE;
-
// Overridden from internal::BackgroundAnimatorDelegate.
virtual void UpdateBackground(int alpha) OVERRIDE;
- // Overidden from base::MessagePumpObserver
- virtual base::EventStatus WillProcessEvent(
- const base::NativeEvent& event) OVERRIDE;
- virtual void DidProcessEvent(const base::NativeEvent& event) OVERRIDE;
-
ScopedVector<SystemTrayItem> items_;
// The container for all the tray views of the items.
@@ -175,7 +166,6 @@ class ASH_EXPORT SystemTray : NON_EXPORTED_BASE(
// The popup widget and the delegate.
internal::SystemTrayBubble* bubble_;
- views::Widget* popup_;
// Owned by the view it's installed on.
internal::SystemTrayBackground* background_;

Powered by Google App Engine
This is Rietveld 408576698