| 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/signin/fake_signin_manager.h" | 5 #include "chrome/browser/signin/fake_signin_manager.h" |
| 6 | 6 |
| 7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/signin/chrome_signin_manager_delegate.h" |
| 10 #include "chrome/browser/signin/signin_global_error.h" | 11 #include "chrome/browser/signin/signin_global_error.h" |
| 11 #include "chrome/browser/ui/global_error/global_error_service.h" | 12 #include "chrome/browser/ui/global_error/global_error_service.h" |
| 12 #include "chrome/browser/ui/global_error/global_error_service_factory.h" | 13 #include "chrome/browser/ui/global_error/global_error_service_factory.h" |
| 13 #include "chrome/common/chrome_notification_types.h" | 14 #include "chrome/common/chrome_notification_types.h" |
| 14 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" |
| 15 #include "content/public/browser/notification_service.h" | 16 #include "content/public/browser/notification_service.h" |
| 16 | 17 |
| 17 FakeSigninManagerBase::FakeSigninManagerBase(Profile* profile) { | 18 FakeSigninManagerBase::FakeSigninManagerBase(Profile* profile) { |
| 18 profile_ = profile; | 19 profile_ = profile; |
| 19 signin_global_error_.reset(new SigninGlobalError(this, profile)); | 20 signin_global_error_.reset(new SigninGlobalError(this, profile)); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 41 } | 42 } |
| 42 | 43 |
| 43 // static | 44 // static |
| 44 ProfileKeyedService* FakeSigninManagerBase::Build( | 45 ProfileKeyedService* FakeSigninManagerBase::Build( |
| 45 content::BrowserContext* profile) { | 46 content::BrowserContext* profile) { |
| 46 return new FakeSigninManagerBase(static_cast<Profile*>(profile)); | 47 return new FakeSigninManagerBase(static_cast<Profile*>(profile)); |
| 47 } | 48 } |
| 48 | 49 |
| 49 #if !defined (OS_CHROMEOS) | 50 #if !defined (OS_CHROMEOS) |
| 50 | 51 |
| 51 FakeSigninManager::FakeSigninManager(Profile* profile) { | 52 FakeSigninManager::FakeSigninManager(Profile* profile) |
| 53 : SigninManager(scoped_ptr<SigninManagerDelegate>( |
| 54 new ChromeSigninManagerDelegate(profile))) { |
| 52 Initialize(profile); | 55 Initialize(profile); |
| 53 } | 56 } |
| 54 | 57 |
| 55 FakeSigninManager::~FakeSigninManager() { | 58 FakeSigninManager::~FakeSigninManager() { |
| 56 } | 59 } |
| 57 | 60 |
| 58 void FakeSigninManager::InitTokenService() { | 61 void FakeSigninManager::InitTokenService() { |
| 59 } | 62 } |
| 60 | 63 |
| 61 void FakeSigninManager::StartSignIn(const std::string& username, | 64 void FakeSigninManager::StartSignIn(const std::string& username, |
| (...skipping 29 matching lines...) Expand all Loading... |
| 91 content::NotificationService::NoDetails()); | 94 content::NotificationService::NoDetails()); |
| 92 } | 95 } |
| 93 | 96 |
| 94 // static | 97 // static |
| 95 ProfileKeyedService* FakeSigninManager::Build( | 98 ProfileKeyedService* FakeSigninManager::Build( |
| 96 content::BrowserContext* profile) { | 99 content::BrowserContext* profile) { |
| 97 return new FakeSigninManager(static_cast<Profile*>(profile)); | 100 return new FakeSigninManager(static_cast<Profile*>(profile)); |
| 98 } | 101 } |
| 99 | 102 |
| 100 #endif // !defined (OS_CHROMEOS) | 103 #endif // !defined (OS_CHROMEOS) |
| OLD | NEW |