Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: chrome/browser/api/prefs/pref_member.h

Issue 10857031: Move PrefMember and PrefChangeRegistrar to api directory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to parent Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 // A helper class that stays in sync with a preference (bool, int, real, 5 // A helper class that stays in sync with a preference (bool, int, real,
6 // string or filepath). For example: 6 // string or filepath). For example:
7 // 7 //
8 // class MyClass { 8 // class MyClass {
9 // public: 9 // public:
10 // MyClass(PrefService* prefs) { 10 // MyClass(PrefService* prefs) {
11 // my_string_.Init(prefs::kHomePage, prefs, NULL /* no observer */); 11 // my_string_.Init(prefs::kHomePage, prefs, NULL /* no observer */);
12 // } 12 // }
13 // private: 13 // private:
14 // StringPrefMember my_string_; 14 // StringPrefMember my_string_;
15 // }; 15 // };
16 // 16 //
17 // my_string_ should stay in sync with the prefs::kHomePage pref and will 17 // my_string_ should stay in sync with the prefs::kHomePage pref and will
18 // update if either the pref changes or if my_string_.SetValue is called. 18 // update if either the pref changes or if my_string_.SetValue is called.
19 // 19 //
20 // An optional observer can be passed into the Init method which can be used to 20 // An optional observer can be passed into the Init method which can be used to
21 // notify MyClass of changes. Note that if you use SetValue(), the observer 21 // notify MyClass of changes. Note that if you use SetValue(), the observer
22 // will not be notified. 22 // will not be notified.
23 23
24 #ifndef CHROME_BROWSER_PREFS_PREF_MEMBER_H_ 24 #ifndef CHROME_BROWSER_API_PREFS_PREF_MEMBER_H_
25 #define CHROME_BROWSER_PREFS_PREF_MEMBER_H_ 25 #define CHROME_BROWSER_API_PREFS_PREF_MEMBER_H_
26 26
27 #include <string> 27 #include <string>
28 28
29 #include "base/basictypes.h" 29 #include "base/basictypes.h"
30 #include "base/file_path.h" 30 #include "base/file_path.h"
31 #include "base/logging.h" 31 #include "base/logging.h"
32 #include "base/memory/ref_counted.h" 32 #include "base/memory/ref_counted.h"
33 #include "base/values.h" 33 #include "base/values.h"
34 #include "content/public/browser/browser_thread.h" 34 #include "content/public/browser/browser_thread.h"
35 #include "content/public/browser/notification_observer.h" 35 #include "content/public/browser/notification_observer.h"
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 238
239 DISALLOW_COPY_AND_ASSIGN(PrefMember); 239 DISALLOW_COPY_AND_ASSIGN(PrefMember);
240 }; 240 };
241 241
242 typedef PrefMember<bool> BooleanPrefMember; 242 typedef PrefMember<bool> BooleanPrefMember;
243 typedef PrefMember<int> IntegerPrefMember; 243 typedef PrefMember<int> IntegerPrefMember;
244 typedef PrefMember<double> DoublePrefMember; 244 typedef PrefMember<double> DoublePrefMember;
245 typedef PrefMember<std::string> StringPrefMember; 245 typedef PrefMember<std::string> StringPrefMember;
246 typedef PrefMember<FilePath> FilePathPrefMember; 246 typedef PrefMember<FilePath> FilePathPrefMember;
247 247
248 #endif // CHROME_BROWSER_PREFS_PREF_MEMBER_H_ 248 #endif // CHROME_BROWSER_API_PREFS_PREF_MEMBER_H_
OLDNEW
« no previous file with comments | « chrome/browser/api/prefs/pref_change_registrar_unittest.cc ('k') | chrome/browser/api/prefs/pref_member.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698