Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / chromeos / kiosk_mode / mock_kiosk_mode_settings.h
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_CHROMEOS_KIOSK_MODE_MOCK_KIOSK_MODE_SETTINGS_H_
6 #define CHROME_BROWSER_CHROMEOS_KIOSK_MODE_MOCK_KIOSK_MODE_SETTINGS_H_
7
8 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h"
9
10 #include <string>
11
12 #include "base/basictypes.h"
13 #include "base/callback_forward.h"
14 #include "base/compiler_specific.h"
15 #include "base/time/time.h"
16
17 namespace base {
18 template <typename T> struct DefaultLazyInstanceTraits;
19 }
20
21 namespace {
22
23 const int kMockIdleLogoutTimeoutMs = 50000;
24 const int kMockIdleLogoutWarningDurationMs = 1000;
25
26 }  // namespace
27
28 namespace chromeos {
29
30 class MockKioskModeSettings : public KioskModeSettings {
31  public:
32   // We should be able to instantiate mock instances, unlike the main kiosk
33   // mode settings class, which should always have only one global instance.
34   MockKioskModeSettings();
35   virtual ~MockKioskModeSettings();
36
37   virtual bool IsKioskModeEnabled() override;
38
39   // Initialize the mock class.
40   virtual void Initialize(const base::Closure& notify_initialized) override;
41   virtual bool is_initialized() const override;
42
43   // The time to logout the user in on idle.
44   virtual base::TimeDelta GetIdleLogoutTimeout() const override;
45
46   // The time to show the countdown timer for.
47   virtual base::TimeDelta GetIdleLogoutWarningDuration() const override;
48
49  private:
50   friend struct base::DefaultLazyInstanceTraits<MockKioskModeSettings>;
51
52   bool is_initialized_;
53
54   DISALLOW_COPY_AND_ASSIGN(MockKioskModeSettings);
55 };
56
57 }  // namespace chromeos
58
59 #endif  // CHROME_BROWSER_CHROMEOS_KIOSK_MODE_MOCK_KIOSK_MODE_SETTINGS_H_