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

Side by Side Diff: chrome/browser/ui/omnibox/omnibox_view.cc

Issue 293713002: [OriginChip] Re-enable the chip when reverting the text in the omnibox. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file defines helper functions shared by the various implementations 5 // This file defines helper functions shared by the various implementations
6 // of OmniboxView. 6 // of OmniboxView.
7 7
8 #include "chrome/browser/ui/omnibox/omnibox_view.h" 8 #include "chrome/browser/ui/omnibox/omnibox_view.h"
9 9
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 } 171 }
172 172
173 void OmniboxView::HideURL() { 173 void OmniboxView::HideURL() {
174 controller_->GetToolbarModel()->set_origin_chip_enabled(true); 174 controller_->GetToolbarModel()->set_origin_chip_enabled(true);
175 controller_->GetToolbarModel()->set_url_replacement_enabled(true); 175 controller_->GetToolbarModel()->set_url_replacement_enabled(true);
176 model_->UpdatePermanentText(); 176 model_->UpdatePermanentText();
177 RevertWithoutResettingSearchTermReplacement(); 177 RevertWithoutResettingSearchTermReplacement();
178 } 178 }
179 179
180 void OmniboxView::RevertAll() { 180 void OmniboxView::RevertAll() {
181 controller_->GetToolbarModel()->set_origin_chip_enabled(true);
181 controller_->GetToolbarModel()->set_url_replacement_enabled(true); 182 controller_->GetToolbarModel()->set_url_replacement_enabled(true);
182 RevertWithoutResettingSearchTermReplacement(); 183 RevertWithoutResettingSearchTermReplacement();
183 } 184 }
184 185
185 void OmniboxView::RevertWithoutResettingSearchTermReplacement() { 186 void OmniboxView::RevertWithoutResettingSearchTermReplacement() {
186 CloseOmniboxPopup(); 187 CloseOmniboxPopup();
187 if (model_.get()) 188 if (model_.get())
188 model_->Revert(); 189 model_->Revert();
189 TextChanged(); 190 TextChanged();
190 } 191 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 // |profile| can be NULL in tests. 223 // |profile| can be NULL in tests.
223 if (profile) 224 if (profile)
224 model_.reset(new OmniboxEditModel(this, controller, profile)); 225 model_.reset(new OmniboxEditModel(this, controller, profile));
225 } 226 }
226 227
227 void OmniboxView::TextChanged() { 228 void OmniboxView::TextChanged() {
228 EmphasizeURLComponents(); 229 EmphasizeURLComponents();
229 if (model_.get()) 230 if (model_.get())
230 model_->OnChanged(); 231 model_->OnChanged();
231 } 232 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698