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

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: Remove debug comment. 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 g_browser_process->browser_policy_connector(); 161 g_browser_process->browser_policy_connector();
162 policy::DeviceMode device_mode = bpc->GetDeviceMode(); 162 policy::DeviceMode device_mode = bpc->GetDeviceMode();
163 if (device_mode == policy::DEVICE_MODE_KIOSK) { 163 if (device_mode == policy::DEVICE_MODE_KIOSK) {
164 is_kiosk_mode_ = true; 164 is_kiosk_mode_ = true;
165 return; 165 return;
166 } else if (device_mode == policy::DEVICE_MODE_PENDING){ 166 } else if (device_mode == policy::DEVICE_MODE_PENDING){
167 content::BrowserThread::PostDelayedTask( 167 content::BrowserThread::PostDelayedTask(
168 content::BrowserThread::UI, FROM_HERE, 168 content::BrowserThread::UI, FROM_HERE,
169 base::Bind(&KioskModeSettings::VerifyModeIsKnown, 169 base::Bind(&KioskModeSettings::VerifyModeIsKnown,
170 base::Unretained(this)), 170 base::Unretained(this)),
171 kDeviceModeFetchRetryDelayMs); 171 base::TimeDelta::FromMilliseconds(kDeviceModeFetchRetryDelayMs));
172 } 172 }
173 } 173 }
174 is_kiosk_mode_ = false; 174 is_kiosk_mode_ = false;
175 } 175 }
176 176
177 KioskModeSettings::~KioskModeSettings() { 177 KioskModeSettings::~KioskModeSettings() {
178 } 178 }
179 179
180 void KioskModeSettings::VerifyModeIsKnown() { 180 void KioskModeSettings::VerifyModeIsKnown() {
181 if (g_browser_process) { 181 if (g_browser_process) {
182 policy::BrowserPolicyConnector* bpc = 182 policy::BrowserPolicyConnector* bpc =
183 g_browser_process->browser_policy_connector(); 183 g_browser_process->browser_policy_connector();
184 policy::DeviceMode device_mode = bpc->GetDeviceMode(); 184 policy::DeviceMode device_mode = bpc->GetDeviceMode();
185 // We retry asking for the mode until it becomes known. 185 // We retry asking for the mode until it becomes known.
186 switch (device_mode) { 186 switch (device_mode) {
187 case policy::DEVICE_MODE_PENDING: 187 case policy::DEVICE_MODE_PENDING:
188 content::BrowserThread::PostDelayedTask( 188 content::BrowserThread::PostDelayedTask(
189 content::BrowserThread::UI, FROM_HERE, 189 content::BrowserThread::UI, FROM_HERE,
190 base::Bind(&KioskModeSettings::VerifyModeIsKnown, 190 base::Bind(&KioskModeSettings::VerifyModeIsKnown,
191 base::Unretained(this)), 191 base::Unretained(this)),
192 kDeviceModeFetchRetryDelayMs); 192 base::TimeDelta::FromMilliseconds(kDeviceModeFetchRetryDelayMs));
193 break; 193 break;
194 case policy::DEVICE_MODE_KIOSK: 194 case policy::DEVICE_MODE_KIOSK:
195 BrowserList::ExitCleanly(); 195 BrowserList::ExitCleanly();
196 break; 196 break;
197 default: 197 default:
198 break; 198 break;
199 } 199 }
200 } 200 }
201 } 201 }
202 202
203 203
204 } // namespace chromeos 204 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698