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

Side by Side Diff: chrome/browser/sync/credential_cache_service_factory_win.h

Issue 10867019: [sync] Add hooks to allow for testing sync credential caching in the presence of strange singleton … (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | chrome/browser/sync/credential_cache_service_factory_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_SYNC_CREDENTIAL_CACHE_SERVICE_FACTORY_WIN_H_ 5 #ifndef CHROME_BROWSER_SYNC_CREDENTIAL_CACHE_SERVICE_FACTORY_WIN_H_
6 #define CHROME_BROWSER_SYNC_CREDENTIAL_CACHE_SERVICE_FACTORY_WIN_H_ 6 #define CHROME_BROWSER_SYNC_CREDENTIAL_CACHE_SERVICE_FACTORY_WIN_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/singleton.h" 9 #include "base/memory/singleton.h"
10 #include "chrome/browser/profiles/profile_keyed_service_factory.h" 10 #include "chrome/browser/profiles/profile_keyed_service_factory.h"
11 11
12 class Profile; 12 class Profile;
13 13
14 namespace syncer { 14 namespace syncer {
15 15
16 class CredentialCacheService; 16 class CredentialCacheService;
17 17
18 class CredentialCacheServiceFactory : public ProfileKeyedServiceFactory { 18 class CredentialCacheServiceFactory : public ProfileKeyedServiceFactory {
19 public: 19 public:
20 static syncer::CredentialCacheService* GetForProfile(Profile* profile); 20 static syncer::CredentialCacheService* GetForProfile(Profile* profile);
21 21
22 static CredentialCacheServiceFactory* GetInstance(); 22 static CredentialCacheServiceFactory* GetInstance();
23 23
24 // Returns true if |profile| uses the "Default" directory, and false if not.
25 static bool IsDefaultProfile(Profile* profile);
26
27 // Returns true if |profile| uses the "Default" directory in the alternate
28 // user data directory, and false if not. Used only for testing.
29 static bool IsDefaultAlternateProfileForTest(Profile* profile);
30
24 private: 31 private:
25 friend struct DefaultSingletonTraits<CredentialCacheServiceFactory>; 32 friend struct DefaultSingletonTraits<CredentialCacheServiceFactory>;
26 33
27 CredentialCacheServiceFactory(); 34 CredentialCacheServiceFactory();
28 35
29 virtual ~CredentialCacheServiceFactory(); 36 virtual ~CredentialCacheServiceFactory();
30 37
31 // Returns true if |profile| uses the "Default" directory, and false if not.
32 static bool IsDefaultProfile(Profile* profile);
33
34 // ProfileKeyedServiceFactory implementation. 38 // ProfileKeyedServiceFactory implementation.
35 virtual bool ServiceIsCreatedWithProfile() OVERRIDE; 39 virtual bool ServiceIsCreatedWithProfile() OVERRIDE;
36 40
37 // ProfileKeyedServiceFactory implementation. 41 // ProfileKeyedServiceFactory implementation.
38 virtual ProfileKeyedService* BuildServiceInstanceFor( 42 virtual ProfileKeyedService* BuildServiceInstanceFor(
39 Profile* profile) const OVERRIDE; 43 Profile* profile) const OVERRIDE;
40 }; 44 };
41 45
42 } // namespace syncer 46 } // namespace syncer
43 47
44 #endif // CHROME_BROWSER_SYNC_CREDENTIAL_CACHE_SERVICE_FACTORY_WIN_H_ 48 #endif // CHROME_BROWSER_SYNC_CREDENTIAL_CACHE_SERVICE_FACTORY_WIN_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/credential_cache_service_factory_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698