Chromium Code Reviews| Index: chrome/browser/chromeos/login/startup_utils.cc |
| diff --git a/chrome/browser/chromeos/login/startup_utils.cc b/chrome/browser/chromeos/login/startup_utils.cc |
| index b85797e8db2a03d06463ecdd30fe6be0c9f56e23..c2561e86b39b5dfadc9200d2a2cb4e578bbddfbc 100644 |
| --- a/chrome/browser/chromeos/login/startup_utils.cc |
| +++ b/chrome/browser/chromeos/login/startup_utils.cc |
| @@ -39,6 +39,14 @@ void SaveIntegerPreferenceForced(const char* pref_name, int value) { |
| prefs->CommitPendingWrite(); |
| } |
| +// Saves 64 bit signed integer "Local State" preference and forces its |
| +// persistence to disk. |
| +void SaveInt64PreferenceForced(const char* pref_name, int64_t value) { |
| + PrefService* prefs = g_browser_process->local_state(); |
| + prefs->SetInt64(pref_name, value); |
| + prefs->CommitPendingWrite(); |
| +} |
| + |
| // Saves string "Local State" preference and forces its persistence to disk. |
| void SaveStringPreferenceForced(const char* pref_name, |
| const std::string& value) { |
| @@ -198,4 +206,17 @@ void StartupUtils::SetInitialLocale(const std::string& locale) { |
| NOTREACHED(); |
| } |
| +// static |
| +void StartupUtils::SaveTimeOfLastUpdateCheckWithoutUpdate(base::Time time) { |
| + SaveInt64PreferenceForced(prefs::kTimeOfLastUpdateCheckWithoutUpdate, |
|
xiyuan
2017/05/09 22:03:52
Where is kTimeOfLastUpdateCheckWithoutUpdate defin
kumarniranjan
2017/05/09 22:49:47
Done.
|
| + time->ToInternalvalue()); |
| +} |
| + |
| +// static |
| +base::Time StartupUtils::GetTimeOfLastUpdateCheckWithoutUpdate() { |
| + return base::Time::FromInternalValue( |
| + g_browser_process->local_state()->GetInt64( |
| + prefs::kTimeOfLastUpdateCheckWithoutUpdate)); |
| +} |
| + |
| } // namespace chromeos |