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

Unified Diff: components/bubble/bubble_controller.h

Issue 1310483003: Add ability for a BubbleReference to update the BubbleUI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bm-reference-own-file.gitbr
Patch Set: Add UI thread checks to controller Created 5 years, 3 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 | « no previous file | components/bubble/bubble_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/bubble/bubble_controller.h
diff --git a/components/bubble/bubble_controller.h b/components/bubble/bubble_controller.h
index bd87d2dc7f86d68bc2654f6cbdb6edce4e2feb26..756ab34bfc3d70ec8d9272c24cfdda11d507ff65 100644
--- a/components/bubble/bubble_controller.h
+++ b/components/bubble/bubble_controller.h
@@ -7,11 +7,12 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
+#include "base/threading/thread_checker.h"
#include "components/bubble/bubble_close_reason.h"
class BubbleDelegate;
class BubbleManager;
-class BubbleUI;
+class BubbleUi;
// BubbleController is responsible for the lifetime of the delegate and its UI.
class BubbleController : public base::SupportsWeakPtr<BubbleController> {
@@ -23,6 +24,10 @@ class BubbleController : public base::SupportsWeakPtr<BubbleController> {
// Calls CloseBubble on the associated BubbleManager.
bool CloseBubble(BubbleCloseReason reason);
+ // Calls UpdateBubbleUi on the associated BubbleManager.
+ // Returns true if the UI was updated.
+ bool UpdateBubbleUi();
+
private:
friend class BubbleManager;
@@ -39,7 +44,10 @@ class BubbleController : public base::SupportsWeakPtr<BubbleController> {
BubbleManager* manager_;
scoped_ptr<BubbleDelegate> delegate_;
- scoped_ptr<BubbleUI> bubble_ui_;
+ scoped_ptr<BubbleUi> bubble_ui_;
+
+ // Verify that functions that affect the UI are done on the same thread.
+ base::ThreadChecker thread_checker_;
DISALLOW_COPY_AND_ASSIGN(BubbleController);
};
« no previous file with comments | « no previous file | components/bubble/bubble_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698