Commit da9ac4ee authored by kuan@chromium.org's avatar kuan@chromium.org

fix to show detached bookmark bar on NTP when "Show bookmarks bar" is on.

cause:
bookmark bar state in Browser wasn't updated when BrowserView::OnActiveTabChanged queries it to update the bookmark bar.

fix:
determine new bookmark bar state in Browser before calling BrowserView::OnActiveTabChanged.

BUG=299131
TEST=verify per bug rpt

Review URL: https://codereview.chromium.org/25500003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226454 0039d316-1c4b-4281-b951-d872f2087c98
parent fb1b2730
...@@ -1048,8 +1048,12 @@ void Browser::ActiveTabChanged(WebContents* old_contents, ...@@ -1048,8 +1048,12 @@ void Browser::ActiveTabChanged(WebContents* old_contents,
int reason) { int reason) {
content::RecordAction(UserMetricsAction("ActiveTabChanged")); content::RecordAction(UserMetricsAction("ActiveTabChanged"));
// First let the BrowserWindow do its handling. On e.g. views this changes // Update the bookmark state, since the BrowserWindow may query it during
// the focused object, which should happen before we update the toolbar below, // OnActiveTabChanged() below.
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 // since the omnibox expects the correct element to already be focused when it
// is updated. // is updated.
window_->OnActiveTabChanged(old_contents, new_contents, index, reason); window_->OnActiveTabChanged(old_contents, new_contents, index, reason);
...@@ -1103,8 +1107,6 @@ void Browser::ActiveTabChanged(WebContents* old_contents, ...@@ -1103,8 +1107,6 @@ void Browser::ActiveTabChanged(WebContents* old_contents,
tab_strip_model_->active_index()); tab_strip_model_->active_index());
} }
UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_SWITCH);
// This needs to be called after UpdateSearchState(). // This needs to be called after UpdateSearchState().
if (instant_controller_) if (instant_controller_)
instant_controller_->ActiveTabChanged(); instant_controller_->ActiveTabChanged();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment