OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/login/startup_utils.h" | 5 #include "chrome/browser/chromeos/login/startup_utils.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/prefs/pref_registry_simple.h" | 10 #include "base/prefs/pref_registry_simple.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 base::FilePath user_data_dir; | 88 base::FilePath user_data_dir; |
89 PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); | 89 PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); |
90 return user_data_dir.AppendASCII(".oobe_completed"); | 90 return user_data_dir.AppendASCII(".oobe_completed"); |
91 } | 91 } |
92 } | 92 } |
93 | 93 |
94 static void CreateOobeCompleteFlagFile() { | 94 static void CreateOobeCompleteFlagFile() { |
95 // Create flag file for boot-time init scripts. | 95 // Create flag file for boot-time init scripts. |
96 base::FilePath oobe_complete_path = GetOobeCompleteFlagPath(); | 96 base::FilePath oobe_complete_path = GetOobeCompleteFlagPath(); |
97 if (!base::PathExists(oobe_complete_path)) { | 97 if (!base::PathExists(oobe_complete_path)) { |
98 FILE* oobe_flag_file = base::OpenFile(oobe_complete_path, "w+b"); | 98 FILE* oobe_flag_file = file_util::OpenFile(oobe_complete_path, "w+b"); |
99 if (oobe_flag_file == NULL) | 99 if (oobe_flag_file == NULL) |
100 DLOG(WARNING) << oobe_complete_path.value() << " doesn't exist."; | 100 DLOG(WARNING) << oobe_complete_path.value() << " doesn't exist."; |
101 else | 101 else |
102 base::CloseFile(oobe_flag_file); | 102 file_util::CloseFile(oobe_flag_file); |
103 } | 103 } |
104 } | 104 } |
105 | 105 |
106 // static | 106 // static |
107 bool StartupUtils::IsDeviceRegistered() { | 107 bool StartupUtils::IsDeviceRegistered() { |
108 int value = | 108 int value = |
109 g_browser_process->local_state()->GetInteger(prefs::kDeviceRegistered); | 109 g_browser_process->local_state()->GetInteger(prefs::kDeviceRegistered); |
110 if (value > 0) { | 110 if (value > 0) { |
111 // Recreate flag file in case it was lost. | 111 // Recreate flag file in case it was lost. |
112 BrowserThread::PostTask( | 112 BrowserThread::PostTask( |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 | 147 |
148 // static | 148 // static |
149 void StartupUtils::SetInitialLocale(const std::string& locale) { | 149 void StartupUtils::SetInitialLocale(const std::string& locale) { |
150 if (l10n_util::IsValidLocaleSyntax(locale)) | 150 if (l10n_util::IsValidLocaleSyntax(locale)) |
151 SaveStringPreferenceForced(prefs::kInitialLocale, locale); | 151 SaveStringPreferenceForced(prefs::kInitialLocale, locale); |
152 else | 152 else |
153 NOTREACHED(); | 153 NOTREACHED(); |
154 } | 154 } |
155 | 155 |
156 } // namespace chromeos | 156 } // namespace chromeos |
OLD | NEW |