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

Side by Side Diff: chrome/browser/chromeos/login/fake_login_utils.cc

Issue 318853004: Introduce SessionManager that will contain code to start user session on Chrome OS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 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 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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/fake_login_utils.h ('k') | chrome/browser/chromeos/login/login_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698