Chromium Code Reviews| Index: chrome/browser/ui/browser.cc |
| diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc |
| index 27063591eaff6a99d18dc3f44283e1efa81fdfc7..121492de6cd75db7fa0d317949f6ecd9371ba07e 100644 |
| --- a/chrome/browser/ui/browser.cc |
| +++ b/chrome/browser/ui/browser.cc |
| @@ -1048,8 +1048,16 @@ void Browser::ActiveTabChanged(WebContents* old_contents, |
| int reason) { |
| content::RecordAction(UserMetricsAction("ActiveTabChanged")); |
| - // First let the BrowserWindow do its handling. On e.g. views this changes |
| - // the focused object, which should happen before we update the toolbar below, |
| + // First, determine the new bookmark state, so that it can be queried by |
| + // BrowserWindow::BookmarkBarStateChanged() when it's invoked from |
| + // BrowserWindow::OnActiveTabChanged() below. |
| + // Note that UpdateBookmarkBarState() won't invoke |
| + // BrowserWindow::BookmarkBarStateChanged() for |
| + // BOOKMARK_BAR_STATE_CHANGE_TAB_SWITCH reason. |
|
Peter Kasting
2013/10/01 20:44:11
Nit: Can we just say:
Update the bookmark bar sta
kuan
2013/10/02 00:15:37
Done.
|
| + UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_SWITCH); |
| + |
| + // Let the BrowserWindow do its handling. On e.g. views this changes the |
| + // focused object, which should happen before we update the toolbar below, |
| // since the omnibox expects the correct element to already be focused when it |
| // is updated. |
| window_->OnActiveTabChanged(old_contents, new_contents, index, reason); |
| @@ -1103,8 +1111,6 @@ void Browser::ActiveTabChanged(WebContents* old_contents, |
| tab_strip_model_->active_index()); |
| } |
| - UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_SWITCH); |
| - |
| // This needs to be called after UpdateSearchState(). |
| if (instant_controller_) |
| instant_controller_->ActiveTabChanged(); |