| 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_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_SETTINGS_CROS_SETTINGS_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_SETTINGS_CROS_SETTINGS_H_ | 6 #define CHROME_BROWSER_CHROMEOS_SETTINGS_CROS_SETTINGS_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 8 #include <string> | 9 #include <string> |
| 9 #include <vector> | 10 #include <vector> |
| 10 | 11 |
| 11 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
| 12 #include "base/callback_list.h" | 13 #include "base/callback_list.h" |
| 13 #include "base/containers/hash_tables.h" | 14 #include "base/containers/hash_tables.h" |
| 14 #include "base/macros.h" | 15 #include "base/macros.h" |
| 15 #include "base/memory/scoped_ptr.h" | |
| 16 #include "base/threading/non_thread_safe.h" | 16 #include "base/threading/non_thread_safe.h" |
| 17 #include "chromeos/settings/cros_settings_names.h" | 17 #include "chromeos/settings/cros_settings_names.h" |
| 18 #include "chromeos/settings/cros_settings_provider.h" | 18 #include "chromeos/settings/cros_settings_provider.h" |
| 19 | 19 |
| 20 namespace base { | 20 namespace base { |
| 21 class DictionaryValue; | 21 class DictionaryValue; |
| 22 class ListValue; | 22 class ListValue; |
| 23 class Value; | 23 class Value; |
| 24 } | 24 } |
| 25 | 25 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 bool FindEmailInList(const std::string& path, | 105 bool FindEmailInList(const std::string& path, |
| 106 const std::string& email, | 106 const std::string& email, |
| 107 bool* wildcard_match) const; | 107 bool* wildcard_match) const; |
| 108 | 108 |
| 109 // Adding/removing of providers. | 109 // Adding/removing of providers. |
| 110 bool AddSettingsProvider(CrosSettingsProvider* provider); | 110 bool AddSettingsProvider(CrosSettingsProvider* provider); |
| 111 bool RemoveSettingsProvider(CrosSettingsProvider* provider); | 111 bool RemoveSettingsProvider(CrosSettingsProvider* provider); |
| 112 | 112 |
| 113 // Add an observer Callback for changes for the given |path|. | 113 // Add an observer Callback for changes for the given |path|. |
| 114 typedef base::CallbackList<void(void)>::Subscription ObserverSubscription; | 114 typedef base::CallbackList<void(void)>::Subscription ObserverSubscription; |
| 115 scoped_ptr<ObserverSubscription> AddSettingsObserver( | 115 std::unique_ptr<ObserverSubscription> AddSettingsObserver( |
| 116 const std::string& path, | 116 const std::string& path, |
| 117 const base::Closure& callback); | 117 const base::Closure& callback); |
| 118 | 118 |
| 119 // Returns the provider that handles settings with the |path| or prefix. | 119 // Returns the provider that handles settings with the |path| or prefix. |
| 120 CrosSettingsProvider* GetProvider(const std::string& path) const; | 120 CrosSettingsProvider* GetProvider(const std::string& path) const; |
| 121 | 121 |
| 122 private: | 122 private: |
| 123 friend class CrosSettingsTest; | 123 friend class CrosSettingsTest; |
| 124 | 124 |
| 125 // Fires system setting change callback. | 125 // Fires system setting change callback. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 144 ScopedTestCrosSettings(); | 144 ScopedTestCrosSettings(); |
| 145 ~ScopedTestCrosSettings(); | 145 ~ScopedTestCrosSettings(); |
| 146 | 146 |
| 147 private: | 147 private: |
| 148 DISALLOW_COPY_AND_ASSIGN(ScopedTestCrosSettings); | 148 DISALLOW_COPY_AND_ASSIGN(ScopedTestCrosSettings); |
| 149 }; | 149 }; |
| 150 | 150 |
| 151 } // namespace chromeos | 151 } // namespace chromeos |
| 152 | 152 |
| 153 #endif // CHROME_BROWSER_CHROMEOS_SETTINGS_CROS_SETTINGS_H_ | 153 #endif // CHROME_BROWSER_CHROMEOS_SETTINGS_CROS_SETTINGS_H_ |
| OLD | NEW |