| 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_SERVICE_SERVICE_PROCESS_PREFS_H_ | 5 #ifndef CHROME_SERVICE_SERVICE_PROCESS_PREFS_H_ |
| 6 #define CHROME_SERVICE_SERVICE_PROCESS_PREFS_H_ | 6 #define CHROME_SERVICE_SERVICE_PROCESS_PREFS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "chrome/common/json_pref_store.h" | 10 #include "chrome/common/json_pref_store.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 base::MessageLoopProxy* file_message_loop_proxy); | 23 base::MessageLoopProxy* file_message_loop_proxy); |
| 24 ~ServiceProcessPrefs(); | 24 ~ServiceProcessPrefs(); |
| 25 | 25 |
| 26 // Read preferences from the backing file. | 26 // Read preferences from the backing file. |
| 27 void ReadPrefs(); | 27 void ReadPrefs(); |
| 28 | 28 |
| 29 // Write the data to the backing file. | 29 // Write the data to the backing file. |
| 30 void WritePrefs(); | 30 void WritePrefs(); |
| 31 | 31 |
| 32 // Get a string preference for |key| and store it in |result|. | 32 // Get a string preference for |key| and store it in |result|. |
| 33 void GetString(const std::string& key, std::string* result); | 33 void GetString(const std::string& key, std::string* result) const; |
| 34 | 34 |
| 35 // Set a string |value| for |key|. | 35 // Set a string |value| for |key|. |
| 36 void SetString(const std::string& key, const std::string& value); | 36 void SetString(const std::string& key, const std::string& value); |
| 37 | 37 |
| 38 // Get a boolean preference for |key| and store it in |result|. | 38 // Get a boolean preference for |key| and store it in |result|. |
| 39 void GetBoolean(const std::string& key, bool* result); | 39 void GetBoolean(const std::string& key, bool* result) const; |
| 40 | 40 |
| 41 // Set a boolean |value| for |key|. | 41 // Set a boolean |value| for |key|. |
| 42 void SetBoolean(const std::string& key, bool value); | 42 void SetBoolean(const std::string& key, bool value); |
| 43 | 43 |
| 44 // Get a dictionary preference for |key| and store it in |result|. | 44 // Get a dictionary preference for |key| and store it in |result|. |
| 45 void GetDictionary(const std::string& key, | 45 void GetDictionary(const std::string& key, |
| 46 const base::DictionaryValue** result); | 46 const base::DictionaryValue** result) const; |
| 47 | 47 |
| 48 // Removes the pref specified by |key|. | 48 // Removes the pref specified by |key|. |
| 49 void RemovePref(const std::string& key); | 49 void RemovePref(const std::string& key); |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 scoped_refptr<JsonPrefStore> prefs_; | 52 scoped_refptr<JsonPrefStore> prefs_; |
| 53 | 53 |
| 54 DISALLOW_COPY_AND_ASSIGN(ServiceProcessPrefs); | 54 DISALLOW_COPY_AND_ASSIGN(ServiceProcessPrefs); |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 #endif // CHROME_SERVICE_SERVICE_PROCESS_PREFS_H_ | 57 #endif // CHROME_SERVICE_SERVICE_PROCESS_PREFS_H_ |
| OLD | NEW |