| 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 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "chrome/browser/profiles/profile.h" | |
| 15 #include "chrome/common/extensions/api/settings_private.h" | 14 #include "chrome/common/extensions/api/settings_private.h" |
| 16 #include "components/keyed_service/core/keyed_service.h" | 15 #include "components/keyed_service/core/keyed_service.h" |
| 17 #include "extensions/browser/extension_function.h" | 16 #include "extensions/browser/extension_function.h" |
| 18 | 17 |
| 19 class Profile; | 18 class Profile; |
| 20 | 19 |
| 21 namespace base { | 20 namespace base { |
| 22 class Value; | 21 class Value; |
| 23 } | 22 } |
| 24 | 23 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 37 // Sets the pref with the given name and value in the proper PrefService. | 36 // 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); | 37 virtual bool SetPref(const std::string& name, const base::Value* value); |
| 39 | 38 |
| 40 // Gets the value of the pref with the given |name|. | 39 // Gets the value of the pref with the given |name|. |
| 41 virtual scoped_ptr<base::Value> GetPref(const std::string& name); | 40 virtual scoped_ptr<base::Value> GetPref(const std::string& name); |
| 42 | 41 |
| 43 // Gets the values of all whitelisted prefs. | 42 // Gets the values of all whitelisted prefs. |
| 44 virtual scoped_ptr<base::Value> GetAllPrefs(); | 43 virtual scoped_ptr<base::Value> GetAllPrefs(); |
| 45 | 44 |
| 46 private: | 45 private: |
| 47 PrefService* FindServiceForPref(const std::string& pref_name); | |
| 48 | |
| 49 Profile* profile_; // weak; not owned by us | 46 Profile* profile_; // weak; not owned by us |
| 50 | 47 |
| 51 DISALLOW_COPY_AND_ASSIGN(SettingsPrivateDelegate); | 48 DISALLOW_COPY_AND_ASSIGN(SettingsPrivateDelegate); |
| 52 }; | 49 }; |
| 53 | 50 |
| 54 } // namespace extensions | 51 } // namespace extensions |
| 55 | 52 |
| 56 #endif // CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_SETTINGS_PRIVATE_DELEG
ATE_H_ | 53 #endif // CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_SETTINGS_PRIVATE_DELEG
ATE_H_ |
| OLD | NEW |