OLD | NEW |
---|---|
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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
244 // do_not_create_(desktop|quick_launch)_shortcut to true. | 244 // do_not_create_(desktop|quick_launch)_shortcut to true. |
245 bool create_all_shortcuts = true; | 245 bool create_all_shortcuts = true; |
246 GetBool(installer::master_preferences::kCreateAllShortcuts, | 246 GetBool(installer::master_preferences::kCreateAllShortcuts, |
247 &create_all_shortcuts); | 247 &create_all_shortcuts); |
248 if (!create_all_shortcuts) { | 248 if (!create_all_shortcuts) { |
249 distribution_->SetBoolean( | 249 distribution_->SetBoolean( |
250 installer::master_preferences::kDoNotCreateDesktopShortcut, true); | 250 installer::master_preferences::kDoNotCreateDesktopShortcut, true); |
251 distribution_->SetBoolean( | 251 distribution_->SetBoolean( |
252 installer::master_preferences::kDoNotCreateQuickLaunchShortcut, true); | 252 installer::master_preferences::kDoNotCreateQuickLaunchShortcut, true); |
253 } | 253 } |
254 | |
255 // If there is no entry for kURLsToRestoreOnStartup and there is one for | |
256 // kURLsToRestoreOnStartupOld, copy the old to the new. | |
257 const base::ListValue* startup_urls_list = NULL; | |
258 if (master_dictionary_ && | |
259 !master_dictionary_->GetList(prefs::kURLsToRestoreOnStartup, NULL) && | |
260 master_dictionary_->GetList(prefs::kURLsToRestoreOnStartupOld, | |
261 &startup_urls_list) && | |
262 startup_urls_list) { | |
263 base::ListValue* new_startup_urls_list = startup_urls_list->DeepCopy(); | |
264 master_dictionary_->Set(prefs::kURLsToRestoreOnStartup, | |
gab
2015/08/24 21:48:45
This is problematic because the "latest" master_pr
sdefresne
2015/08/25 08:36:10
+atwilson: WDYT? Can we remove this? Should I upda
sdefresne
2015/08/26 16:00:56
According to offline discussion, we can remove thi
| |
265 new_startup_urls_list); | |
266 } | |
267 } | 254 } |
268 | 255 |
269 bool MasterPreferences::GetBool(const std::string& name, bool* value) const { | 256 bool MasterPreferences::GetBool(const std::string& name, bool* value) const { |
270 bool ret = false; | 257 bool ret = false; |
271 if (distribution_) | 258 if (distribution_) |
272 ret = distribution_->GetBoolean(name, value); | 259 ret = distribution_->GetBoolean(name, value); |
273 return ret; | 260 return ret; |
274 } | 261 } |
275 | 262 |
276 bool MasterPreferences::GetInt(const std::string& name, int* value) const { | 263 bool MasterPreferences::GetInt(const std::string& name, int* value) const { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
320 } | 307 } |
321 return result; | 308 return result; |
322 } | 309 } |
323 | 310 |
324 // static | 311 // static |
325 const MasterPreferences& MasterPreferences::ForCurrentProcess() { | 312 const MasterPreferences& MasterPreferences::ForCurrentProcess() { |
326 return g_master_preferences.Get(); | 313 return g_master_preferences.Get(); |
327 } | 314 } |
328 | 315 |
329 } // namespace installer | 316 } // namespace installer |
OLD | NEW |