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

Side by Side Diff: chrome/browser/chromeos/app_mode/kiosk_app_launcher.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 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/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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 if (call_status != chromeos::DBUS_METHOD_CALL_SUCCESS) { 57 if (call_status != chromeos::DBUS_METHOD_CALL_SUCCESS) {
58 const int kMaxRetryTimes = 5; 58 const int kMaxRetryTimes = 5;
59 ++retry_count_; 59 ++retry_count_;
60 if (retry_count_ > kMaxRetryTimes) { 60 if (retry_count_ > kMaxRetryTimes) {
61 LOG(ERROR) << "Could not talk to cryptohomed for launching kiosk app."; 61 LOG(ERROR) << "Could not talk to cryptohomed for launching kiosk app.";
62 ReportCheckResult(KioskAppLaunchError::CRYPTOHOMED_NOT_RUNNING); 62 ReportCheckResult(KioskAppLaunchError::CRYPTOHOMED_NOT_RUNNING);
63 return; 63 return;
64 } 64 }
65 65
66 const int retry_delay_in_milliseconds = 500 * (1 << retry_count_); 66 const int retry_delay_in_milliseconds = 500 * (1 << retry_count_);
67 MessageLoop::current()->PostDelayedTask( 67 base::MessageLoop::current()->PostDelayedTask(
68 FROM_HERE, 68 FROM_HERE,
69 base::Bind(&CryptohomedChecker::StartCheck, AsWeakPtr()), 69 base::Bind(&CryptohomedChecker::StartCheck, AsWeakPtr()),
70 base::TimeDelta::FromMilliseconds(retry_delay_in_milliseconds)); 70 base::TimeDelta::FromMilliseconds(retry_delay_in_milliseconds));
71 return; 71 return;
72 } 72 }
73 73
74 if (is_mounted) 74 if (is_mounted)
75 LOG(ERROR) << "Cryptohome is mounted before launching kiosk app."; 75 LOG(ERROR) << "Cryptohome is mounted before launching kiosk app.";
76 76
77 // Proceed only when cryptohome is not mounded or running on dev box. 77 // Proceed only when cryptohome is not mounded or running on dev box.
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 (new chromeos::StartupAppLauncher(profile, app_id_))->Start(); 254 (new chromeos::StartupAppLauncher(profile, app_id_))->Start();
255 255
256 if (LoginDisplayHostImpl::default_host()) 256 if (LoginDisplayHostImpl::default_host())
257 LoginDisplayHostImpl::default_host()->OnSessionStart(); 257 LoginDisplayHostImpl::default_host()->OnSessionStart();
258 UserManager::Get()->SessionStarted(); 258 UserManager::Get()->SessionStarted();
259 259
260 ReportLaunchResult(KioskAppLaunchError::NONE); 260 ReportLaunchResult(KioskAppLaunchError::NONE);
261 } 261 }
262 262
263 } // namespace chromeos 263 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chrome_browser_main_x11.cc ('k') | chrome/browser/chromeos/app_mode/kiosk_app_manager_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698