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" |
11 #include "base/sys_info.h" | 11 #include "base/sys_info.h" |
12 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | 12 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
13 #include "chrome/browser/chromeos/login/auth/chrome_login_performer.h" | |
14 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" | 13 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" |
15 #include "chrome/browser/chromeos/login/login_utils.h" | 14 #include "chrome/browser/chromeos/login/login_utils.h" |
16 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" | 15 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" |
17 #include "chrome/browser/chromeos/settings/cros_settings.h" | 16 #include "chrome/browser/chromeos/settings/cros_settings.h" |
18 #include "chrome/browser/lifetime/application_lifetime.h" | 17 #include "chrome/browser/lifetime/application_lifetime.h" |
19 #include "chromeos/cryptohome/async_method_caller.h" | 18 #include "chromeos/cryptohome/async_method_caller.h" |
20 #include "chromeos/dbus/cryptohome_client.h" | 19 #include "chromeos/dbus/cryptohome_client.h" |
21 #include "chromeos/dbus/dbus_thread_manager.h" | 20 #include "chromeos/dbus/dbus_thread_manager.h" |
22 #include "chromeos/login/auth/auth_status_consumer.h" | 21 #include "chromeos/login/auth/auth_status_consumer.h" |
23 #include "chromeos/login/auth/user_context.h" | 22 #include "chromeos/login/auth/user_context.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 KioskProfileLoader::~KioskProfileLoader() {} | 127 KioskProfileLoader::~KioskProfileLoader() {} |
129 | 128 |
130 void KioskProfileLoader::Start() { | 129 void KioskProfileLoader::Start() { |
131 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 130 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
132 login_performer_.reset(); | 131 login_performer_.reset(); |
133 cryptohomed_checker_.reset(new CryptohomedChecker(this)); | 132 cryptohomed_checker_.reset(new CryptohomedChecker(this)); |
134 cryptohomed_checker_->StartCheck(); | 133 cryptohomed_checker_->StartCheck(); |
135 } | 134 } |
136 | 135 |
137 void KioskProfileLoader::LoginAsKioskAccount() { | 136 void KioskProfileLoader::LoginAsKioskAccount() { |
138 login_performer_.reset(new ChromeLoginPerformer(this)); | 137 login_performer_.reset(new LoginPerformer(this)); |
139 login_performer_->LoginAsKioskAccount(user_id_, use_guest_mount_); | 138 login_performer_->LoginAsKioskAccount(user_id_, use_guest_mount_); |
140 } | 139 } |
141 | 140 |
142 void KioskProfileLoader::ReportLaunchResult(KioskAppLaunchError::Error error) { | 141 void KioskProfileLoader::ReportLaunchResult(KioskAppLaunchError::Error error) { |
143 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 142 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
144 | 143 |
145 if (error != KioskAppLaunchError::NONE) { | 144 if (error != KioskAppLaunchError::NONE) { |
146 delegate_->OnProfileLoadFailed(error); | 145 delegate_->OnProfileLoadFailed(error); |
147 } | 146 } |
148 } | 147 } |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 void KioskProfileLoader::OnProfilePrepared(Profile* profile) { | 185 void KioskProfileLoader::OnProfilePrepared(Profile* profile) { |
187 // This object could be deleted any time after successfully reporting | 186 // This object could be deleted any time after successfully reporting |
188 // a profile load, so invalidate the LoginUtils delegate now. | 187 // a profile load, so invalidate the LoginUtils delegate now. |
189 LoginUtils::Get()->DelegateDeleted(this); | 188 LoginUtils::Get()->DelegateDeleted(this); |
190 | 189 |
191 delegate_->OnProfileLoaded(profile); | 190 delegate_->OnProfileLoaded(profile); |
192 ReportLaunchResult(KioskAppLaunchError::NONE); | 191 ReportLaunchResult(KioskAppLaunchError::NONE); |
193 } | 192 } |
194 | 193 |
195 } // namespace chromeos | 194 } // namespace chromeos |
OLD | NEW |