[OriginChip] Re-enable the chip as necessary when switching tabs.

BUG=369500

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271161 0039d316-1c4b-4281-b951-d872f2087c98
parent 9016f532
...@@ -247,8 +247,11 @@ const OmniboxEditModel::State OmniboxEditModel::GetStateForTabSwitch() { ...@@ -247,8 +247,11 @@ const OmniboxEditModel::State OmniboxEditModel::GetStateForTabSwitch() {
void OmniboxEditModel::RestoreState(const State* state) { void OmniboxEditModel::RestoreState(const State* state) {
// We need to update the permanent text correctly and revert the view // We need to update the permanent text correctly and revert the view
// regardless of whether there is saved state. // regardless of whether there is saved state.
bool url_replacement_enabled = !state || state->url_replacement_enabled;
controller_->GetToolbarModel()->set_url_replacement_enabled( controller_->GetToolbarModel()->set_url_replacement_enabled(
!state || state->url_replacement_enabled); url_replacement_enabled);
controller_->GetToolbarModel()->set_origin_chip_enabled(
url_replacement_enabled);
permanent_text_ = controller_->GetToolbarModel()->GetText(); permanent_text_ = controller_->GetToolbarModel()->GetText();
// Don't muck with the search term replacement state, as we've just set it // Don't muck with the search term replacement state, as we've just set it
// correctly. // correctly.
......
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