OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_UI_VIEWS_MESSAGE_CENTER_NOTIFICATION_BUBBLE_WRAPPER_WIN_H _ | |
6 #define CHROME_BROWSER_UI_VIEWS_MESSAGE_CENTER_NOTIFICATION_BUBBLE_WRAPPER_WIN_H _ | |
7 | |
8 #include "chrome/browser/ui/views/message_center/web_notification_tray_win.h" | |
9 #include "ui/views/bubble/tray_bubble_view.h" | |
10 #include "ui/views/widget/widget.h" | |
11 | |
12 namespace ui { | |
13 | |
14 namespace internal { | |
Pete Williamson
2013/01/23 19:52:16
instead of "internal", should we use a more specif
dewittj
2013/01/23 22:07:51
Classes in ui::internal should not be used by clas
| |
15 | |
16 // NotificationBubbleWrapperWin is a class that manages the views associated | |
17 // with a MessageBubbleBase object and that notifies the WebNotificationTrayWin | |
18 // when the widget closes. Delegates GetAnchorRect to the | |
19 // WebNotificationTrayWin. | |
20 class NotificationBubbleWrapperWin | |
21 : public views::WidgetObserver, | |
22 public views::TrayBubbleView::Delegate { | |
23 public: | |
24 // Takes ownership of |bubble|. | |
25 NotificationBubbleWrapperWin(WebNotificationTrayWin* tray, | |
26 message_center::MessageBubbleBase* bubble, | |
27 AnchorType anchor_type); | |
28 ~NotificationBubbleWrapperWin(); | |
29 | |
30 // Overridden from views::WidgetObserver. | |
31 void OnWidgetClosing(views::Widget* widget); | |
32 | |
33 // TrayBubbleView::Delegate implementation. | |
34 virtual void BubbleViewDestroyed(); | |
35 virtual void OnMouseEnteredView(); | |
36 virtual void OnMouseExitedView(); | |
37 virtual string16 GetAccessibleNameForBubble(); | |
38 virtual gfx::Rect GetAnchorRect(views::Widget* anchor_widget, | |
39 AnchorType anchor_type, | |
40 AnchorAlignment anchor_alignment); | |
41 virtual void HideBubble(const views::TrayBubbleView* bubble_view); | |
42 | |
43 // Convenience accessors. | |
Pete Williamson
2013/01/23 19:52:16
Do we need to expose these as public? It seems a
dewittj
2013/01/23 22:07:51
This is only used for equality testing, not for di
| |
44 views::TrayBubbleView* bubble_view() const { return bubble_view_; } | |
45 views::Widget* bubble_widget() const { return bubble_widget_; } | |
46 message_center::MessageBubbleBase* bubble() const { return bubble_.get(); } | |
47 | |
48 private: | |
49 scoped_ptr<message_center::MessageBubbleBase> bubble_; | |
50 // |bubble_view_| is unowned. | |
Pete Williamson
2013/01/23 19:52:16
If bubble view is unowned, how do we know it is al
dewittj
2013/01/23 22:07:51
The widget owns bubble_view_.
Pete Williamson
2013/01/23 23:47:53
In that case, let's change the comment to note tha
| |
51 views::TrayBubbleView* bubble_view_; | |
52 views::Widget* bubble_widget_; | |
53 WebNotificationTrayWin* tray_; | |
54 }; | |
55 | |
56 } // namespace internal | |
57 | |
58 } // namespace ui | |
59 | |
60 #endif // CHROME_BROWSER_UI_VIEWS_MESSAGE_CENTER_NOTIFICATION_BUBBLE_WRAPPER_WI N_H_ | |
OLD | NEW |