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

Side by Side Diff: components/omnibox/browser/omnibox_view.cc

Issue 2242213008: Remove url_replacement logic from Omnibox/ToolbarModel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_show_url
Patch Set: rebase Created 4 years, 3 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
« no previous file with comments | « components/omnibox/browser/omnibox_view.h ('k') | components/toolbar/BUILD.gn » ('j') | 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 "components/omnibox/browser/omnibox_view.h" 8 #include "components/omnibox/browser/omnibox_view.h"
9 9
10 #include <utility> 10 #include <utility>
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 } 106 }
107 107
108 void OmniboxView::SetUserText(const base::string16& text, 108 void OmniboxView::SetUserText(const base::string16& text,
109 bool update_popup) { 109 bool update_popup) {
110 if (model_.get()) 110 if (model_.get())
111 model_->SetUserText(text); 111 model_->SetUserText(text);
112 SetWindowTextAndCaretPos(text, text.length(), update_popup, true); 112 SetWindowTextAndCaretPos(text, text.length(), update_popup, true);
113 } 113 }
114 114
115 void OmniboxView::RevertAll() { 115 void OmniboxView::RevertAll() {
116 controller_->GetToolbarModel()->set_url_replacement_enabled(true);
117 RevertWithoutResettingSearchTermReplacement();
118 }
119
120 void OmniboxView::RevertWithoutResettingSearchTermReplacement() {
121 CloseOmniboxPopup(); 116 CloseOmniboxPopup();
122 if (model_.get()) 117 if (model_.get())
123 model_->Revert(); 118 model_->Revert();
124 TextChanged(); 119 TextChanged();
125 } 120 }
126 121
127 void OmniboxView::CloseOmniboxPopup() { 122 void OmniboxView::CloseOmniboxPopup() {
128 if (model_.get()) 123 if (model_.get())
129 model_->StopAutocomplete(); 124 model_->StopAutocomplete();
130 } 125 }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 if (client) { 191 if (client) {
197 model_.reset(new OmniboxEditModel(this, controller, std::move(client))); 192 model_.reset(new OmniboxEditModel(this, controller, std::move(client)));
198 } 193 }
199 } 194 }
200 195
201 void OmniboxView::TextChanged() { 196 void OmniboxView::TextChanged() {
202 EmphasizeURLComponents(); 197 EmphasizeURLComponents();
203 if (model_.get()) 198 if (model_.get())
204 model_->OnChanged(); 199 model_->OnChanged();
205 } 200 }
OLDNEW
« no previous file with comments | « components/omnibox/browser/omnibox_view.h ('k') | components/toolbar/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698