Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3066)

Unified Diff: components/bubble/bubble_delegate.h

Issue 1251633002: Add BubbleManager to manage bubbles and ChromeBubbleManager for events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gn nit Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/bubble/bubble_controller.cc ('k') | components/bubble/bubble_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/bubble/bubble_delegate.h
diff --git a/components/bubble/bubble_delegate.h b/components/bubble/bubble_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..ebac50f33a3d5a4a56b7836d5acf225cfe9675b0
--- /dev/null
+++ b/components/bubble/bubble_delegate.h
@@ -0,0 +1,34 @@
+// Copyright 2015 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 COMPONENTS_BUBBLE_BUBBLE_DELEGATE_H_
+#define COMPONENTS_BUBBLE_BUBBLE_DELEGATE_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "components/bubble/bubble_close_reason.h"
+
+class BubbleUI;
+
+// Inherit from this class to define a bubble. A bubble is a small transient UI
+// surface anchored to a parent window. Most bubbles are dismissed when they
+// lose focus.
+class BubbleDelegate {
+ public:
+ BubbleDelegate();
+ virtual ~BubbleDelegate();
+
+ // Called by BubbleController to notify a bubble of an event that the bubble
+ // might want to close on. Return true if the bubble should close for the
+ // specified reason.
+ virtual bool ShouldClose(BubbleCloseReason reason);
+
+ // Called by BubbleController to build the UI that will represent this bubble.
+ // BubbleDelegate should not keep a reference to this newly created UI.
+ virtual scoped_ptr<BubbleUI> BuildBubbleUI() = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(BubbleDelegate);
+};
+
+#endif // COMPONENTS_BUBBLE_BUBBLE_DELEGATE_H_
« no previous file with comments | « components/bubble/bubble_controller.cc ('k') | components/bubble/bubble_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698