| 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_SETTINGS_CROS_SETTINGS_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_SETTINGS_CROS_SETTINGS_PROVIDER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_SETTINGS_CROS_SETTINGS_PROVIDER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_SETTINGS_CROS_SETTINGS_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 // are trusted during the current loop cycle. Otherwise returns | 51 // are trusted during the current loop cycle. Otherwise returns |
| 52 // TEMPORARILY_UNTRUSTED, and |callback| will be invoked later when trusted | 52 // TEMPORARILY_UNTRUSTED, and |callback| will be invoked later when trusted |
| 53 // values become available, PrepareTrustedValues() should be tried again in | 53 // values become available, PrepareTrustedValues() should be tried again in |
| 54 // that case. Returns PERMANENTLY_UNTRUSTED if a permanent error has occurred. | 54 // that case. Returns PERMANENTLY_UNTRUSTED if a permanent error has occurred. |
| 55 virtual TrustedStatus PrepareTrustedValues( | 55 virtual TrustedStatus PrepareTrustedValues( |
| 56 const base::Closure& callback) = 0; | 56 const base::Closure& callback) = 0; |
| 57 | 57 |
| 58 // Gets the namespace prefix provided by this provider. | 58 // Gets the namespace prefix provided by this provider. |
| 59 virtual bool HandlesSetting(const std::string& path) const = 0; | 59 virtual bool HandlesSetting(const std::string& path) const = 0; |
| 60 | 60 |
| 61 // Reloads the caches if the provider has any. | |
| 62 virtual void Reload() = 0; | |
| 63 | |
| 64 void SetNotifyObserversCallback(const NotifyObserversCallback& notify_cb); | 61 void SetNotifyObserversCallback(const NotifyObserversCallback& notify_cb); |
| 65 | 62 |
| 66 protected: | 63 protected: |
| 67 // Notifies the observers about a setting change. | 64 // Notifies the observers about a setting change. |
| 68 void NotifyObservers(const std::string& path); | 65 void NotifyObservers(const std::string& path); |
| 69 | 66 |
| 70 private: | 67 private: |
| 71 // Does the real job for Set(). | 68 // Does the real job for Set(). |
| 72 virtual void DoSet(const std::string& path, | 69 virtual void DoSet(const std::string& path, |
| 73 const base::Value& in_value) = 0; | 70 const base::Value& in_value) = 0; |
| 74 | 71 |
| 75 // Callback used to notify about setting changes. | 72 // Callback used to notify about setting changes. |
| 76 NotifyObserversCallback notify_cb_; | 73 NotifyObserversCallback notify_cb_; |
| 77 }; | 74 }; |
| 78 | 75 |
| 79 } // namespace chromeos | 76 } // namespace chromeos |
| 80 | 77 |
| 81 #endif // CHROME_BROWSER_CHROMEOS_SETTINGS_CROS_SETTINGS_PROVIDER_H_ | 78 #endif // CHROME_BROWSER_CHROMEOS_SETTINGS_CROS_SETTINGS_PROVIDER_H_ |
| OLD | NEW |