| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 COMPONENTS_TEST_RUNNER_TRACKED_DICTIONARY_H_ | 5 #ifndef COMPONENTS_TEST_RUNNER_TRACKED_DICTIONARY_H_ |
| 6 #define COMPONENTS_TEST_RUNNER_TRACKED_DICTIONARY_H_ | 6 #define COMPONENTS_TEST_RUNNER_TRACKED_DICTIONARY_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 // Overwrites |current_values| with values present in |new_changes|. | 38 // Overwrites |current_values| with values present in |new_changes|. |
| 39 // The new values are not present in |changed_values| afterwards. | 39 // The new values are not present in |changed_values| afterwards. |
| 40 void ApplyUntrackedChanges(const base::DictionaryValue& new_changes); | 40 void ApplyUntrackedChanges(const base::DictionaryValue& new_changes); |
| 41 | 41 |
| 42 // Sets a value in |current_values| and tracks the change in |changed_values|. | 42 // Sets a value in |current_values| and tracks the change in |changed_values|. |
| 43 void Set(const std::string& path, scoped_ptr<base::Value> new_value); | 43 void Set(const std::string& path, scoped_ptr<base::Value> new_value); |
| 44 | 44 |
| 45 // Type-specific setter for convenience. | 45 // Type-specific setter for convenience. |
| 46 void SetBoolean(const std::string& path, bool new_value); | 46 void SetBoolean(const std::string& path, bool new_value); |
| 47 void SetString(const std::string& path, const std::string& new_value); |
| 47 | 48 |
| 48 private: | 49 private: |
| 49 base::DictionaryValue current_values_; | 50 base::DictionaryValue current_values_; |
| 50 base::DictionaryValue changed_values_; | 51 base::DictionaryValue changed_values_; |
| 51 | 52 |
| 52 DISALLOW_COPY_AND_ASSIGN(TrackedDictionary); | 53 DISALLOW_COPY_AND_ASSIGN(TrackedDictionary); |
| 53 }; | 54 }; |
| 54 | 55 |
| 55 } // namespace test_runner | 56 } // namespace test_runner |
| 56 | 57 |
| 57 #endif // COMPONENTS_TEST_RUNNER_TRACKED_DICTIONARY_H_ | 58 #endif // COMPONENTS_TEST_RUNNER_TRACKED_DICTIONARY_H_ |
| OLD | NEW |