OLD | NEW |
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 #include "chrome/browser/sync/credential_cache_service_factory_win.h" | 5 #include "chrome/browser/sync/credential_cache_service_factory_win.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
9 #include "base/win/windows_version.h" | 9 #include "base/win/windows_version.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 ProfileManager::GetDefaultProfileDir(default_user_data_dir); | 54 ProfileManager::GetDefaultProfileDir(default_user_data_dir); |
55 } | 55 } |
56 | 56 |
57 bool CredentialCacheServiceFactory::ServiceIsCreatedWithProfile() { | 57 bool CredentialCacheServiceFactory::ServiceIsCreatedWithProfile() { |
58 return true; | 58 return true; |
59 } | 59 } |
60 | 60 |
61 ProfileKeyedService* CredentialCacheServiceFactory::BuildServiceInstanceFor( | 61 ProfileKeyedService* CredentialCacheServiceFactory::BuildServiceInstanceFor( |
62 Profile* profile) const { | 62 Profile* profile) const { |
63 // Only instantiate a CredentialCacheService object if we are running in the | 63 // Only instantiate a CredentialCacheService object if we are running in the |
64 // default profile on Windows 8, and if credential caching is not disabled. | 64 // default profile on Windows 8, and if credential caching is enabled. |
65 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 65 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
66 if (base::win::GetVersion() >= base::win::VERSION_WIN8 && | 66 if (base::win::GetVersion() >= base::win::VERSION_WIN8 && |
67 IsDefaultProfile(profile) && | 67 IsDefaultProfile(profile) && |
68 !command_line->HasSwitch(switches::kDisableSyncCredentialCaching)) { | 68 command_line->HasSwitch(switches::kEnableSyncCredentialCaching)) { |
69 return new syncer::CredentialCacheService(profile); | 69 return new syncer::CredentialCacheService(profile); |
70 } | 70 } |
71 return NULL; | 71 return NULL; |
72 } | 72 } |
73 | 73 |
74 } // namespace syncer | 74 } // namespace syncer |
OLD | NEW |