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

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

Issue 1707733002: StartupUtils: Improve docs and move static functions to anonymous namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update docs after discussion with antrim. Created 4 years, 10 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
« no previous file with comments | « chrome/browser/chromeos/login/startup_utils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8c9a555c13cdee4d5337928bb3d675ddc7cc9f25..096c301d3e9810e0a456f2366e70f82ecb09c711 100644
--- a/chrome/browser/chromeos/login/startup_utils.cc
+++ b/chrome/browser/chromeos/login/startup_utils.cc
@@ -47,6 +47,35 @@ void SaveStringPreferenceForced(const char* pref_name,
prefs->CommitPendingWrite();
}
+// Returns the path to flag file indicating that both parts of OOBE were
+// completed.
+// On chrome device, returns /home/chronos/.oobe_completed.
+// On Linux desktop, returns {DIR_USER_DATA}/.oobe_completed.
+base::FilePath GetOobeCompleteFlagPath() {
+ // The constant is defined here so it won't be referenced directly.
+ const char kOobeCompleteFlagFilePath[] = "/home/chronos/.oobe_completed";
+
+ if (base::SysInfo::IsRunningOnChromeOS()) {
+ return base::FilePath(kOobeCompleteFlagFilePath);
+ } else {
+ base::FilePath user_data_dir;
+ PathService::Get(chrome::DIR_USER_DATA, &user_data_dir);
+ return user_data_dir.AppendASCII(".oobe_completed");
+ }
+}
+
+void CreateOobeCompleteFlagFile() {
+ // Create flag file for boot-time init scripts.
+ const base::FilePath oobe_complete_flag_path = GetOobeCompleteFlagPath();
+ if (!base::PathExists(oobe_complete_flag_path)) {
+ FILE* oobe_flag_file = base::OpenFile(oobe_complete_flag_path, "w+b");
+ if (oobe_flag_file == NULL)
+ DLOG(WARNING) << oobe_complete_flag_path.value() << " doesn't exist.";
+ else
+ base::CloseFile(oobe_flag_file);
+ }
+}
+
} // namespace
namespace chromeos {
@@ -92,23 +121,6 @@ void StartupUtils::SaveOobePendingScreen(const std::string& screen) {
SaveStringPreferenceForced(prefs::kOobeScreenPending, screen);
}
-// Returns the path to flag file indicating that both parts of OOBE were
-// completed.
-// On chrome device, returns /home/chronos/.oobe_completed.
-// On Linux desktop, returns {DIR_USER_DATA}/.oobe_completed.
-static base::FilePath GetOobeCompleteFlagPath() {
- // The constant is defined here so it won't be referenced directly.
- const char kOobeCompleteFlagFilePath[] = "/home/chronos/.oobe_completed";
-
- if (base::SysInfo::IsRunningOnChromeOS()) {
- return base::FilePath(kOobeCompleteFlagFilePath);
- } else {
- base::FilePath user_data_dir;
- PathService::Get(chrome::DIR_USER_DATA, &user_data_dir);
- return user_data_dir.AppendASCII(".oobe_completed");
- }
-}
-
// static
base::TimeDelta StartupUtils::GetTimeSinceOobeFlagFileCreation() {
const base::FilePath oobe_complete_flag_path = GetOobeCompleteFlagPath();
@@ -118,18 +130,6 @@ base::TimeDelta StartupUtils::GetTimeSinceOobeFlagFileCreation() {
return base::TimeDelta();
}
-static void CreateOobeCompleteFlagFile() {
- // Create flag file for boot-time init scripts.
- const base::FilePath oobe_complete_flag_path = GetOobeCompleteFlagPath();
- if (!base::PathExists(oobe_complete_flag_path)) {
- FILE* oobe_flag_file = base::OpenFile(oobe_complete_flag_path, "w+b");
- if (oobe_flag_file == NULL)
- DLOG(WARNING) << oobe_complete_flag_path.value() << " doesn't exist.";
- else
- base::CloseFile(oobe_flag_file);
- }
-}
-
// static
bool StartupUtils::IsDeviceRegistered() {
int value =
« no previous file with comments | « chrome/browser/chromeos/login/startup_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698