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

Unified Diff: chrome/browser/ui/browser.cc

Issue 1251633002: Add BubbleManager to manage bubbles and ChromeBubbleManager for events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix trybots pt2 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
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index befe5b85037b929614fa0d59510a954408011b3d..8101c14a5a6bab2c363d5faa971990b306a7e09f 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -471,6 +471,8 @@ Browser::~Browser() {
// The tab strip should not have any tabs at this point.
DCHECK(tab_strip_model_->empty());
tab_strip_model_->RemoveObserver(this);
+ if (bubble_manager_)
+ tab_strip_model_->RemoveObserver(bubble_manager_.get());
msw 2015/08/26 01:42:35 Make the ChromeBubbleManager dtor remove itself as
hcarmona 2015/08/26 17:25:58 Done.
// Destroy the BrowserCommandController before removing the browser, so that
// it doesn't act on any notifications that are sent as a result of removing
@@ -549,6 +551,14 @@ Browser::~Browser() {
///////////////////////////////////////////////////////////////////////////////
// Getters & Setters
+ChromeBubbleManager* Browser::GetBubbleManager() {
+ if (!bubble_manager_) {
+ bubble_manager_.reset(new ChromeBubbleManager);
+ tab_strip_model_->AddObserver(bubble_manager_.get());
msw 2015/08/26 01:42:35 Do this in the ChromeBubbleManager ctor; pass it |
hcarmona 2015/08/26 17:25:58 Done.
+ }
+ return bubble_manager_.get();
+}
+
FindBarController* Browser::GetFindBarController() {
if (!find_bar_controller_.get()) {
FindBar* find_bar = window_->CreateFindBar();
@@ -809,6 +819,8 @@ void Browser::WindowFullscreenStateChanged() {
->WindowFullscreenStateChanged();
command_controller_->FullscreenStateChanged();
UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TOGGLE_FULLSCREEN);
+
+ GetBubbleManager()->WindowFullscreenStateChanged();
msw 2015/08/26 01:42:35 Make this conditional on the existence of a manage
hcarmona 2015/08/26 17:25:58 Done.
}
///////////////////////////////////////////////////////////////////////////////

Powered by Google App Engine
This is Rietveld 408576698