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/app_mode/kiosk_profile_loader.h" | 5 #include "chrome/browser/chromeos/app_mode/kiosk_profile_loader.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 KioskProfileLoader::KioskProfileLoader(const std::string& app_user_id, | 120 KioskProfileLoader::KioskProfileLoader(const std::string& app_user_id, |
121 bool use_guest_mount, | 121 bool use_guest_mount, |
122 Delegate* delegate) | 122 Delegate* delegate) |
123 : user_id_(app_user_id), | 123 : user_id_(app_user_id), |
124 use_guest_mount_(use_guest_mount), | 124 use_guest_mount_(use_guest_mount), |
125 delegate_(delegate) {} | 125 delegate_(delegate) {} |
126 | 126 |
127 KioskProfileLoader::~KioskProfileLoader() {} | 127 KioskProfileLoader::~KioskProfileLoader() {} |
128 | 128 |
129 void KioskProfileLoader::Start() { | 129 void KioskProfileLoader::Start() { |
130 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 130 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
131 login_performer_.reset(); | 131 login_performer_.reset(); |
132 cryptohomed_checker_.reset(new CryptohomedChecker(this)); | 132 cryptohomed_checker_.reset(new CryptohomedChecker(this)); |
133 cryptohomed_checker_->StartCheck(); | 133 cryptohomed_checker_->StartCheck(); |
134 } | 134 } |
135 | 135 |
136 void KioskProfileLoader::LoginAsKioskAccount() { | 136 void KioskProfileLoader::LoginAsKioskAccount() { |
137 login_performer_.reset(new ChromeLoginPerformer(this)); | 137 login_performer_.reset(new ChromeLoginPerformer(this)); |
138 login_performer_->LoginAsKioskAccount(user_id_, use_guest_mount_); | 138 login_performer_->LoginAsKioskAccount(user_id_, use_guest_mount_); |
139 } | 139 } |
140 | 140 |
141 void KioskProfileLoader::ReportLaunchResult(KioskAppLaunchError::Error error) { | 141 void KioskProfileLoader::ReportLaunchResult(KioskAppLaunchError::Error error) { |
142 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 142 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
143 | 143 |
144 if (error != KioskAppLaunchError::NONE) { | 144 if (error != KioskAppLaunchError::NONE) { |
145 delegate_->OnProfileLoadFailed(error); | 145 delegate_->OnProfileLoadFailed(error); |
146 } | 146 } |
147 } | 147 } |
148 | 148 |
149 void KioskProfileLoader::OnAuthSuccess(const UserContext& user_context) { | 149 void KioskProfileLoader::OnAuthSuccess(const UserContext& user_context) { |
150 // LoginPerformer will delete itself. | 150 // LoginPerformer will delete itself. |
151 login_performer_->set_delegate(NULL); | 151 login_performer_->set_delegate(NULL); |
152 ignore_result(login_performer_.release()); | 152 ignore_result(login_performer_.release()); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 bool browser_launched) { | 187 bool browser_launched) { |
188 // This object could be deleted any time after successfully reporting | 188 // This object could be deleted any time after successfully reporting |
189 // a profile load, so invalidate the delegate now. | 189 // a profile load, so invalidate the delegate now. |
190 UserSessionManager::GetInstance()->DelegateDeleted(this); | 190 UserSessionManager::GetInstance()->DelegateDeleted(this); |
191 | 191 |
192 delegate_->OnProfileLoaded(profile); | 192 delegate_->OnProfileLoaded(profile); |
193 ReportLaunchResult(KioskAppLaunchError::NONE); | 193 ReportLaunchResult(KioskAppLaunchError::NONE); |
194 } | 194 } |
195 | 195 |
196 } // namespace chromeos | 196 } // namespace chromeos |
OLD | NEW |