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

Side by Side Diff: chrome/browser/extensions/api/settings_overrides/settings_overrides_api.cc

Issue 1135163002: Omnibox - Strip Extra Whitespace from Custom Search Engine Names (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix more tests that don't set short_name Created 5 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/extensions/api/settings_overrides/settings_overrides_ap i.h" 5 #include "chrome/browser/extensions/api/settings_overrides/settings_overrides_ap i.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/extensions/api/preference/preference_api.h" 9 #include "chrome/browser/extensions/api/preference/preference_api.h"
10 #include "chrome/browser/prefs/session_startup_pref.h" 10 #include "chrome/browser/prefs/session_startup_pref.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 TemplateURLData data; 65 TemplateURLData data;
66 if (search_provider.prepopulated_id) { 66 if (search_provider.prepopulated_id) {
67 if (!GetPrepopulatedSearchProvider(prefs, *search_provider.prepopulated_id, 67 if (!GetPrepopulatedSearchProvider(prefs, *search_provider.prepopulated_id,
68 &data)) { 68 &data)) {
69 VLOG(1) << "Settings Overrides API can't recognize prepopulated_id=" 69 VLOG(1) << "Settings Overrides API can't recognize prepopulated_id="
70 << *search_provider.prepopulated_id; 70 << *search_provider.prepopulated_id;
71 } 71 }
72 } 72 }
73 73
74 if (search_provider.name) 74 if (search_provider.name)
75 data.short_name = base::UTF8ToUTF16(*search_provider.name); 75 data.SetShortName(base::UTF8ToUTF16(*search_provider.name));
76 if (search_provider.keyword) 76 if (search_provider.keyword)
77 data.SetKeyword(base::UTF8ToUTF16(*search_provider.keyword)); 77 data.SetKeyword(base::UTF8ToUTF16(*search_provider.keyword));
78 data.SetURL(SubstituteInstallParam(search_provider.search_url, 78 data.SetURL(SubstituteInstallParam(search_provider.search_url,
79 install_parameter)); 79 install_parameter));
80 if (search_provider.suggest_url) { 80 if (search_provider.suggest_url) {
81 data.suggestions_url = 81 data.suggestions_url =
82 SubstituteInstallParam(*search_provider.suggest_url, install_parameter); 82 SubstituteInstallParam(*search_provider.suggest_url, install_parameter);
83 } 83 }
84 if (search_provider.instant_url) { 84 if (search_provider.instant_url) {
85 data.instant_url = 85 data.instant_url =
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 279
280 template <> 280 template <>
281 void BrowserContextKeyedAPIFactory< 281 void BrowserContextKeyedAPIFactory<
282 SettingsOverridesAPI>::DeclareFactoryDependencies() { 282 SettingsOverridesAPI>::DeclareFactoryDependencies() {
283 DependsOn(ExtensionPrefsFactory::GetInstance()); 283 DependsOn(ExtensionPrefsFactory::GetInstance());
284 DependsOn(PreferenceAPI::GetFactoryInstance()); 284 DependsOn(PreferenceAPI::GetFactoryInstance());
285 DependsOn(TemplateURLServiceFactory::GetInstance()); 285 DependsOn(TemplateURLServiceFactory::GetInstance());
286 } 286 }
287 287
288 } // namespace extensions 288 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698