diff options
author | rogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-10 21:17:25 +0000 |
---|---|---|
committer | rogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-10 21:17:25 +0000 |
commit | 1b3588ddeb836c3f35127988c795cbce1c1d51a3 (patch) | |
tree | 11f218703d2463149b6591f873edfd99a1fbf6d3 /chrome/installer/util | |
parent | ceed2b8251ca42b050cc3ffb558abfe64a985b44 (diff) | |
download | chromium_src-1b3588ddeb836c3f35127988c795cbce1c1d51a3.zip chromium_src-1b3588ddeb836c3f35127988c795cbce1c1d51a3.tar.gz chromium_src-1b3588ddeb836c3f35127988c795cbce1c1d51a3.tar.bz2 |
User profile preferences to find ping delay when not first run of chrome.
BUG=154879
TEST=Install chrome with a nagtive ping delay in master prefs (-60). Start
chrome and wait for first RLZ ping, don't do an omnibox search. Then stop
chrome and restart it. Do an omnibox search right away, and make sure an
RLZ ping is sent within seconds.
Review URL: https://chromiumcodereview.appspot.com/11098027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161193 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/util')
-rw-r--r-- | chrome/installer/util/master_preferences.cc | 15 | ||||
-rw-r--r-- | chrome/installer/util/master_preferences_constants.cc | 1 | ||||
-rw-r--r-- | chrome/installer/util/master_preferences_constants.h | 2 |
3 files changed, 11 insertions, 7 deletions
diff --git a/chrome/installer/util/master_preferences.cc b/chrome/installer/util/master_preferences.cc index 21c05b1..d397b8c 100644 --- a/chrome/installer/util/master_preferences.cc +++ b/chrome/installer/util/master_preferences.cc @@ -17,7 +17,6 @@ namespace { -const char kDistroDict[] = "distribution"; const char kFirstRunTabs[] = "first_run_tabs"; base::LazyInstance<installer::MasterPreferences> g_master_preferences = @@ -109,7 +108,8 @@ MasterPreferences::MasterPreferences(const FilePath& prefs_path) } else { preferences_read_from_file_ = true; // Cache a pointer to the distribution dictionary. - master_dictionary_->GetDictionary(kDistroDict, &distribution_); + master_dictionary_->GetDictionary( + installer::master_preferences::kDistroDict, &distribution_); } InitializeProductFlags(); @@ -169,10 +169,10 @@ void MasterPreferences::InitializeFromCommandLine(const CommandLine& cmd_line) { installer::master_preferences::kAltShortcutText }, }; - std::string name(kDistroDict); + std::string name(installer::master_preferences::kDistroDict); for (int i = 0; i < arraysize(translate_switches); ++i) { if (cmd_line.HasSwitch(translate_switches[i].cmd_line_switch)) { - name.resize(arraysize(kDistroDict) - 1); + name.assign(installer::master_preferences::kDistroDict); name.append(".").append(translate_switches[i].distribution_switch); master_dictionary_->SetBoolean(name, true); } @@ -182,7 +182,7 @@ void MasterPreferences::InitializeFromCommandLine(const CommandLine& cmd_line) { std::wstring str_value(cmd_line.GetSwitchValueNative( installer::switches::kLogFile)); if (!str_value.empty()) { - name.resize(arraysize(kDistroDict) - 1); + name.assign(installer::master_preferences::kDistroDict); name.append(".").append(installer::master_preferences::kLogFile); master_dictionary_->SetString(name, str_value); } @@ -195,14 +195,15 @@ void MasterPreferences::InitializeFromCommandLine(const CommandLine& cmd_line) { env->GetVar(kGoogleUpdateIsMachineEnvVar, &is_machine_var); if (!is_machine_var.empty() && is_machine_var[0] == '1') { VLOG(1) << "Taking system-level from environment."; - name.resize(arraysize(kDistroDict) - 1); + name.assign(installer::master_preferences::kDistroDict); name.append(".").append(installer::master_preferences::kSystemLevel); master_dictionary_->SetBoolean(name, true); } } // Cache a pointer to the distribution dictionary. Ignore errors if any. - master_dictionary_->GetDictionary(kDistroDict, &distribution_); + master_dictionary_->GetDictionary(installer::master_preferences::kDistroDict, + &distribution_); InitializeProductFlags(); #endif diff --git a/chrome/installer/util/master_preferences_constants.cc b/chrome/installer/util/master_preferences_constants.cc index a59c4f2..9ab31a9 100644 --- a/chrome/installer/util/master_preferences_constants.cc +++ b/chrome/installer/util/master_preferences_constants.cc @@ -15,6 +15,7 @@ namespace master_preferences { const char kChromeShortcutIconIndex[] = "chrome_shortcut_icon_index"; const char kCreateAllShortcuts[] = "create_all_shortcuts"; const char kDisableLogging[] = "disable_logging"; + const char kDistroDict[] = "distribution"; const char kDistroImportBookmarksPref[] = "import_bookmarks"; const char kDistroImportBookmarksFromFilePref[] = "import_bookmarks_from_file"; diff --git a/chrome/installer/util/master_preferences_constants.h b/chrome/installer/util/master_preferences_constants.h index 0de206e..c8a16af 100644 --- a/chrome/installer/util/master_preferences_constants.h +++ b/chrome/installer/util/master_preferences_constants.h @@ -34,6 +34,8 @@ extern const char kChromeShortcutIconIndex[]; extern const char kCreateAllShortcuts[]; // Boolean pref that disables all logging. extern const char kDisableLogging[]; +// Name of the dictionary that holds the distribution values. +extern const char kDistroDict[]; // Boolean pref that triggers silent import of the default browser bookmarks. extern const char kDistroImportBookmarksPref[]; // String pref that triggers silent import of bookmarks from the html file at |