Chromium Code Reviews| 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/file_util.h" | 8 #include "base/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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 260 if (!GetBool(installer::master_preferences::kChrome, &chrome_)) | 260 if (!GetBool(installer::master_preferences::kChrome, &chrome_)) |
| 261 chrome_ = false; | 261 chrome_ = false; |
| 262 } else { | 262 } else { |
| 263 // If chrome-frame is on the command line however, we only install CF. | 263 // If chrome-frame is on the command line however, we only install CF. |
| 264 chrome_ = !chrome_frame_; | 264 chrome_ = !chrome_frame_; |
| 265 } | 265 } |
| 266 } | 266 } |
| 267 | 267 |
| 268 void MasterPreferences::EnforceLegacyPreferences() { | 268 void MasterPreferences::EnforceLegacyPreferences() { |
| 269 // If create_all_shortcuts was explicitly set to false, set | 269 // If create_all_shortcuts was explicitly set to false, set |
| 270 // do_not_create_(desktop|quick_launch)_shortcut to true. | 270 // do_not_create_(desktop|quick_launch|start_menu)_shortcut to true. |
|
gab
2013/02/26 20:35:46
(see comment below first)
Highlight here that thi
Joao da Silva
2013/03/06 19:57:38
Done.
| |
| 271 bool create_all_shortcuts = true; | 271 bool create_all_shortcuts = true; |
| 272 GetBool(installer::master_preferences::kCreateAllShortcuts, | 272 GetBool(installer::master_preferences::kCreateAllShortcuts, |
| 273 &create_all_shortcuts); | 273 &create_all_shortcuts); |
| 274 if (!create_all_shortcuts) { | 274 if (!create_all_shortcuts) { |
| 275 distribution_->SetBoolean( | 275 distribution_->SetBoolean( |
| 276 installer::master_preferences::kDoNotCreateDesktopShortcut, true); | 276 installer::master_preferences::kDoNotCreateDesktopShortcut, true); |
| 277 distribution_->SetBoolean( | 277 distribution_->SetBoolean( |
| 278 installer::master_preferences::kDoNotCreateQuickLaunchShortcut, true); | 278 installer::master_preferences::kDoNotCreateQuickLaunchShortcut, true); |
| 279 distribution_->SetBoolean( | |
|
gab
2013/02/26 20:35:46
Do not add this to this method as it is only here
Joao da Silva
2013/03/06 19:57:38
Done.
| |
| 280 installer::master_preferences::kDoNotCreateStartMenuShortcut, true); | |
| 279 } | 281 } |
| 280 } | 282 } |
| 281 | 283 |
| 282 bool MasterPreferences::GetBool(const std::string& name, bool* value) const { | 284 bool MasterPreferences::GetBool(const std::string& name, bool* value) const { |
| 283 bool ret = false; | 285 bool ret = false; |
| 284 if (distribution_) | 286 if (distribution_) |
| 285 ret = distribution_->GetBoolean(name, value); | 287 ret = distribution_->GetBoolean(name, value); |
| 286 return ret; | 288 return ret; |
| 287 } | 289 } |
| 288 | 290 |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 315 master_dictionary_->GetString(prefs::kVariationsSeed, &variations_seed); | 317 master_dictionary_->GetString(prefs::kVariationsSeed, &variations_seed); |
| 316 return variations_seed; | 318 return variations_seed; |
| 317 } | 319 } |
| 318 | 320 |
| 319 // static | 321 // static |
| 320 const MasterPreferences& MasterPreferences::ForCurrentProcess() { | 322 const MasterPreferences& MasterPreferences::ForCurrentProcess() { |
| 321 return g_master_preferences.Get(); | 323 return g_master_preferences.Get(); |
| 322 } | 324 } |
| 323 | 325 |
| 324 } // namespace installer | 326 } // namespace installer |
| OLD | NEW |