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_helper.h" | 5 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_helper.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
11 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.h" | 11 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.h" |
12 #include "chrome/browser/policy/cloud_policy_constants.h" | 12 #include "chrome/browser/policy/cloud_policy_constants.h" |
13 #include "chrome/browser/policy/browser_policy_connector.h" | 13 #include "chrome/browser/policy/browser_policy_connector.h" |
14 #include "chrome/common/chrome_switches.h" | 14 #include "chrome/common/chrome_switches.h" |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 const int64 kScreensaverIdleTimeout = 60; | 18 const int64 kScreensaverIdleTimeout = 60; |
| 19 const int64 kLoginIdleTimeout = 100; |
| 20 const int64 kLoginIdleCountdownTimeout = 20; |
19 | 21 |
20 } // namespace | 22 } // namespace |
21 | 23 |
22 namespace chromeos { | 24 namespace chromeos { |
23 | 25 |
24 static base::LazyInstance<KioskModeHelper> g_kiosk_mode_helper = | 26 static base::LazyInstance<KioskModeHelper> g_kiosk_mode_helper = |
25 LAZY_INSTANCE_INITIALIZER; | 27 LAZY_INSTANCE_INITIALIZER; |
26 | 28 |
27 // static | 29 // static |
28 bool KioskModeHelper::IsKioskModeEnabled() { | 30 bool KioskModeHelper::IsKioskModeEnabled() { |
(...skipping 28 matching lines...) Expand all Loading... |
57 GetSwitchValueASCII(switches::kKioskModeScreensaverPath); | 59 GetSwitchValueASCII(switches::kKioskModeScreensaverPath); |
58 } | 60 } |
59 | 61 |
60 int64 KioskModeHelper::GetScreensaverTimeout() const { | 62 int64 KioskModeHelper::GetScreensaverTimeout() const { |
61 if (!is_initialized_) | 63 if (!is_initialized_) |
62 return -1; | 64 return -1; |
63 | 65 |
64 return kScreensaverIdleTimeout; | 66 return kScreensaverIdleTimeout; |
65 } | 67 } |
66 | 68 |
| 69 int64 KioskModeHelper::GetIdleLogoutTimeout() const { |
| 70 if (!is_initialized_) |
| 71 return -1; |
| 72 |
| 73 return kLoginIdleTimeout; |
| 74 } |
| 75 int64 KioskModeHelper::GetIdleLogoutWarningTimeout() const { |
| 76 if (!is_initialized_) |
| 77 return -1; |
| 78 |
| 79 return kLoginIdleCountdownTimeout; |
| 80 } |
| 81 |
| 82 |
67 KioskModeHelper::KioskModeHelper() : is_initialized_(false) { | 83 KioskModeHelper::KioskModeHelper() : is_initialized_(false) { |
68 } | 84 } |
69 | 85 |
70 } // namespace chromeos | 86 } // namespace chromeos |
OLD | NEW |