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

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

Issue 10908088: Cleanup: Constify some ProfileKeyedBaseFactory methods and all overrides. Remove ProfileKeyedBaseFa… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: rebase, remove a few more lines of code Created 8 years, 3 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 #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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 bool CredentialCacheServiceFactory::IsDefaultAlternateProfileForTest( 60 bool CredentialCacheServiceFactory::IsDefaultAlternateProfileForTest(
61 Profile* profile) { 61 Profile* profile) {
62 DCHECK(profile); 62 DCHECK(profile);
63 const CommandLine* command_line = CommandLine::ForCurrentProcess(); 63 const CommandLine* command_line = CommandLine::ForCurrentProcess();
64 FilePath alternate_user_data_dir; 64 FilePath alternate_user_data_dir;
65 chrome::GetAlternateUserDataDirectory(&alternate_user_data_dir); 65 chrome::GetAlternateUserDataDirectory(&alternate_user_data_dir);
66 return profile->GetPath() == 66 return profile->GetPath() ==
67 ProfileManager::GetDefaultProfileDir(alternate_user_data_dir); 67 ProfileManager::GetDefaultProfileDir(alternate_user_data_dir);
68 } 68 }
69 69
70 bool CredentialCacheServiceFactory::ServiceIsCreatedWithProfile() { 70 bool CredentialCacheServiceFactory::ServiceIsCreatedWithProfile() const {
71 return true; 71 return true;
72 } 72 }
73 73
74 ProfileKeyedService* CredentialCacheServiceFactory::BuildServiceInstanceFor( 74 ProfileKeyedService* CredentialCacheServiceFactory::BuildServiceInstanceFor(
75 Profile* profile) const { 75 Profile* profile) const {
76 // Only instantiate a CredentialCacheService object if we are running in the 76 // Only instantiate a CredentialCacheService object if we are running in the
77 // default profile on Windows 8, and if credential caching is enabled. 77 // default profile on Windows 8, and if credential caching is enabled.
78 // TODO(rsimha): To allow for testing, start CredentialCacheService if we are 78 // TODO(rsimha): To allow for testing, start CredentialCacheService if we are
79 // either in the default profile or the default alternate profile, so that 79 // either in the default profile or the default alternate profile, so that
80 // an instance of desktop chrome using the default metro directory can be 80 // an instance of desktop chrome using the default metro directory can be
81 // used for testing. See http://crbug.com/144280. 81 // used for testing. See http://crbug.com/144280.
82 const CommandLine* command_line = CommandLine::ForCurrentProcess(); 82 const CommandLine* command_line = CommandLine::ForCurrentProcess();
83 if (base::win::GetVersion() >= base::win::VERSION_WIN8 && 83 if (base::win::GetVersion() >= base::win::VERSION_WIN8 &&
84 (IsDefaultProfile(profile) || 84 (IsDefaultProfile(profile) ||
85 IsDefaultAlternateProfileForTest(profile)) && 85 IsDefaultAlternateProfileForTest(profile)) &&
86 command_line->HasSwitch(switches::kEnableSyncCredentialCaching)) { 86 command_line->HasSwitch(switches::kEnableSyncCredentialCaching)) {
87 return new syncer::CredentialCacheService(profile); 87 return new syncer::CredentialCacheService(profile);
88 } 88 }
89 return NULL; 89 return NULL;
90 } 90 }
91 91
92 } // namespace syncer 92 } // namespace syncer
OLDNEW
« no previous file with comments | « chrome/browser/sync/credential_cache_service_factory_win.h ('k') | chrome/browser/themes/theme_service_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698