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

Side by Side Diff: chrome/browser/ui/search_engines/edit_search_engine_controller.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 #include "chrome/browser/ui/search_engines/edit_search_engine_controller.h" 5 #include "chrome/browser/ui/search_engines/edit_search_engine_controller.h"
6 6
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/search_engines/template_url_service.h"
10 #include "chrome/browser/search_engines/template_url_service_factory.h" 11 #include "chrome/browser/search_engines/template_url_service_factory.h"
11 #include "components/search_engines/template_url.h" 12 #include "components/search_engines/template_url.h"
12 #include "components/search_engines/template_url_service.h"
13 #include "components/url_fixer/url_fixer.h" 13 #include "components/url_fixer/url_fixer.h"
14 #include "content/public/browser/user_metrics.h" 14 #include "content/public/browser/user_metrics.h"
15 #include "url/gurl.h" 15 #include "url/gurl.h"
16 16
17 using base::UserMetricsAction; 17 using base::UserMetricsAction;
18 18
19 EditSearchEngineController::EditSearchEngineController( 19 EditSearchEngineController::EditSearchEngineController(
20 TemplateURL* template_url, 20 TemplateURL* template_url,
21 EditSearchEngineControllerDelegate* edit_keyword_delegate, 21 EditSearchEngineControllerDelegate* edit_keyword_delegate,
22 Profile* profile) 22 Profile* profile)
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 std::string expanded_url(t_url.url_ref().ReplaceSearchTerms( 141 std::string expanded_url(t_url.url_ref().ReplaceSearchTerms(
142 TemplateURLRef::SearchTermsArgs(base::ASCIIToUTF16("x")), 142 TemplateURLRef::SearchTermsArgs(base::ASCIIToUTF16("x")),
143 TemplateURLServiceFactory::GetForProfile(profile_)->search_terms_data())); 143 TemplateURLServiceFactory::GetForProfile(profile_)->search_terms_data()));
144 url::Parsed parts; 144 url::Parsed parts;
145 std::string scheme(url_fixer::SegmentURL(expanded_url, &parts)); 145 std::string scheme(url_fixer::SegmentURL(expanded_url, &parts));
146 if (!parts.scheme.is_valid()) 146 if (!parts.scheme.is_valid())
147 url.insert(0, scheme + "://"); 147 url.insert(0, scheme + "://");
148 148
149 return url; 149 return url;
150 } 150 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/search/search_tab_helper_unittest.cc ('k') | chrome/browser/ui/search_engines/keyword_editor_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698