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

Unified Diff: chrome/installer/setup/install.cc

Issue 4342001: Refactoring the master_preferences functions.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/installer/setup/install.h ('k') | chrome/installer/setup/setup_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/setup/install.cc
===================================================================
--- chrome/installer/setup/install.cc (revision 64604)
+++ chrome/installer/setup/install.cc (working copy)
@@ -20,7 +20,7 @@
#include "chrome/installer/util/google_update_constants.h"
#include "chrome/installer/util/helper.h"
#include "chrome/installer/util/install_util.h"
-#include "chrome/installer/util/master_preferences.h"
+#include "chrome/installer/util/master_preferences_constants.h"
#include "chrome/installer/util/set_reg_value_work_item.h"
#include "chrome/installer/util/shell_util.h"
#include "chrome/installer/util/util_constants.h"
@@ -729,11 +729,11 @@
installer_util::InstallStatus installer::InstallOrUpdateChrome(
const std::wstring& exe_path, const std::wstring& archive_path,
const std::wstring& install_temp_path, const std::wstring& prefs_path,
- const DictionaryValue* prefs, const Version& new_version,
+ const installer_util::MasterPreferences& prefs, const Version& new_version,
const Version* installed_version) {
bool system_install = false;
- installer_util::GetDistroBooleanPreference(prefs,
- installer_util::master_preferences::kSystemLevel, &system_install);
+ prefs.GetBool(installer_util::master_preferences::kSystemLevel,
+ &system_install);
std::wstring install_path(GetChromeInstallPath(system_install));
if (install_path.empty()) {
LOG(ERROR) << "Could not get installation destination path.";
@@ -757,27 +757,25 @@
CopyPreferenceFileForFirstRun(system_install, prefs_path);
bool value = false;
- if (!installer_util::GetDistroBooleanPreference(prefs,
- installer_util::master_preferences::kDoNotCreateShortcuts, &value) ||
- !value) {
+ if (!prefs.GetBool(
+ installer_util::master_preferences::kDoNotCreateShortcuts,
+ &value) || !value) {
bool create_all_shortcut = false;
- installer_util::GetDistroBooleanPreference(prefs,
- installer_util::master_preferences::kCreateAllShortcuts,
- &create_all_shortcut);
+ prefs.GetBool(installer_util::master_preferences::kCreateAllShortcuts,
+ &create_all_shortcut);
bool alt_shortcut = false;
- installer_util::GetDistroBooleanPreference(prefs,
- installer_util::master_preferences::kAltShortcutText,
- &alt_shortcut);
+ prefs.GetBool(installer_util::master_preferences::kAltShortcutText,
+ &alt_shortcut);
if (!CreateOrUpdateChromeShortcuts(exe_path, install_path,
new_version.GetString(), result,
system_install, create_all_shortcut,
- alt_shortcut))
+ alt_shortcut)) {
LOG(WARNING) << "Failed to create/update start menu shortcut.";
+ }
bool make_chrome_default = false;
- installer_util::GetDistroBooleanPreference(prefs,
- installer_util::master_preferences::kMakeChromeDefault,
- &make_chrome_default);
+ prefs.GetBool(installer_util::master_preferences::kMakeChromeDefault,
+ &make_chrome_default);
// If this is not the user's first Chrome install, but they have chosen
// Chrome to become their default browser on the download page, we must
@@ -786,7 +784,7 @@
bool force_chrome_default_for_user = false;
if (result == installer_util::NEW_VERSION_UPDATED ||
result == installer_util::INSTALL_REPAIRED) {
- installer_util::GetDistroBooleanPreference(prefs,
+ prefs.GetBool(
installer_util::master_preferences::kMakeChromeDefaultForUser,
&force_chrome_default_for_user);
}
« no previous file with comments | « chrome/installer/setup/install.h ('k') | chrome/installer/setup/setup_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698