OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_USER_CROS_SETTINGS_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_USER_CROS_SETTINGS_PROVIDER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_USER_CROS_SETTINGS_PROVIDER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_USER_CROS_SETTINGS_PROVIDER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 24 matching lines...) Expand all Loading... |
35 // Methods to use when trusted (signature verified) values are required. | 35 // Methods to use when trusted (signature verified) values are required. |
36 // Return true if subsequent call to corresponding cached_* getter shall | 36 // Return true if subsequent call to corresponding cached_* getter shall |
37 // return trusted value. | 37 // return trusted value. |
38 // Return false if trusted values are unavailable at a moment. | 38 // Return false if trusted values are unavailable at a moment. |
39 // In latter case passed task will be posted when ready. | 39 // In latter case passed task will be posted when ready. |
40 bool RequestTrustedAllowGuest(Task* callback); | 40 bool RequestTrustedAllowGuest(Task* callback); |
41 bool RequestTrustedAllowNewUser(Task* callback); | 41 bool RequestTrustedAllowNewUser(Task* callback); |
42 bool RequestTrustedDataRoamingEnabled(Task* callback); | 42 bool RequestTrustedDataRoamingEnabled(Task* callback); |
43 bool RequestTrustedShowUsersOnSignin(Task* callback); | 43 bool RequestTrustedShowUsersOnSignin(Task* callback); |
44 bool RequestTrustedOwner(Task* callback); | 44 bool RequestTrustedOwner(Task* callback); |
| 45 bool RequestTrustedReportingEnabled(Task* callback); |
45 | 46 |
46 // Reloads values from device settings. | 47 // Reloads values from device settings. |
47 void Reload(); | 48 void Reload(); |
48 | 49 |
49 // Helper functions to access cached settings. | 50 // Helper functions to access cached settings. |
50 static bool cached_allow_guest(); | 51 static bool cached_allow_guest(); |
51 static bool cached_allow_new_user(); | 52 static bool cached_allow_new_user(); |
52 static bool cached_data_roaming_enabled(); | 53 static bool cached_data_roaming_enabled(); |
53 static bool cached_show_users_on_signin(); | 54 static bool cached_show_users_on_signin(); |
| 55 static bool cached_reporting_enabled(); |
54 static const base::ListValue* cached_whitelist(); | 56 static const base::ListValue* cached_whitelist(); |
55 static std::string cached_owner(); | 57 static std::string cached_owner(); |
56 | 58 |
57 // Returns true if given email is in user whitelist. | 59 // Returns true if given email is in user whitelist. |
58 // Note this function is for display purpose only and should use | 60 // Note this function is for display purpose only and should use |
59 // CheckWhitelist op for the real whitelist check. | 61 // CheckWhitelist op for the real whitelist check. |
60 static bool IsEmailInCachedWhitelist(const std::string& email); | 62 static bool IsEmailInCachedWhitelist(const std::string& email); |
61 | 63 |
62 // CrosSettingsProvider implementation. | 64 // CrosSettingsProvider implementation. |
63 virtual bool Get(const std::string& path, base::Value** out_value) const; | 65 virtual bool Get(const std::string& path, base::Value** out_value) const; |
64 virtual bool HandlesSetting(const std::string& path); | 66 virtual bool HandlesSetting(const std::string& path); |
65 | 67 |
66 void WhitelistUser(const std::string& email); | 68 void WhitelistUser(const std::string& email); |
67 void UnwhitelistUser(const std::string& email); | 69 void UnwhitelistUser(const std::string& email); |
68 | 70 |
69 // Updates cached value of the owner. | 71 // Updates cached value of the owner. |
70 static void UpdateCachedOwner(const std::string& email); | 72 static void UpdateCachedOwner(const std::string& email); |
71 | 73 |
72 private: | 74 private: |
73 // CrosSettingsProvider implementation. | 75 // CrosSettingsProvider implementation. |
74 virtual void DoSet(const std::string& path, base::Value* value); | 76 virtual void DoSet(const std::string& path, base::Value* value); |
75 | 77 |
76 DISALLOW_COPY_AND_ASSIGN(UserCrosSettingsProvider); | 78 DISALLOW_COPY_AND_ASSIGN(UserCrosSettingsProvider); |
77 }; | 79 }; |
78 | 80 |
79 } // namespace chromeos | 81 } // namespace chromeos |
80 | 82 |
81 #endif // CHROME_BROWSER_CHROMEOS_USER_CROS_SETTINGS_PROVIDER_H_ | 83 #endif // CHROME_BROWSER_CHROMEOS_USER_CROS_SETTINGS_PROVIDER_H_ |
OLD | NEW |