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

Unified Diff: chrome/browser/chromeos/login/startup_utils.cc

Issue 2870203003: Make Hands-Off Zero-Touch Enrollment compatibile with tests (Closed)
Patch Set: Created 3 years, 7 months 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
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

Powered by Google App Engine
This is Rietveld 408576698