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_app_launcher.h" | 5 #include "chrome/browser/chromeos/app_mode/kiosk_app_launcher.h" |
6 | 6 |
7 #include "base/chromeos/chromeos_version.h" | 7 #include "base/chromeos/chromeos_version.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 if (call_status != chromeos::DBUS_METHOD_CALL_SUCCESS) { | 62 if (call_status != chromeos::DBUS_METHOD_CALL_SUCCESS) { |
63 const int kMaxRetryTimes = 5; | 63 const int kMaxRetryTimes = 5; |
64 ++retry_count_; | 64 ++retry_count_; |
65 if (retry_count_ > kMaxRetryTimes) { | 65 if (retry_count_ > kMaxRetryTimes) { |
66 LOG(ERROR) << "Could not talk to cryptohomed for launching kiosk app."; | 66 LOG(ERROR) << "Could not talk to cryptohomed for launching kiosk app."; |
67 ReportCheckResult(KioskAppLaunchError::CRYPTOHOMED_NOT_RUNNING); | 67 ReportCheckResult(KioskAppLaunchError::CRYPTOHOMED_NOT_RUNNING); |
68 return; | 68 return; |
69 } | 69 } |
70 | 70 |
71 const int retry_delay_in_milliseconds = 500 * (1 << retry_count_); | 71 const int retry_delay_in_milliseconds = 500 * (1 << retry_count_); |
72 MessageLoop::current()->PostDelayedTask( | 72 base::MessageLoop::current()->PostDelayedTask( |
73 FROM_HERE, | 73 FROM_HERE, |
74 base::Bind(&CryptohomedChecker::StartCheck, AsWeakPtr()), | 74 base::Bind(&CryptohomedChecker::StartCheck, AsWeakPtr()), |
75 base::TimeDelta::FromMilliseconds(retry_delay_in_milliseconds)); | 75 base::TimeDelta::FromMilliseconds(retry_delay_in_milliseconds)); |
76 return; | 76 return; |
77 } | 77 } |
78 | 78 |
79 if (is_mounted) | 79 if (is_mounted) |
80 LOG(ERROR) << "Cryptohome is mounted before launching kiosk app."; | 80 LOG(ERROR) << "Cryptohome is mounted before launching kiosk app."; |
81 | 81 |
82 // Proceed only when cryptohome is not mounded or running on dev box. | 82 // Proceed only when cryptohome is not mounded or running on dev box. |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 (new chromeos::StartupAppLauncher(profile, app_id_))->Start(); | 231 (new chromeos::StartupAppLauncher(profile, app_id_))->Start(); |
232 | 232 |
233 if (LoginDisplayHostImpl::default_host()) | 233 if (LoginDisplayHostImpl::default_host()) |
234 LoginDisplayHostImpl::default_host()->OnSessionStart(); | 234 LoginDisplayHostImpl::default_host()->OnSessionStart(); |
235 UserManager::Get()->SessionStarted(); | 235 UserManager::Get()->SessionStarted(); |
236 | 236 |
237 ReportLaunchResult(KioskAppLaunchError::NONE); | 237 ReportLaunchResult(KioskAppLaunchError::NONE); |
238 } | 238 } |
239 | 239 |
240 } // namespace chromeos | 240 } // namespace chromeos |
OLD | NEW |