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

Unified Diff: components/bubble/bubble_controller.cc

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 | « components/bubble/bubble_controller.h ('k') | components/bubble/bubble_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/bubble/bubble_controller.cc
diff --git a/components/bubble/bubble_controller.cc b/components/bubble/bubble_controller.cc
index e32cd21716428aa0845c41c6a865a6c4ff0b1849..5e045390d24cd6305324fd203c3935ced2165042 100644
--- a/components/bubble/bubble_controller.cc
+++ b/components/bubble/bubble_controller.cc
@@ -21,12 +21,20 @@ BubbleController::~BubbleController() {
}
bool BubbleController::CloseBubble(BubbleCloseReason reason) {
+ DCHECK(thread_checker_.CalledOnValidThread());
return manager_->CloseBubble(this->AsWeakPtr(), reason);
}
+bool BubbleController::UpdateBubbleUi() {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ if (!bubble_ui_)
+ return false;
+ return delegate_->UpdateBubbleUi(bubble_ui_.get());
+}
+
void BubbleController::Show() {
DCHECK(!bubble_ui_);
- bubble_ui_ = delegate_->BuildBubbleUI();
+ bubble_ui_ = delegate_->BuildBubbleUi();
DCHECK(bubble_ui_);
bubble_ui_->Show(AsWeakPtr());
// TODO(hcarmona): log that bubble was shown.
« no previous file with comments | « components/bubble/bubble_controller.h ('k') | components/bubble/bubble_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698