OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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. | 5 // Draws the view for the balloons. |
6 | 6 |
7 #ifndef CHROME_BROWSER_UI_GTK_NOTIFICATIONS_BALLOON_VIEW_GTK_H_ | 7 #ifndef CHROME_BROWSER_UI_GTK_NOTIFICATIONS_BALLOON_VIEW_GTK_H_ |
8 #define CHROME_BROWSER_UI_GTK_NOTIFICATIONS_BALLOON_VIEW_GTK_H_ | 8 #define CHROME_BROWSER_UI_GTK_NOTIFICATIONS_BALLOON_VIEW_GTK_H_ |
9 #pragma once | 9 #pragma once |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/compiler_specific.h" |
12 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
14 #include "chrome/browser/notifications/balloon.h" | 15 #include "chrome/browser/notifications/balloon.h" |
15 #include "chrome/browser/ui/gtk/menu_gtk.h" | 16 #include "chrome/browser/ui/gtk/menu_gtk.h" |
16 #include "chrome/browser/ui/gtk/notifications/balloon_view_host_gtk.h" | 17 #include "chrome/browser/ui/gtk/notifications/balloon_view_host_gtk.h" |
17 #include "content/public/browser/notification_observer.h" | 18 #include "content/public/browser/notification_observer.h" |
18 #include "content/public/browser/notification_registrar.h" | 19 #include "content/public/browser/notification_registrar.h" |
19 #include "ui/base/animation/animation_delegate.h" | 20 #include "ui/base/animation/animation_delegate.h" |
20 #include "ui/base/gtk/gtk_signal.h" | 21 #include "ui/base/gtk/gtk_signal.h" |
21 #include "ui/gfx/point.h" | 22 #include "ui/gfx/point.h" |
(...skipping 14 matching lines...) Expand all Loading... |
36 // It draws a border, and within the border an HTML renderer. | 37 // It draws a border, and within the border an HTML renderer. |
37 class BalloonViewImpl : public BalloonView, | 38 class BalloonViewImpl : public BalloonView, |
38 public MenuGtk::Delegate, | 39 public MenuGtk::Delegate, |
39 public content::NotificationObserver, | 40 public content::NotificationObserver, |
40 public ui::AnimationDelegate { | 41 public ui::AnimationDelegate { |
41 public: | 42 public: |
42 explicit BalloonViewImpl(BalloonCollection* collection); | 43 explicit BalloonViewImpl(BalloonCollection* collection); |
43 virtual ~BalloonViewImpl(); | 44 virtual ~BalloonViewImpl(); |
44 | 45 |
45 // BalloonView interface. | 46 // BalloonView interface. |
46 virtual void Show(Balloon* balloon); | 47 virtual void Show(Balloon* balloon) OVERRIDE; |
47 virtual void Update(); | 48 virtual void Update() OVERRIDE; |
48 virtual void RepositionToBalloon(); | 49 virtual void RepositionToBalloon() OVERRIDE; |
49 virtual void Close(bool by_user); | 50 virtual void Close(bool by_user) OVERRIDE; |
50 virtual gfx::Size GetSize() const; | 51 virtual gfx::Size GetSize() const OVERRIDE; |
51 virtual BalloonHost* GetHost() const; | 52 virtual BalloonHost* GetHost() const OVERRIDE; |
52 | 53 |
53 // MenuGtk::Delegate interface. | 54 // MenuGtk::Delegate interface. |
54 virtual void StoppedShowing(); | 55 virtual void StoppedShowing() OVERRIDE; |
55 | 56 |
56 private: | 57 private: |
57 // content::NotificationObserver interface. | 58 // content::NotificationObserver interface. |
58 virtual void Observe(int type, | 59 virtual void Observe(int type, |
59 const content::NotificationSource& source, | 60 const content::NotificationSource& source, |
60 const content::NotificationDetails& details); | 61 const content::NotificationDetails& details) OVERRIDE; |
61 | 62 |
62 // ui::AnimationDelegate interface. | 63 // ui::AnimationDelegate interface. |
63 virtual void AnimationProgressed(const ui::Animation* animation); | 64 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; |
64 | 65 |
65 // Do the delayed close work. The balloon and all view components will be | 66 // Do the delayed close work. The balloon and all view components will be |
66 // destroyed at this time, so it shouldn't be called while still processing | 67 // destroyed at this time, so it shouldn't be called while still processing |
67 // an event that relies on them. | 68 // an event that relies on them. |
68 void DelayedClose(bool by_user); | 69 void DelayedClose(bool by_user); |
69 | 70 |
70 // The height of the balloon's shelf. | 71 // The height of the balloon's shelf. |
71 // The shelf is where is close button is located. | 72 // The shelf is where is close button is located. |
72 int GetShelfHeight() const; | 73 int GetShelfHeight() const; |
73 | 74 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 // Is the menu currently showing? | 135 // Is the menu currently showing? |
135 bool menu_showing_; | 136 bool menu_showing_; |
136 | 137 |
137 // Is there a pending system-initiated close? | 138 // Is there a pending system-initiated close? |
138 bool pending_close_; | 139 bool pending_close_; |
139 | 140 |
140 DISALLOW_COPY_AND_ASSIGN(BalloonViewImpl); | 141 DISALLOW_COPY_AND_ASSIGN(BalloonViewImpl); |
141 }; | 142 }; |
142 | 143 |
143 #endif // CHROME_BROWSER_UI_GTK_NOTIFICATIONS_BALLOON_VIEW_GTK_H_ | 144 #endif // CHROME_BROWSER_UI_GTK_NOTIFICATIONS_BALLOON_VIEW_GTK_H_ |
OLD | NEW |