OLD | NEW |
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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 base::Unretained(this))); | 170 base::Unretained(this))); |
171 } | 171 } |
172 } | 172 } |
173 is_kiosk_mode_ = false; | 173 is_kiosk_mode_ = false; |
174 } | 174 } |
175 | 175 |
176 KioskModeSettings::~KioskModeSettings() { | 176 KioskModeSettings::~KioskModeSettings() { |
177 } | 177 } |
178 | 178 |
179 void KioskModeSettings::VerifyModeIsKnown( | 179 void KioskModeSettings::VerifyModeIsKnown( |
180 DeviceSettingsService::OwnershipStatus status, | 180 DeviceSettingsService::OwnershipStatus status) { |
181 bool is_owner) { | |
182 if (status != DeviceSettingsService::OWNERSHIP_TAKEN) | 181 if (status != DeviceSettingsService::OWNERSHIP_TAKEN) |
183 return; | 182 return; |
184 | 183 |
185 if (g_browser_process) { | 184 if (g_browser_process) { |
186 policy::BrowserPolicyConnector* bpc = | 185 policy::BrowserPolicyConnector* bpc = |
187 g_browser_process->browser_policy_connector(); | 186 g_browser_process->browser_policy_connector(); |
188 policy::DeviceMode device_mode = bpc->GetDeviceMode(); | 187 policy::DeviceMode device_mode = bpc->GetDeviceMode(); |
189 // We retry asking for the mode until it becomes known. | 188 // We retry asking for the mode until it becomes known. |
190 switch (device_mode) { | 189 switch (device_mode) { |
191 case policy::DEVICE_MODE_PENDING: | 190 case policy::DEVICE_MODE_PENDING: |
192 content::BrowserThread::PostDelayedTask( | 191 content::BrowserThread::PostDelayedTask( |
193 content::BrowserThread::UI, FROM_HERE, | 192 content::BrowserThread::UI, FROM_HERE, |
194 base::Bind(&KioskModeSettings::VerifyModeIsKnown, | 193 base::Bind(&KioskModeSettings::VerifyModeIsKnown, |
195 base::Unretained(this), status, is_owner), | 194 base::Unretained(this), status), |
196 base::TimeDelta::FromMilliseconds(kDeviceModeFetchRetryDelayMs)); | 195 base::TimeDelta::FromMilliseconds(kDeviceModeFetchRetryDelayMs)); |
197 break; | 196 break; |
198 case policy::DEVICE_MODE_RETAIL_KIOSK: | 197 case policy::DEVICE_MODE_RETAIL_KIOSK: |
199 chrome::ExitCleanly(); | 198 chrome::ExitCleanly(); |
200 break; | 199 break; |
201 default: | 200 default: |
202 break; | 201 break; |
203 } | 202 } |
204 } | 203 } |
205 } | 204 } |
206 | 205 |
207 | 206 |
208 } // namespace chromeos | 207 } // namespace chromeos |
OLD | NEW |