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

Side by Side Diff: ash/system/tray/system_tray_bubble_view.h

Issue 10514008: Add WebNotificationTray (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 #ifndef ASH_SYSTEM_TRAY_SYSTEM_TRAY_BUBBLE_VIEW_H_
2 #define ASH_SYSTEM_TRAY_SYSTEM_TRAY_BUBBLE_VIEW_H_
3 #pragma once
4
5 #include "ui/views/bubble/bubble_delegate.h"
6
7 namespace views {
8 class View;
9 }
10
11 namespace ash {
12 namespace internal {
13
14 // Specialized bubble view for system and web notification bubbles.
15 // Mostly this handles custom anchor location and arrow and border rendering.
16 class SystemTrayBubbleView : public views::BubbleDelegateView {
17 public:
18 class Host {
19 public:
20 Host() {}
21 virtual ~Host() {}
22
23 virtual void BubbleViewDestroyed() = 0;
24 virtual gfx::Rect GetAnchorRect() const = 0;
25 virtual void OnMouseEnteredView() = 0;
26 virtual void OnMoiseExitedView() = 0;
27
28 private:
29 DISALLOW_COPY_AND_ASSIGN(Host);
30 };
31
32 SystemTrayBubbleView(views::View* anchor,
33 views::BubbleBorder::ArrowLocation arrow_location,
34 Host* host,
35 bool can_activate);
36 virtual ~SystemTrayBubbleView();
37
38 void SetBubbleBorder(int arrow_offset);
39 void UpdateAnchor();
40 void SetMaxHeight(int height);
41
42 // Called when the host is destroyed.
43 void reset_host() { host_ = NULL; }
44
45 void set_bubble_width(int width) { bubble_width_ = width; }
46
47 private:
48 // Overridden from views::BubbleDelegateView.
49 virtual void Init() OVERRIDE;
50 virtual gfx::Rect GetAnchorRect() OVERRIDE;
51 virtual bool CanActivate() const OVERRIDE;
52
53 // Overridden from views::View.
54 virtual gfx::Size GetPreferredSize() OVERRIDE;
55 virtual void OnMouseEntered(const views::MouseEvent& event) OVERRIDE;
56 virtual void OnMouseExited(const views::MouseEvent& event) OVERRIDE;
57 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
58 virtual void ChildPreferredSizeChanged(View* child) OVERRIDE;
59 virtual void ViewHierarchyChanged(bool is_add,
60 views::View* parent,
61 views::View* child) OVERRIDE;
62
63 Host* host_;
64 bool can_activate_;
65 int max_height_;
66 int bubble_width_;
67
68 DISALLOW_COPY_AND_ASSIGN(SystemTrayBubbleView);
69 };
70
71 } // namespace internal
72 } // namespace ash
73
74 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_BUBBLE_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698