| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_BUBBLE_HOST_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_BUBBLE_HOST_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_BUBBLE_HOST_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_BUBBLE_HOST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 | 12 |
| 13 class BrowserBubble; | 13 class BrowserBubble; |
| 14 | 14 |
| 15 // A class providing a hosting environment for BrowserBubble instances. | 15 // A class providing a hosting environment for BrowserBubble instances. |
| 16 // Allows for notification to attached BrowserBubbles of browser move, and | 16 // Allows for notification to attached BrowserBubbles of browser move, and |
| 17 // close events. | 17 // close events. |
| 18 class BrowserBubbleHost { | 18 class BrowserBubbleHost { |
| 19 public: | 19 public: |
| 20 BrowserBubbleHost() {} | 20 BrowserBubbleHost(); |
| 21 ~BrowserBubbleHost(); |
| 21 | 22 |
| 22 // Invoked when the window containing the attached browser-bubbles is moved. | 23 // Invoked when the window containing the attached browser-bubbles is moved. |
| 23 // Calls BrowserBubble::BrowserWindowMoved on all attached bubbles. | 24 // Calls BrowserBubble::BrowserWindowMoved on all attached bubbles. |
| 24 void WindowMoved(); | 25 void WindowMoved(); |
| 25 | 26 |
| 26 // To be called when the frame containing the BrowserBubbleHost is closing. | 27 // To be called when the frame containing the BrowserBubbleHost is closing. |
| 27 // Calls BrowserBubble::BrowserWindowClosing on all attached bubbles. | 28 // Calls BrowserBubble::BrowserWindowClosing on all attached bubbles. |
| 28 void Close(); | 29 void Close(); |
| 29 | 30 |
| 30 // Registers/Unregisters |bubble| to receive notifications when the host moves | 31 // Registers/Unregisters |bubble| to receive notifications when the host moves |
| 31 // or is closed. | 32 // or is closed. |
| 32 void AttachBrowserBubble(BrowserBubble* bubble); | 33 void AttachBrowserBubble(BrowserBubble* bubble); |
| 33 void DetachBrowserBubble(BrowserBubble* bubble); | 34 void DetachBrowserBubble(BrowserBubble* bubble); |
| 34 | 35 |
| 35 private: | 36 private: |
| 36 // The set of bubbles associated with this host. | 37 // The set of bubbles associated with this host. |
| 37 typedef std::set<BrowserBubble*> BubbleSet; | 38 typedef std::set<BrowserBubble*> BubbleSet; |
| 38 BubbleSet browser_bubbles_; | 39 BubbleSet browser_bubbles_; |
| 39 | 40 |
| 40 DISALLOW_COPY_AND_ASSIGN(BrowserBubbleHost); | 41 DISALLOW_COPY_AND_ASSIGN(BrowserBubbleHost); |
| 41 }; | 42 }; |
| 42 | 43 |
| 43 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_BUBBLE_HOST_H_ | 44 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_BUBBLE_HOST_H_ |
| OLD | NEW |