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

Side by Side Diff: chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.cc

Issue 10026013: Update use of TimeDelta in chrome/browser/*, ui/views/*, and other places. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase onto master. Created 8 years, 7 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/kiosk_mode/kiosk_mode_settings.h" 5 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 g_browser_process->browser_policy_connector(); 162 g_browser_process->browser_policy_connector();
163 policy::DeviceMode device_mode = bpc->GetDeviceMode(); 163 policy::DeviceMode device_mode = bpc->GetDeviceMode();
164 if (device_mode == policy::DEVICE_MODE_KIOSK) { 164 if (device_mode == policy::DEVICE_MODE_KIOSK) {
165 is_kiosk_mode_ = true; 165 is_kiosk_mode_ = true;
166 return; 166 return;
167 } else if (device_mode == policy::DEVICE_MODE_PENDING){ 167 } else if (device_mode == policy::DEVICE_MODE_PENDING){
168 content::BrowserThread::PostDelayedTask( 168 content::BrowserThread::PostDelayedTask(
169 content::BrowserThread::UI, FROM_HERE, 169 content::BrowserThread::UI, FROM_HERE,
170 base::Bind(&KioskModeSettings::VerifyModeIsKnown, 170 base::Bind(&KioskModeSettings::VerifyModeIsKnown,
171 base::Unretained(this)), 171 base::Unretained(this)),
172 kDeviceModeFetchRetryDelayMs); 172 base::TimeDelta::FromMilliseconds(kDeviceModeFetchRetryDelayMs));
173 } 173 }
174 } 174 }
175 is_kiosk_mode_ = false; 175 is_kiosk_mode_ = false;
176 } 176 }
177 177
178 KioskModeSettings::~KioskModeSettings() { 178 KioskModeSettings::~KioskModeSettings() {
179 } 179 }
180 180
181 void KioskModeSettings::VerifyModeIsKnown() { 181 void KioskModeSettings::VerifyModeIsKnown() {
182 if (g_browser_process) { 182 if (g_browser_process) {
183 policy::BrowserPolicyConnector* bpc = 183 policy::BrowserPolicyConnector* bpc =
184 g_browser_process->browser_policy_connector(); 184 g_browser_process->browser_policy_connector();
185 policy::DeviceMode device_mode = bpc->GetDeviceMode(); 185 policy::DeviceMode device_mode = bpc->GetDeviceMode();
186 // We retry asking for the mode until it becomes known. 186 // We retry asking for the mode until it becomes known.
187 switch (device_mode) { 187 switch (device_mode) {
188 case policy::DEVICE_MODE_PENDING: 188 case policy::DEVICE_MODE_PENDING:
189 content::BrowserThread::PostDelayedTask( 189 content::BrowserThread::PostDelayedTask(
190 content::BrowserThread::UI, FROM_HERE, 190 content::BrowserThread::UI, FROM_HERE,
191 base::Bind(&KioskModeSettings::VerifyModeIsKnown, 191 base::Bind(&KioskModeSettings::VerifyModeIsKnown,
192 base::Unretained(this)), 192 base::Unretained(this)),
193 kDeviceModeFetchRetryDelayMs); 193 base::TimeDelta::FromMilliseconds(kDeviceModeFetchRetryDelayMs));
194 break; 194 break;
195 case policy::DEVICE_MODE_KIOSK: 195 case policy::DEVICE_MODE_KIOSK:
196 BrowserList::ExitCleanly(); 196 BrowserList::ExitCleanly();
197 break; 197 break;
198 default: 198 default:
199 break; 199 break;
200 } 200 }
201 } 201 }
202 } 202 }
203 203
204 204
205 } // namespace chromeos 205 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/external_metrics.cc ('k') | chrome/browser/chromeos/net/network_change_notifier_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698