Chromium Code Reviews| Index: chrome/browser/ui/views/message_center/notification_bubble_wrapper_win.h | 
| diff --git a/chrome/browser/ui/views/message_center/notification_bubble_wrapper_win.h b/chrome/browser/ui/views/message_center/notification_bubble_wrapper_win.h | 
| new file mode 100644 | 
| index 0000000000000000000000000000000000000000..92f9fe40f4d9b47772e17bef81327316df38581f | 
| --- /dev/null | 
| +++ b/chrome/browser/ui/views/message_center/notification_bubble_wrapper_win.h | 
| @@ -0,0 +1,62 @@ | 
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. | 
| +// Use of this source code is governed by a BSD-style license that can be | 
| +// found in the LICENSE file. | 
| + | 
| +#ifndef CHROME_BROWSER_UI_VIEWS_MESSAGE_CENTER_NOTIFICATION_BUBBLE_WRAPPER_WIN_H_ | 
| +#define CHROME_BROWSER_UI_VIEWS_MESSAGE_CENTER_NOTIFICATION_BUBBLE_WRAPPER_WIN_H_ | 
| + | 
| +#include "chrome/browser/ui/views/message_center/web_notification_tray_win.h" | 
| +#include "ui/views/bubble/tray_bubble_view.h" | 
| +#include "ui/views/widget/widget.h" | 
| + | 
| +namespace message_center { | 
| + | 
| +namespace internal { | 
| + | 
| +// NotificationBubbleWrapperWin is a class that manages the views associated | 
| +// with a MessageBubbleBase object and that notifies the WebNotificationTrayWin | 
| +// when the widget closes. Delegates GetAnchorRect to the | 
| +// WebNotificationTrayWin. | 
| +class NotificationBubbleWrapperWin | 
| + : public views::WidgetObserver, | 
| + public views::TrayBubbleView::Delegate { | 
| + public: | 
| + // Takes ownership of |bubble|. | 
| + NotificationBubbleWrapperWin(WebNotificationTrayWin* tray, | 
| + message_center::MessageBubbleBase* bubble, | 
| + AnchorType anchor_type); | 
| + ~NotificationBubbleWrapperWin(); | 
| + | 
| + // Overridden from views::WidgetObserver. | 
| + void OnWidgetClosing(views::Widget* widget); | 
| 
 
miket_OOO
2013/01/25 17:14:48
Add OVERRIDE keyword to get the compiler to help c
 
dewittj
2013/01/25 19:38:46
Done.
 
 | 
| + | 
| + // TrayBubbleView::Delegate implementation. | 
| + virtual void BubbleViewDestroyed(); | 
| 
 
miket_OOO
2013/01/25 17:14:48
Same down here.
 
dewittj
2013/01/25 19:38:46
Done.
 
 | 
| + virtual void OnMouseEnteredView(); | 
| + virtual void OnMouseExitedView(); | 
| + virtual string16 GetAccessibleNameForBubble(); | 
| + // GetAnchorRect passes responsibility for BubbleDelegateView::GetAnchorRect | 
| + // to the delegate. | 
| + virtual gfx::Rect GetAnchorRect(views::Widget* anchor_widget, | 
| + AnchorType anchor_type, | 
| + AnchorAlignment anchor_alignment); | 
| + virtual void HideBubble(const views::TrayBubbleView* bubble_view); | 
| + | 
| + // Convenience accessors. | 
| + views::TrayBubbleView* bubble_view() const { return bubble_view_; } | 
| + views::Widget* bubble_widget() const { return bubble_widget_; } | 
| + message_center::MessageBubbleBase* bubble() const { return bubble_.get(); } | 
| + | 
| + private: | 
| + scoped_ptr<message_center::MessageBubbleBase> bubble_; | 
| + // |bubble_view_| is owned by its Widget. | 
| + views::TrayBubbleView* bubble_view_; | 
| + views::Widget* bubble_widget_; | 
| + WebNotificationTrayWin* tray_; | 
| +}; | 
| + | 
| +} // namespace internal | 
| + | 
| +} // namespace message_center | 
| + | 
| +#endif // CHROME_BROWSER_UI_VIEWS_MESSAGE_CENTER_NOTIFICATION_BUBBLE_WRAPPER_WIN_H_ |