| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_PREFS_PREF_VALUE_MAP_H_ | 5 #ifndef CHROME_BROWSER_PREFS_PREF_VALUE_MAP_H_ |
| 6 #define CHROME_BROWSER_PREFS_PREF_VALUE_MAP_H_ | 6 #define CHROME_BROWSER_PREFS_PREF_VALUE_MAP_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 // non-NULL. Returns true if the value changed. | 35 // non-NULL. Returns true if the value changed. |
| 36 bool SetValue(const std::string& key, base::Value* value); | 36 bool SetValue(const std::string& key, base::Value* value); |
| 37 | 37 |
| 38 // Removes the value for |key| from the map. Returns true if a value was | 38 // Removes the value for |key| from the map. Returns true if a value was |
| 39 // removed. | 39 // removed. |
| 40 bool RemoveValue(const std::string& key); | 40 bool RemoveValue(const std::string& key); |
| 41 | 41 |
| 42 // Clears the map. | 42 // Clears the map. |
| 43 void Clear(); | 43 void Clear(); |
| 44 | 44 |
| 45 // Swaps the contents of two maps. |
| 46 void Swap(PrefValueMap* other); |
| 47 |
| 45 iterator begin(); | 48 iterator begin(); |
| 46 iterator end(); | 49 iterator end(); |
| 47 const_iterator begin() const; | 50 const_iterator begin() const; |
| 48 const_iterator end() const; | 51 const_iterator end() const; |
| 49 | 52 |
| 50 // Gets a boolean value for |key| and stores it in |value|. Returns true if | 53 // Gets a boolean value for |key| and stores it in |value|. Returns true if |
| 51 // the value was found and of the proper type. | 54 // the value was found and of the proper type. |
| 52 bool GetBoolean(const std::string& key, bool* value) const; | 55 bool GetBoolean(const std::string& key, bool* value) const; |
| 53 | 56 |
| 54 // Sets the value for |key| to the boolean |value|. | 57 // Sets the value for |key| to the boolean |value|. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 76 | 79 |
| 77 private: | 80 private: |
| 78 typedef std::map<std::string, base::Value*> Map; | 81 typedef std::map<std::string, base::Value*> Map; |
| 79 | 82 |
| 80 Map prefs_; | 83 Map prefs_; |
| 81 | 84 |
| 82 DISALLOW_COPY_AND_ASSIGN(PrefValueMap); | 85 DISALLOW_COPY_AND_ASSIGN(PrefValueMap); |
| 83 }; | 86 }; |
| 84 | 87 |
| 85 #endif // CHROME_BROWSER_PREFS_PREF_VALUE_MAP_H_ | 88 #endif // CHROME_BROWSER_PREFS_PREF_VALUE_MAP_H_ |
| OLD | NEW |