OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/chromeos/login/fake_login_utils.h" | 5 #include "chrome/browser/chromeos/login/fake_login_utils.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
10 #include "chrome/browser/chromeos/login/auth/mock_authenticator.h" | 10 #include "chrome/browser/chromeos/login/auth/mock_authenticator.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 chrome::startup::IS_PROCESS_STARTUP, | 48 chrome::startup::IS_PROCESS_STARTUP, |
49 first_run, | 49 first_run, |
50 NULL)); | 50 NULL)); |
51 } | 51 } |
52 if (login_host) | 52 if (login_host) |
53 login_host->Finalize(); | 53 login_host->Finalize(); |
54 UserManager::Get()->SessionStarted(); | 54 UserManager::Get()->SessionStarted(); |
55 } | 55 } |
56 | 56 |
57 void FakeLoginUtils::PrepareProfile(const UserContext& user_context, | 57 void FakeLoginUtils::PrepareProfile(const UserContext& user_context, |
58 const std::string& display_email, | |
59 bool has_cookies, | 58 bool has_cookies, |
60 bool has_active_session, | 59 bool has_active_session, |
61 LoginUtils::Delegate* delegate) { | 60 LoginUtils::Delegate* delegate) { |
62 UserManager::Get()->UserLoggedIn( | 61 UserManager::Get()->UserLoggedIn( |
63 user_context.GetUserID(), user_context.GetUserIDHash(), false); | 62 user_context.GetUserID(), user_context.GetUserIDHash(), false); |
64 User* user = UserManager::Get()->FindUserAndModify(user_context.GetUserID()); | 63 User* user = UserManager::Get()->FindUserAndModify(user_context.GetUserID()); |
65 DCHECK(user); | 64 DCHECK(user); |
66 | 65 |
67 // Make sure that we get the real Profile instead of the login Profile. | 66 // Make sure that we get the real Profile instead of the login Profile. |
68 user->set_profile_is_created(); | 67 user->set_profile_is_created(); |
(...skipping 19 matching lines...) Expand all Loading... |
88 } | 87 } |
89 | 88 |
90 void FakeLoginUtils::DelegateDeleted(LoginUtils::Delegate* delegate) { | 89 void FakeLoginUtils::DelegateDeleted(LoginUtils::Delegate* delegate) { |
91 NOTREACHED() << "Method not implemented."; | 90 NOTREACHED() << "Method not implemented."; |
92 } | 91 } |
93 | 92 |
94 void FakeLoginUtils::CompleteOffTheRecordLogin(const GURL& start_url) { | 93 void FakeLoginUtils::CompleteOffTheRecordLogin(const GURL& start_url) { |
95 NOTREACHED() << "Method not implemented."; | 94 NOTREACHED() << "Method not implemented."; |
96 } | 95 } |
97 | 96 |
98 void FakeLoginUtils::SetFirstLoginPrefs(PrefService* prefs) { | |
99 NOTREACHED() << "Method not implemented."; | |
100 } | |
101 | |
102 scoped_refptr<Authenticator> FakeLoginUtils::CreateAuthenticator( | 97 scoped_refptr<Authenticator> FakeLoginUtils::CreateAuthenticator( |
103 LoginStatusConsumer* consumer) { | 98 LoginStatusConsumer* consumer) { |
104 authenticator_ = new MockAuthenticator(consumer, expected_user_context_); | 99 authenticator_ = new MockAuthenticator(consumer, expected_user_context_); |
105 return authenticator_; | 100 return authenticator_; |
106 } | 101 } |
107 | 102 |
108 void FakeLoginUtils::RestoreAuthenticationSession(Profile* profile) { | |
109 NOTREACHED() << "Method not implemented."; | |
110 } | |
111 | |
112 void FakeLoginUtils::InitRlzDelayed(Profile* user_profile) { | |
113 NOTREACHED() << "Method not implemented."; | |
114 } | |
115 | |
116 void FakeLoginUtils::SetExpectedCredentials(const UserContext& user_context) { | 103 void FakeLoginUtils::SetExpectedCredentials(const UserContext& user_context) { |
117 expected_user_context_ = user_context; | 104 expected_user_context_ = user_context; |
118 if (authenticator_) { | 105 if (authenticator_) { |
119 static_cast<MockAuthenticator*>(authenticator_.get())-> | 106 static_cast<MockAuthenticator*>(authenticator_.get())-> |
120 SetExpectedCredentials(user_context); | 107 SetExpectedCredentials(user_context); |
121 } | 108 } |
122 } | 109 } |
123 | 110 |
124 } // namespace chromeos | 111 } // namespace chromeos |
OLD | NEW |