OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_SYNC_TEST_LIVE_SYNC_PREFERENCES_HELPER_H_ | |
6 #define CHROME_BROWSER_SYNC_TEST_LIVE_SYNC_PREFERENCES_HELPER_H_ | |
7 #pragma once | |
8 | |
9 #include "base/file_path.h" | |
10 #include "base/values.h" | |
11 | |
12 #include <string> | |
13 | |
14 class PrefService; | |
15 | |
16 namespace preferences_helper { | |
17 | |
18 // Used to access the preferences within a particular sync profile. | |
19 PrefService* GetPrefs(int index); | |
20 | |
21 // Used to access the preferences within the verifier sync profile. | |
22 PrefService* GetVerifierPrefs(); | |
23 | |
24 // Inverts the value of the boolean preference with name |pref_name| in the | |
25 // profile with index |index|. Also inverts its value in |verifier| if | |
26 // DisableVerifier() hasn't been called. | |
27 void ChangeBooleanPref(int index, const char* pref_name); | |
28 | |
29 // Changes the value of the integer preference with name |pref_name| in the | |
30 // profile with index |index| to |new_value|. Also changes its value in | |
31 // |verifier| if DisableVerifier() hasn't been called. | |
32 void ChangeIntegerPref(int index, const char* pref_name, int new_value); | |
33 | |
34 // Changes the value of the double preference with name |pref_name| in the | |
35 // profile with index |index| to |new_value|. Also changes its value in | |
36 // |verifier| if DisableVerifier() hasn't been called. | |
37 void ChangeDoublePref(int index, const char* pref_name, double new_value); | |
38 | |
39 // Changes the value of the string preference with name |pref_name| in the | |
40 // profile with index |index| to |new_value|. Also changes its value in | |
41 // |verifier| if DisableVerifier() hasn't been called. | |
42 void ChangeStringPref(int index, | |
43 const char* pref_name, | |
44 const std::string& new_value); | |
45 | |
46 // Modifies the value of the string preference with name |pref_name| in the | |
47 // profile with index |index| by appending |append_value| to its current | |
48 // value. Also changes its value in |verifier| if DisableVerifier() hasn't | |
49 // been called. | |
50 void AppendStringPref(int index, | |
51 const char* pref_name, | |
52 const std::string& append_value); | |
53 | |
54 // Changes the value of the file path preference with name |pref_name| in the | |
55 // profile with index |index| to |new_value|. Also changes its value in | |
56 // |verifier| if DisableVerifier() hasn't been called. | |
57 void ChangeFilePathPref(int index, | |
58 const char* pref_name, | |
59 const FilePath& new_value); | |
60 | |
61 // Changes the value of the list preference with name |pref_name| in the | |
62 // profile with index |index| to |new_value|. Also changes its value in | |
63 // |verifier| if DisableVerifier() hasn't been called. | |
64 void ChangeListPref(int index, | |
65 const char* pref_name, | |
66 const ListValue& new_value); | |
67 | |
68 // Used to verify that the boolean preference with name |pref_name| has the | |
69 // same value across all profiles. Also checks |verifier| if DisableVerifier() | |
70 // hasn't been called. | |
71 bool BooleanPrefMatches(const char* pref_name) WARN_UNUSED_RESULT; | |
72 | |
73 // Used to verify that the integer preference with name |pref_name| has the | |
74 // same value across all profiles. Also checks |verifier| if DisableVerifier() | |
75 // hasn't been called. | |
76 bool IntegerPrefMatches(const char* pref_name) WARN_UNUSED_RESULT; | |
77 | |
78 // Used to verify that the double preference with name |pref_name| has the | |
79 // same value across all profiles. Also checks |verifier| if DisableVerifier() | |
80 // hasn't been called. | |
81 bool DoublePrefMatches(const char* pref_name) WARN_UNUSED_RESULT; | |
82 | |
83 // Used to verify that the string preference with name |pref_name| has the | |
84 // same value across all profiles. Also checks |verifier| if DisableVerifier() | |
85 // hasn't been called. | |
86 bool StringPrefMatches(const char* pref_name) WARN_UNUSED_RESULT; | |
87 | |
88 // Used to verify that the file path preference with name |pref_name| has the | |
89 // same value across all profiles. Also checks |verifier| if DisableVerifier() | |
90 // hasn't been called. | |
91 bool FilePathPrefMatches(const char* pref_name) WARN_UNUSED_RESULT; | |
92 | |
93 // Used to verify that the list preference with name |pref_name| has the | |
94 // same value across all profiles. Also checks |verifier| if DisableVerifier() | |
95 // hasn't been called. | |
96 bool ListPrefMatches(const char* pref_name) WARN_UNUSED_RESULT; | |
97 | |
98 } // namespace preferences_helper | |
99 | |
100 #endif // CHROME_BROWSER_SYNC_TEST_LIVE_SYNC_PREFERENCES_HELPER_H_ | |
OLD | NEW |