OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Draws the view for the balloons. | |
6 | |
7 #ifndef CHROME_BROWSER_UI_VIEWS_NOTIFICATIONS_BALLOON_VIEW_VIEWS_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_NOTIFICATIONS_BALLOON_VIEW_VIEWS_H_ |
8 #define CHROME_BROWSER_UI_VIEWS_NOTIFICATIONS_BALLOON_VIEW_VIEWS_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_NOTIFICATIONS_BALLOON_VIEW_VIEWS_H_ |
9 | 7 |
10 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
11 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
12 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
13 #include "chrome/browser/notifications/balloon.h" | 11 #include "chrome/browser/notifications/balloon.h" |
14 #include "chrome/browser/ui/views/notifications/balloon_view_host.h" | 12 #include "content/public/browser/notification_observer.h" |
15 #include "content/public/browser/notification_registrar.h" | 13 #include "content/public/browser/notification_registrar.h" |
16 #include "ui/base/animation/animation_delegate.h" | 14 #include "ui/base/animation/animation_delegate.h" |
17 #include "ui/gfx/path.h" | |
18 #include "ui/gfx/point.h" | |
19 #include "ui/gfx/rect.h" | 15 #include "ui/gfx/rect.h" |
20 #include "ui/gfx/size.h" | 16 #include "ui/views/controls/button/button.h" |
21 #include "ui/views/controls/button/menu_button.h" | |
22 #include "ui/views/controls/button/menu_button_listener.h" | 17 #include "ui/views/controls/button/menu_button_listener.h" |
23 #include "ui/views/controls/label.h" | |
24 #include "ui/views/view.h" | |
25 #include "ui/views/widget/widget_delegate.h" | 18 #include "ui/views/widget/widget_delegate.h" |
26 | 19 |
27 class BalloonCollection; | 20 class BalloonCollection; |
| 21 class BalloonViewHost; |
28 class NotificationOptionsMenuModel; | 22 class NotificationOptionsMenuModel; |
29 | 23 |
| 24 namespace gfx { |
| 25 class Path; |
| 26 } |
| 27 |
30 namespace ui { | 28 namespace ui { |
31 class SlideAnimation; | 29 class SlideAnimation; |
32 } | 30 } |
33 | 31 |
34 namespace views { | 32 namespace views { |
35 class ButtonListener; | |
36 class ImageButton; | 33 class ImageButton; |
| 34 class Label; |
| 35 class MenuButton; |
37 class MenuRunner; | 36 class MenuRunner; |
38 } | 37 } |
39 | 38 |
40 // A balloon view is the UI component for a desktop notification toasts. | 39 // A balloon view is the UI component for a desktop notification toasts. |
41 // It draws a border, and within the border an HTML renderer. | 40 // It draws a border, and within the border an HTML renderer. |
42 class BalloonViewImpl : public BalloonView, | 41 class BalloonViewImpl : public BalloonView, |
43 public views::MenuButtonListener, | 42 public views::MenuButtonListener, |
44 public views::WidgetDelegateView, | 43 public views::WidgetDelegateView, |
45 public views::ButtonListener, | 44 public views::ButtonListener, |
46 public content::NotificationObserver, | 45 public content::NotificationObserver, |
(...skipping 20 matching lines...) Expand all Loading... |
67 | 66 |
68 // views::MenuButtonListener interface. | 67 // views::MenuButtonListener interface. |
69 virtual void OnMenuButtonClicked(views::View* source, | 68 virtual void OnMenuButtonClicked(views::View* source, |
70 const gfx::Point& point) OVERRIDE; | 69 const gfx::Point& point) OVERRIDE; |
71 | 70 |
72 // views::WidgetDelegate interface. | 71 // views::WidgetDelegate interface. |
73 virtual void OnDisplayChanged() OVERRIDE; | 72 virtual void OnDisplayChanged() OVERRIDE; |
74 virtual void OnWorkAreaChanged() OVERRIDE; | 73 virtual void OnWorkAreaChanged() OVERRIDE; |
75 | 74 |
76 // views::ButtonListener interface. | 75 // views::ButtonListener interface. |
77 virtual void ButtonPressed( | 76 virtual void ButtonPressed(views::Button* sender, |
78 views::Button* sender, const views::Event&) OVERRIDE; | 77 const views::Event&) OVERRIDE; |
79 | 78 |
80 // content::NotificationObserver interface. | 79 // content::NotificationObserver interface. |
81 virtual void Observe(int type, | 80 virtual void Observe(int type, |
82 const content::NotificationSource& source, | 81 const content::NotificationSource& source, |
83 const content::NotificationDetails& details) OVERRIDE; | 82 const content::NotificationDetails& details) OVERRIDE; |
84 | 83 |
85 // ui::AnimationDelegate interface. | 84 // ui::AnimationDelegate interface. |
86 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; | 85 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; |
87 | 86 |
88 // Initializes the options menu. | 87 // Initializes the options menu. |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 158 |
160 content::NotificationRegistrar notification_registrar_; | 159 content::NotificationRegistrar notification_registrar_; |
161 | 160 |
162 // Set to true if this is browser generate web UI. | 161 // Set to true if this is browser generate web UI. |
163 bool enable_web_ui_; | 162 bool enable_web_ui_; |
164 | 163 |
165 DISALLOW_COPY_AND_ASSIGN(BalloonViewImpl); | 164 DISALLOW_COPY_AND_ASSIGN(BalloonViewImpl); |
166 }; | 165 }; |
167 | 166 |
168 #endif // CHROME_BROWSER_UI_VIEWS_NOTIFICATIONS_BALLOON_VIEW_VIEWS_H_ | 167 #endif // CHROME_BROWSER_UI_VIEWS_NOTIFICATIONS_BALLOON_VIEW_VIEWS_H_ |
OLD | NEW |