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

Side by Side Diff: components/user_prefs/user_prefs.h

Issue 12340111: Introduce //components/user_prefs, use to eliminate c/b/prefs dependency in Autofill. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix build. Created 7 years, 9 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
(Empty)
1 // Copyright 2013 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 COMPONENTS_USER_PREFS_USER_PREFS_H_
6 #define COMPONENTS_USER_PREFS_USER_PREFS_H_
7
8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/supports_user_data.h"
11 #include "components/user_prefs/user_prefs_export.h"
12
13 class PrefService;
14
15 namespace content {
16 class BrowserContext;
17 };
tfarina 2013/03/04 16:30:52 rm ;
Jói 2013/03/05 20:54:21 Done.
18
19 namespace components {
20
21 // Components may use preferences associated with a given user. These
22 // hang off of content::BrowserContext and can be retrieved using
23 // UserPrefs::Get().
24 //
25 // It is up to the embedder tof create and own the PrefService and
26 // attach it to BrowserContext using the UserPrefs::Set() function.
27 class USER_PREFS_EXPORT UserPrefs : public base::SupportsUserData::Data {
28 public:
29 // Retrieves the PrefService for a given BrowserContext, or NULL if
30 // none is attached.
31 static PrefService* Get(content::BrowserContext* context);
32
33 // Hangs the specified |prefs| off of |context|. Should be called
34 // only once per BrowserContext.
35 static void Set(content::BrowserContext* context, PrefService* prefs);
36
37 private:
38 UserPrefs(PrefService* prefs);
39 virtual ~UserPrefs();
40
41 // Non-owning; owned by embedder.
42 PrefService* prefs_;
43
44 DISALLOW_COPY_AND_ASSIGN(UserPrefs);
45 };
46
47 } // namespace components
48
49 #endif // COMPONENTS_USER_PREFS_USER_PREFS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698