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

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

Issue 2030013003: Remove ListValue::Append(new {Fundamental,String}Value(...)) pattern in //chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 if (!settings->startup_pages.empty()) { 182 if (!settings->startup_pages.empty()) {
183 SetPref(extension->id(), 183 SetPref(extension->id(),
184 prefs::kRestoreOnStartup, 184 prefs::kRestoreOnStartup,
185 new base::FundamentalValue(SessionStartupPref::kPrefValueURLs)); 185 new base::FundamentalValue(SessionStartupPref::kPrefValueURLs));
186 if (settings->startup_pages.size() > 1) { 186 if (settings->startup_pages.size() > 1) {
187 VLOG(1) << extensions::ErrorUtils::FormatErrorMessage( 187 VLOG(1) << extensions::ErrorUtils::FormatErrorMessage(
188 kManyStartupPagesWarning, 188 kManyStartupPagesWarning,
189 manifest_keys::kSettingsOverride); 189 manifest_keys::kSettingsOverride);
190 } 190 }
191 std::unique_ptr<base::ListValue> url_list(new base::ListValue); 191 std::unique_ptr<base::ListValue> url_list(new base::ListValue);
192 url_list->Append(new base::StringValue(SubstituteInstallParam( 192 url_list->AppendString(SubstituteInstallParam(
193 settings->startup_pages[0].spec(), install_parameter))); 193 settings->startup_pages[0].spec(), install_parameter));
194 SetPref( 194 SetPref(
195 extension->id(), prefs::kURLsToRestoreOnStartup, url_list.release()); 195 extension->id(), prefs::kURLsToRestoreOnStartup, url_list.release());
196 } 196 }
197 if (settings->search_engine) { 197 if (settings->search_engine) {
198 // Bring the preference to the correct state. Before this code set it 198 // Bring the preference to the correct state. Before this code set it
199 // to "true" for all search engines. Thus, we should overwrite it for 199 // to "true" for all search engines. Thus, we should overwrite it for
200 // all search engines. 200 // all search engines.
201 if (settings->search_engine->is_default) { 201 if (settings->search_engine->is_default) {
202 SetPref(extension->id(), 202 SetPref(extension->id(),
203 prefs::kDefaultSearchProviderEnabled, 203 prefs::kDefaultSearchProviderEnabled,
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 283
284 template <> 284 template <>
285 void BrowserContextKeyedAPIFactory< 285 void BrowserContextKeyedAPIFactory<
286 SettingsOverridesAPI>::DeclareFactoryDependencies() { 286 SettingsOverridesAPI>::DeclareFactoryDependencies() {
287 DependsOn(ExtensionPrefsFactory::GetInstance()); 287 DependsOn(ExtensionPrefsFactory::GetInstance());
288 DependsOn(PreferenceAPI::GetFactoryInstance()); 288 DependsOn(PreferenceAPI::GetFactoryInstance());
289 DependsOn(TemplateURLServiceFactory::GetInstance()); 289 DependsOn(TemplateURLServiceFactory::GetInstance());
290 } 290 }
291 291
292 } // namespace extensions 292 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698