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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_STARTUP_UTILS_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_STARTUP_UTILS_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_STARTUP_UTILS_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_STARTUP_UTILS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 | 11 |
12 class PrefRegistrySimple; | 12 class PrefRegistrySimple; |
13 | 13 |
14 namespace base { | 14 namespace base { |
15 class TimeDelta; | 15 class TimeDelta; |
16 } | 16 } |
17 | 17 |
18 namespace chromeos { | 18 namespace chromeos { |
19 | 19 |
20 // Static utility methods used at startup time to get/change bits of device | 20 // Static utility methods used at startup time to get/change bits of device |
21 // state. | 21 // state. |
22 class StartupUtils { | 22 class StartupUtils { |
23 public: | 23 public: |
24 // Returns true if EULA has been accepted. | 24 // Returns true if EULA has been accepted. |
25 static bool IsEulaAccepted(); | 25 static bool IsEulaAccepted(); |
26 | 26 |
27 // Returns OOBE completion status. | 27 // Returns OOBE completion status, i.e. whether the OOBE wizard should be run |
| 28 // on next boot. This is NOT what causes the .oobe_completed flag file to be |
| 29 // written. |
28 static bool IsOobeCompleted(); | 30 static bool IsOobeCompleted(); |
29 | 31 |
30 // Marks EULA status as accepted. | 32 // Marks EULA status as accepted. |
31 static void MarkEulaAccepted(); | 33 static void MarkEulaAccepted(); |
32 | 34 |
33 // Marks OOBE process as completed. | 35 // Marks OOBE process as completed. |
34 static void MarkOobeCompleted(); | 36 static void MarkOobeCompleted(); |
35 | 37 |
36 // Stores the next pending OOBE screen in case it will need to be resumed. | 38 // Stores the next pending OOBE screen in case it will need to be resumed. |
37 static void SaveOobePendingScreen(const std::string& screen); | 39 static void SaveOobePendingScreen(const std::string& screen); |
38 | 40 |
39 // Returns the time since the Oobe flag file was created. | 41 // Returns the time since the OOBE flag file was created. |
40 static base::TimeDelta GetTimeSinceOobeFlagFileCreation(); | 42 static base::TimeDelta GetTimeSinceOobeFlagFileCreation(); |
41 | 43 |
42 // Returns device registration completion status, i.e. second part of OOBE. | 44 // Returns device registration completion status, i.e. second part of OOBE. |
| 45 // It is triggered by enrolling the device, but also by logging in as a |
| 46 // consumer owner or by logging in as guest. This state change is announced |
| 47 // to the system by writing the .oobe_completed flag file. |
43 static bool IsDeviceRegistered(); | 48 static bool IsDeviceRegistered(); |
44 | 49 |
45 // Marks device registered. i.e. second part of OOBE is completed. | 50 // Marks device registered. i.e. second part of OOBE is completed. |
46 static void MarkDeviceRegistered(const base::Closure& done_callback); | 51 static void MarkDeviceRegistered(const base::Closure& done_callback); |
47 | 52 |
48 // Mark a device as requiring enrollment recovery. | 53 // Mark a device as requiring enrollment recovery. |
49 static void MarkEnrollmentRecoveryRequired(); | 54 static void MarkEnrollmentRecoveryRequired(); |
50 | 55 |
51 // Returns initial locale from local settings. | 56 // Returns initial locale from local settings. |
52 static std::string GetInitialLocale(); | 57 static std::string GetInitialLocale(); |
53 | 58 |
54 // Sets initial locale in local settings. | 59 // Sets initial locale in local settings. |
55 static void SetInitialLocale(const std::string& locale); | 60 static void SetInitialLocale(const std::string& locale); |
56 | 61 |
57 // Returns true if webview based signin flow has been activated. | 62 // Returns true if webview based signin flow has been activated. |
58 static bool IsWebviewSigninEnabled(); | 63 static bool IsWebviewSigninEnabled(); |
59 | 64 |
60 // Registers OOBE preferences. | 65 // Registers OOBE preferences. |
61 static void RegisterPrefs(PrefRegistrySimple* registry); | 66 static void RegisterPrefs(PrefRegistrySimple* registry); |
62 }; | 67 }; |
63 | 68 |
64 } // namespace chromeos | 69 } // namespace chromeos |
65 | 70 |
66 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_STARTUP_UTILS_H_ | 71 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_STARTUP_UTILS_H_ |
OLD | NEW |