| 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); | |
| 46 | 45 |
| 47 // Reloads values from device settings. | 46 // Reloads values from device settings. |
| 48 void Reload(); | 47 void Reload(); |
| 49 | 48 |
| 50 // Helper functions to access cached settings. | 49 // Helper functions to access cached settings. |
| 51 static bool cached_allow_guest(); | 50 static bool cached_allow_guest(); |
| 52 static bool cached_allow_new_user(); | 51 static bool cached_allow_new_user(); |
| 53 static bool cached_data_roaming_enabled(); | 52 static bool cached_data_roaming_enabled(); |
| 54 static bool cached_show_users_on_signin(); | 53 static bool cached_show_users_on_signin(); |
| 55 static bool cached_reporting_enabled(); | |
| 56 static const base::ListValue* cached_whitelist(); | 54 static const base::ListValue* cached_whitelist(); |
| 57 static std::string cached_owner(); | 55 static std::string cached_owner(); |
| 58 | 56 |
| 59 // Returns true if given email is in user whitelist. | 57 // Returns true if given email is in user whitelist. |
| 60 // Note this function is for display purpose only and should use | 58 // Note this function is for display purpose only and should use |
| 61 // CheckWhitelist op for the real whitelist check. | 59 // CheckWhitelist op for the real whitelist check. |
| 62 static bool IsEmailInCachedWhitelist(const std::string& email); | 60 static bool IsEmailInCachedWhitelist(const std::string& email); |
| 63 | 61 |
| 64 // CrosSettingsProvider implementation. | 62 // CrosSettingsProvider implementation. |
| 65 virtual bool Get(const std::string& path, base::Value** out_value) const; | 63 virtual bool Get(const std::string& path, base::Value** out_value) const; |
| 66 virtual bool HandlesSetting(const std::string& path); | 64 virtual bool HandlesSetting(const std::string& path); |
| 67 | 65 |
| 68 void WhitelistUser(const std::string& email); | 66 void WhitelistUser(const std::string& email); |
| 69 void UnwhitelistUser(const std::string& email); | 67 void UnwhitelistUser(const std::string& email); |
| 70 | 68 |
| 71 // Updates cached value of the owner. | 69 // Updates cached value of the owner. |
| 72 static void UpdateCachedOwner(const std::string& email); | 70 static void UpdateCachedOwner(const std::string& email); |
| 73 | 71 |
| 74 private: | 72 private: |
| 75 // CrosSettingsProvider implementation. | 73 // CrosSettingsProvider implementation. |
| 76 virtual void DoSet(const std::string& path, base::Value* value); | 74 virtual void DoSet(const std::string& path, base::Value* value); |
| 77 | 75 |
| 78 DISALLOW_COPY_AND_ASSIGN(UserCrosSettingsProvider); | 76 DISALLOW_COPY_AND_ASSIGN(UserCrosSettingsProvider); |
| 79 }; | 77 }; |
| 80 | 78 |
| 81 } // namespace chromeos | 79 } // namespace chromeos |
| 82 | 80 |
| 83 #endif // CHROME_BROWSER_CHROMEOS_USER_CROS_SETTINGS_PROVIDER_H_ | 81 #endif // CHROME_BROWSER_CHROMEOS_USER_CROS_SETTINGS_PROVIDER_H_ |
| OLD | NEW |