Chromium Code Reviews| 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.
|
| } |
| /////////////////////////////////////////////////////////////////////////////// |