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

Side by Side Diff: chrome/browser/profiles/profile_keyed_base_factory.h

Issue 12079097: Introduce PrefRegistrySyncable, simplifying PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head again; base::File changes conflicted. Created 7 years, 10 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 #ifndef CHROME_BROWSER_PROFILES_PROFILE_KEYED_BASE_FACTORY_H_ 5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_KEYED_BASE_FACTORY_H_
6 #define CHROME_BROWSER_PROFILES_PROFILE_KEYED_BASE_FACTORY_H_ 6 #define CHROME_BROWSER_PROFILES_PROFILE_KEYED_BASE_FACTORY_H_
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "base/threading/non_thread_safe.h" 10 #include "base/threading/non_thread_safe.h"
11 11
12 class PrefServiceSyncable; 12 class PrefRegistrySyncable;
13 class PrefService;
13 class Profile; 14 class Profile;
14 class ProfileDependencyManager; 15 class ProfileDependencyManager;
15 16
16 // Base class for Factories that take a Profile object and return some service. 17 // Base class for Factories that take a Profile object and return some service.
17 // 18 //
18 // Unless you're trying to make a new type of Factory, you probably don't want 19 // Unless you're trying to make a new type of Factory, you probably don't want
19 // this class, but its subclasses: ProfileKeyedServiceFactory and 20 // this class, but its subclasses: ProfileKeyedServiceFactory and
20 // RefcountedProfileKeyedServiceFactory. This object describes general 21 // RefcountedProfileKeyedServiceFactory. This object describes general
21 // dependency management between Factories; subclasses react to lifecycle 22 // dependency management between Factories; subclasses react to lifecycle
22 // events and implement memory management. 23 // events and implement memory management.
(...skipping 20 matching lines...) Expand all
43 void DependsOn(ProfileKeyedBaseFactory* rhs); 44 void DependsOn(ProfileKeyedBaseFactory* rhs);
44 45
45 // Finds which profile (if any) to use using the Service.*Incognito methods. 46 // Finds which profile (if any) to use using the Service.*Incognito methods.
46 Profile* GetProfileToUse(Profile* profile); 47 Profile* GetProfileToUse(Profile* profile);
47 48
48 // Interface for people building a concrete FooServiceFactory: -------------- 49 // Interface for people building a concrete FooServiceFactory: --------------
49 50
50 // Register any user preferences on this service. This is called during 51 // Register any user preferences on this service. This is called during
51 // CreateProfileService() since preferences are registered on a per Profile 52 // CreateProfileService() since preferences are registered on a per Profile
52 // basis. 53 // basis.
53 virtual void RegisterUserPrefs(PrefServiceSyncable* user_prefs) {} 54 //
55 // TODO(joi): Remove need for the version with the PrefService parameter.
56 virtual void RegisterUserPrefs(PrefRegistrySyncable* registry) {}
57 virtual void DeprecatedRegisterUserPrefs(PrefService* prefs,
58 PrefRegistrySyncable* registry) {}
54 59
55 // By default, if we are asked for a service with an Incognito profile, we 60 // By default, if we are asked for a service with an Incognito profile, we
56 // pass back NULL. To redirect to the Incognito's original profile or to 61 // pass back NULL. To redirect to the Incognito's original profile or to
57 // create another instance, even for Incognito windows, override one of the 62 // create another instance, even for Incognito windows, override one of the
58 // following methods: 63 // following methods:
59 virtual bool ServiceRedirectedInIncognito() const; 64 virtual bool ServiceRedirectedInIncognito() const;
60 virtual bool ServiceHasOwnInstanceInIncognito() const; 65 virtual bool ServiceHasOwnInstanceInIncognito() const;
61 66
62 // By default, we create instances of a service lazily and wait until 67 // By default, we create instances of a service lazily and wait until
63 // GetForProfile() is called on our subclass. Some services need to be 68 // GetForProfile() is called on our subclass. Some services need to be
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 127
123 #if !defined(NDEBUG) 128 #if !defined(NDEBUG)
124 // A static string passed in to our constructor. Should be unique across all 129 // A static string passed in to our constructor. Should be unique across all
125 // services. This is used only for debugging in debug mode. (We can print 130 // services. This is used only for debugging in debug mode. (We can print
126 // pretty graphs with GraphViz with this information.) 131 // pretty graphs with GraphViz with this information.)
127 const char* service_name_; 132 const char* service_name_;
128 #endif 133 #endif
129 }; 134 };
130 135
131 #endif // CHROME_BROWSER_PROFILES_PROFILE_KEYED_BASE_FACTORY_H_ 136 #endif // CHROME_BROWSER_PROFILES_PROFILE_KEYED_BASE_FACTORY_H_
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_impl.cc ('k') | chrome/browser/profiles/profile_keyed_base_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698