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

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

Issue 10514008: Add WebNotificationTray (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 6 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 | « ash/system/tray/system_tray.cc ('k') | ash/system/tray/system_tray_bubble.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/tray/system_tray_bubble.h
diff --git a/ash/system/tray/system_tray_bubble.h b/ash/system/tray/system_tray_bubble.h
index fbb2bc0eca3903c06970729faca7f2680cea219b..db313948edea00d2e846c6876b39fd98a2bea7ce 100644
--- a/ash/system/tray/system_tray_bubble.h
+++ b/ash/system/tray/system_tray_bubble.h
@@ -6,12 +6,12 @@
#define ASH_SYSTEM_TRAY_SYSTEM_TRAY_BUBBLE_H_
#pragma once
+#include "ash/system/tray/system_tray_bubble_view.h"
#include "ash/system/user/login_status.h"
#include "ash/wm/shelf_auto_hide_behavior.h"
#include "base/base_export.h"
#include "base/timer.h"
#include "ui/aura/event_filter.h"
-#include "ui/views/bubble/bubble_delegate.h"
#include "ui/views/widget/widget.h"
#include <vector>
@@ -27,52 +27,9 @@ class SystemTrayItem;
namespace internal {
-class SystemTrayBubble;
-
-class SystemTrayBubbleView : public views::BubbleDelegateView {
- public:
- SystemTrayBubbleView(views::View* anchor,
- views::BubbleBorder::ArrowLocation arrow_location,
- SystemTrayBubble* host,
- bool can_activate);
- virtual ~SystemTrayBubbleView();
-
- void SetBubbleBorder(views::BubbleBorder* border);
-
- void UpdateAnchor();
-
- // Called when the host is destroyed.
- void reset_host() { host_ = NULL; }
-
- private:
- friend class SystemTrayBubble;
-
- // Overridden from views::BubbleDelegateView.
- virtual void Init() OVERRIDE;
- virtual gfx::Rect GetAnchorRect() OVERRIDE;
- virtual bool CanActivate() const OVERRIDE;
-
- // Overridden from views::View.
- virtual gfx::Size GetPreferredSize() OVERRIDE;
- virtual void OnMouseEntered(const views::MouseEvent& event) OVERRIDE;
- virtual void OnMouseExited(const views::MouseEvent& event) OVERRIDE;
- virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
- virtual void ChildPreferredSizeChanged(View* child) OVERRIDE;
- virtual void ViewHierarchyChanged(bool is_add,
- views::View* parent,
- views::View* child) OVERRIDE;
-
- void set_max_height(int height) { max_height_ = height; }
-
- SystemTrayBubble* host_;
- bool can_activate_;
- int max_height_;
-
- DISALLOW_COPY_AND_ASSIGN(SystemTrayBubbleView);
-};
-
class SystemTrayBubble : public aura::EventFilter,
- public views::Widget::Observer {
+ public views::Widget::Observer,
+ public SystemTrayBubbleView::Host {
public:
enum BubbleType {
BUBBLE_TYPE_DEFAULT,
@@ -109,7 +66,11 @@ class SystemTrayBubble : public aura::EventFilter,
// Also creates |bubble_widget_| and sets up animations.
void InitView(const InitParams& init_params);
- gfx::Rect GetAnchorRect() const;
+ // Overridden from SystemTrayBubbleView::Host.
+ virtual void BubbleViewDestroyed() OVERRIDE;
+ virtual gfx::Rect GetAnchorRect() const OVERRIDE;
+ virtual void OnMouseEnteredView() OVERRIDE;
+ virtual void OnMouseExitedView() OVERRIDE;
BubbleType bubble_type() const { return bubble_type_; }
SystemTrayBubbleView* bubble_view() const { return bubble_view_; }
@@ -119,6 +80,8 @@ class SystemTrayBubble : public aura::EventFilter,
void StopAutoCloseTimer();
void RestartAutoCloseTimer();
void Close();
+ void SetVisible(bool is_visible);
+ bool IsVisible();
private:
void CreateItemViews(user::LoginStatus login_status);
« no previous file with comments | « ash/system/tray/system_tray.cc ('k') | ash/system/tray/system_tray_bubble.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698