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

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

Issue 368273011: Revert of Componentize TemplateURLService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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
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"
11 #include "base/strings/string_util.h" 11 #include "base/strings/string_util.h"
12 #include "base/strings/utf_string_conversions.h" 12 #include "base/strings/utf_string_conversions.h"
13 #include "chrome/browser/autocomplete/autocomplete_match.h" 13 #include "chrome/browser/autocomplete/autocomplete_match.h"
14 #include "chrome/browser/search/search.h" 14 #include "chrome/browser/search/search.h"
15 #include "chrome/browser/search_engines/template_url_service.h"
15 #include "chrome/browser/search_engines/template_url_service_factory.h" 16 #include "chrome/browser/search_engines/template_url_service_factory.h"
16 #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h" 17 #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h"
17 #include "chrome/browser/ui/toolbar/toolbar_model.h" 18 #include "chrome/browser/ui/toolbar/toolbar_model.h"
18 #include "components/search_engines/template_url.h" 19 #include "components/search_engines/template_url.h"
19 #include "components/search_engines/template_url_service.h"
20 #include "grit/generated_resources.h" 20 #include "grit/generated_resources.h"
21 #include "ui/base/clipboard/clipboard.h" 21 #include "ui/base/clipboard/clipboard.h"
22 #include "ui/base/l10n/l10n_util.h" 22 #include "ui/base/l10n/l10n_util.h"
23 23
24 // static 24 // static
25 base::string16 OmniboxView::StripJavascriptSchemas(const base::string16& text) { 25 base::string16 OmniboxView::StripJavascriptSchemas(const base::string16& text) {
26 const base::string16 kJsPrefix( 26 const base::string16 kJsPrefix(
27 base::ASCIIToUTF16(url::kJavaScriptScheme) + base::ASCIIToUTF16(":")); 27 base::ASCIIToUTF16(url::kJavaScriptScheme) + base::ASCIIToUTF16(":"));
28 base::string16 out(text); 28 base::string16 out(text);
29 while (StartsWith(out, kJsPrefix, false)) { 29 while (StartsWith(out, kJsPrefix, false)) {
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 // |profile| can be NULL in tests. 224 // |profile| can be NULL in tests.
225 if (profile) 225 if (profile)
226 model_.reset(new OmniboxEditModel(this, controller, profile)); 226 model_.reset(new OmniboxEditModel(this, controller, profile));
227 } 227 }
228 228
229 void OmniboxView::TextChanged() { 229 void OmniboxView::TextChanged() {
230 EmphasizeURLComponents(); 230 EmphasizeURLComponents();
231 if (model_.get()) 231 if (model_.get())
232 model_->OnChanged(); 232 model_->OnChanged();
233 } 233 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/omnibox/omnibox_popup_model.cc ('k') | chrome/browser/ui/omnibox/omnibox_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698