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

Side by Side Diff: chrome/installer/util/master_preferences.cc

Issue 1302303002: Remove year+ old migration support of "session.urls_to_restore_on_startup". (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pref_service_syncable_unittest
Patch Set: Address comments Created 5 years 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 | « chrome/common/pref_names.cc ('k') | chrome/installer/util/master_preferences_unittest.cc » ('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 #include "chrome/installer/util/master_preferences.h" 5 #include "chrome/installer/util/master_preferences.h"
6 6
7 #include "base/environment.h" 7 #include "base/environment.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/json/json_string_value_serializer.h" 9 #include "base/json/json_string_value_serializer.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 // do_not_create_(desktop|quick_launch)_shortcut to true. 242 // do_not_create_(desktop|quick_launch)_shortcut to true.
243 bool create_all_shortcuts = true; 243 bool create_all_shortcuts = true;
244 GetBool(installer::master_preferences::kCreateAllShortcuts, 244 GetBool(installer::master_preferences::kCreateAllShortcuts,
245 &create_all_shortcuts); 245 &create_all_shortcuts);
246 if (!create_all_shortcuts) { 246 if (!create_all_shortcuts) {
247 distribution_->SetBoolean( 247 distribution_->SetBoolean(
248 installer::master_preferences::kDoNotCreateDesktopShortcut, true); 248 installer::master_preferences::kDoNotCreateDesktopShortcut, true);
249 distribution_->SetBoolean( 249 distribution_->SetBoolean(
250 installer::master_preferences::kDoNotCreateQuickLaunchShortcut, true); 250 installer::master_preferences::kDoNotCreateQuickLaunchShortcut, true);
251 } 251 }
252
253 // If there is no entry for kURLsToRestoreOnStartup and there is one for
254 // kURLsToRestoreOnStartupOld, copy the old to the new.
255 const base::ListValue* startup_urls_list = NULL;
256 if (master_dictionary_ &&
257 !master_dictionary_->GetList(prefs::kURLsToRestoreOnStartup, NULL) &&
258 master_dictionary_->GetList(prefs::kURLsToRestoreOnStartupOld,
259 &startup_urls_list) &&
260 startup_urls_list) {
261 base::ListValue* new_startup_urls_list = startup_urls_list->DeepCopy();
262 master_dictionary_->Set(prefs::kURLsToRestoreOnStartup,
263 new_startup_urls_list);
264 }
265 } 252 }
266 253
267 bool MasterPreferences::GetBool(const std::string& name, bool* value) const { 254 bool MasterPreferences::GetBool(const std::string& name, bool* value) const {
268 bool ret = false; 255 bool ret = false;
269 if (distribution_) 256 if (distribution_)
270 ret = distribution_->GetBoolean(name, value); 257 ret = distribution_->GetBoolean(name, value);
271 return ret; 258 return ret;
272 } 259 }
273 260
274 bool MasterPreferences::GetInt(const std::string& name, int* value) const { 261 bool MasterPreferences::GetInt(const std::string& name, int* value) const {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 } 305 }
319 return result; 306 return result;
320 } 307 }
321 308
322 // static 309 // static
323 const MasterPreferences& MasterPreferences::ForCurrentProcess() { 310 const MasterPreferences& MasterPreferences::ForCurrentProcess() {
324 return g_master_preferences.Get(); 311 return g_master_preferences.Get();
325 } 312 }
326 313
327 } // namespace installer 314 } // namespace installer
OLDNEW
« no previous file with comments | « chrome/common/pref_names.cc ('k') | chrome/installer/util/master_preferences_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698