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_manager.h" | 5 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 policy::BrowserPolicyConnectorChromeOS* connector = | 412 policy::BrowserPolicyConnectorChromeOS* connector = |
413 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | 413 g_browser_process->platform_part()->browser_policy_connector_chromeos(); |
414 InstallAttributes* attributes = connector->GetInstallAttributes(); | 414 InstallAttributes* attributes = connector->GetInstallAttributes(); |
415 switch (attributes->GetMode()) { | 415 switch (attributes->GetMode()) { |
416 case policy::DEVICE_MODE_NOT_SET: { | 416 case policy::DEVICE_MODE_NOT_SET: { |
417 if (!base::SysInfo::IsRunningOnChromeOS()) { | 417 if (!base::SysInfo::IsRunningOnChromeOS()) { |
418 status = CONSUMER_KIOSK_AUTO_LAUNCH_CONFIGURABLE; | 418 status = CONSUMER_KIOSK_AUTO_LAUNCH_CONFIGURABLE; |
419 } else if (!ownership_established_) { | 419 } else if (!ownership_established_) { |
420 bool* owner_present = new bool(false); | 420 bool* owner_present = new bool(false); |
421 base::PostTaskWithTraitsAndReply( | 421 base::PostTaskWithTraitsAndReply( |
422 FROM_HERE, base::TaskTraits().MayBlock().WithPriority( | 422 FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND}, |
423 base::TaskPriority::BACKGROUND), | |
424 base::Bind(&CheckOwnerFilePresence, owner_present), | 423 base::Bind(&CheckOwnerFilePresence, owner_present), |
425 base::Bind(&KioskAppManager::OnOwnerFileChecked, | 424 base::Bind(&KioskAppManager::OnOwnerFileChecked, |
426 base::Unretained(this), callback, | 425 base::Unretained(this), callback, |
427 base::Owned(owner_present))); | 426 base::Owned(owner_present))); |
428 return; | 427 return; |
429 } | 428 } |
430 break; | 429 break; |
431 } | 430 } |
432 case policy::DEVICE_MODE_CONSUMER_KIOSK_AUTOLAUNCH: | 431 case policy::DEVICE_MODE_CONSUMER_KIOSK_AUTOLAUNCH: |
433 status = CONSUMER_KIOSK_AUTO_LAUNCH_ENABLED; | 432 status = CONSUMER_KIOSK_AUTO_LAUNCH_ENABLED; |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
968 base::TimeDelta KioskAppManager::GetAutoLaunchDelay() const { | 967 base::TimeDelta KioskAppManager::GetAutoLaunchDelay() const { |
969 int delay; | 968 int delay; |
970 if (!CrosSettings::Get()->GetInteger( | 969 if (!CrosSettings::Get()->GetInteger( |
971 kAccountsPrefDeviceLocalAccountAutoLoginDelay, &delay)) { | 970 kAccountsPrefDeviceLocalAccountAutoLoginDelay, &delay)) { |
972 return base::TimeDelta(); // Default delay is 0ms. | 971 return base::TimeDelta(); // Default delay is 0ms. |
973 } | 972 } |
974 return base::TimeDelta::FromMilliseconds(delay); | 973 return base::TimeDelta::FromMilliseconds(delay); |
975 } | 974 } |
976 | 975 |
977 } // namespace chromeos | 976 } // namespace chromeos |
OLD | NEW |