| 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 =
|
|
|