summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/frame/browser_bubble_host.h
diff options
context:
space:
mode:
authortwiz@chromium.org <twiz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-16 02:24:18 +0000
committertwiz@chromium.org <twiz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-16 02:24:18 +0000
commit2b19e2feeac2a01b2068595bd2913a194a6527e5 (patch)
treefff83de7ba198462e1d00b96911685418dd130bd /chrome/browser/views/frame/browser_bubble_host.h
parent00a3768102287ae6f8ff5e28347a920759d3374d (diff)
downloadchromium_src-2b19e2feeac2a01b2068595bd2913a194a6527e5.zip
chromium_src-2b19e2feeac2a01b2068595bd2913a194a6527e5.tar.gz
chromium_src-2b19e2feeac2a01b2068595bd2913a194a6527e5.tar.bz2
Clone of issue 600130. (http://codereview.chromium.org/600130)
BUG=None TEST=None Review URL: http://codereview.chromium.org/593111 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39077 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/frame/browser_bubble_host.h')
-rw-r--r--chrome/browser/views/frame/browser_bubble_host.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/chrome/browser/views/frame/browser_bubble_host.h b/chrome/browser/views/frame/browser_bubble_host.h
new file mode 100644
index 0000000..4763a50
--- /dev/null
+++ b/chrome/browser/views/frame/browser_bubble_host.h
@@ -0,0 +1,42 @@
+// Copyright (c) 2010 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_VIEWS_FRAME_BROWSER_BUBBLE_HOST_H_
+#define CHROME_BROWSER_VIEWS_FRAME_BROWSER_BUBBLE_HOST_H_
+
+#include <set>
+
+#include "base/basictypes.h"
+
+class BrowserBubble;
+
+// A class providing a hosting environment for BrowserBubble instances.
+// Allows for notification to attached BrowserBubbles of browser move, and
+// close events.
+class BrowserBubbleHost {
+ public:
+ BrowserBubbleHost() {}
+
+ // Invoked when the window containing the attached browser-bubbles is moved.
+ // Calls BrowserBubble::BrowserWindowMoved on all attached bubbles.
+ void WindowMoved();
+
+ // To be called when the frame containing the BrowserBubbleHost is closing.
+ // Calls BrowserBubble::BrowserWindowClosing on all attached bubbles.
+ void Close();
+
+ // Registers/Unregisters |bubble| to receive notifications when the host moves
+ // or is closed.
+ void AttachBrowserBubble(BrowserBubble* bubble);
+ void DetachBrowserBubble(BrowserBubble* bubble);
+
+ private:
+ // The set of bubbles associated with this host.
+ typedef std::set<BrowserBubble*> BubbleSet;
+ BubbleSet browser_bubbles_;
+
+ DISALLOW_COPY_AND_ASSIGN(BrowserBubbleHost);
+};
+
+#endif // CHROME_BROWSER_VIEWS_FRAME_BROWSER_BUBBLE_HOST_H_