| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_EXTENSIONS_API_SETTINGS_PRIVATE_SETTINGS_PRIVATE_DELEGATE
_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_SETTINGS_PRIVATE_DELEGATE
_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_SETTINGS_PRIVATE_DELEGATE
_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_SETTINGS_PRIVATE_DELEGATE
_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 // Manages all the pref service interactions. | 29 // Manages all the pref service interactions. |
| 30 // Use SettingsPrivateDelegateFactory to create a SettingsPrivateDelegate | 30 // Use SettingsPrivateDelegateFactory to create a SettingsPrivateDelegate |
| 31 // object. | 31 // object. |
| 32 class SettingsPrivateDelegate : public KeyedService { | 32 class SettingsPrivateDelegate : public KeyedService { |
| 33 public: | 33 public: |
| 34 explicit SettingsPrivateDelegate(Profile* profile); | 34 explicit SettingsPrivateDelegate(Profile* profile); |
| 35 ~SettingsPrivateDelegate() override; | 35 ~SettingsPrivateDelegate() override; |
| 36 | 36 |
| 37 // Sets the pref with the given name and value in the proper PrefService. | 37 // Sets the pref with the given name and value in the proper PrefService. |
| 38 virtual bool SetPref(const std::string& name, const base::Value* value); | 38 virtual PrefsUtil::SetPrefResult SetPref( |
| 39 const std::string& name, const base::Value* value); |
| 39 | 40 |
| 40 // Gets the value of the pref with the given |name|. | 41 // Gets the value of the pref with the given |name|. |
| 41 virtual scoped_ptr<base::Value> GetPref(const std::string& name); | 42 virtual scoped_ptr<base::Value> GetPref(const std::string& name); |
| 42 | 43 |
| 43 // Gets the values of all whitelisted prefs. | 44 // Gets the values of all whitelisted prefs. |
| 44 virtual scoped_ptr<base::Value> GetAllPrefs(); | 45 virtual scoped_ptr<base::Value> GetAllPrefs(); |
| 45 | 46 |
| 46 protected: | 47 protected: |
| 47 Profile* profile_; // weak; not owned by us | 48 Profile* profile_; // weak; not owned by us |
| 48 scoped_ptr<PrefsUtil> prefs_util_; | 49 scoped_ptr<PrefsUtil> prefs_util_; |
| 49 | 50 |
| 50 private: | 51 private: |
| 51 DISALLOW_COPY_AND_ASSIGN(SettingsPrivateDelegate); | 52 DISALLOW_COPY_AND_ASSIGN(SettingsPrivateDelegate); |
| 52 }; | 53 }; |
| 53 | 54 |
| 54 } // namespace extensions | 55 } // namespace extensions |
| 55 | 56 |
| 56 #endif // CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_SETTINGS_PRIVATE_DELEG
ATE_H_ | 57 #endif // CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_SETTINGS_PRIVATE_DELEG
ATE_H_ |
| OLD | NEW |