Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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_KIOSK_MODE_HELPER_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_KIOSK_MODE_KIOSK_MODE_HELPER_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include <string> | |
| 10 | |
| 11 #include "base/basictypes.h" | |
| 12 #include "base/callback_forward.h" | |
| 13 | |
| 14 namespace base { | |
| 15 template <typename T> struct DefaultLazyInstanceTraits; | |
|
pastarmovj
2012/03/05 15:22:25
Do you really need this to be a singleton. Can it
rkc
2012/03/05 23:16:13
It _is instantiated when it's needed - isn't that
| |
| 16 } | |
| 17 | |
| 18 // This class centralizes all our code to get KioskMode settings; since | |
| 19 // KioskMode interferes with normal operations all over Chrome, having all | |
| 20 // data about it pulled from a central location would make future | |
| 21 // refactorings easier. This class also handles getting trust for the policies | |
| 22 // via it's init method. | |
| 23 // | |
| 24 // Note: If Initialize is not called before the various Getters, we'll return | |
| 25 // invalid values. | |
| 26 // | |
| 27 // TODO(rkc): Once the enterprise policy side of this code is checked in, add | |
| 28 // code to pull from the enterprise policy instead of flags and constants. | |
| 29 namespace chromeos { | |
| 30 | |
| 31 class KioskModeHelper { | |
| 32 public: | |
| 33 // This method checks if Kiosk Mode is enabled or not. | |
| 34 static bool IsKioskModeEnabled(); | |
| 35 | |
| 36 static KioskModeHelper* Get(); | |
| 37 | |
| 38 // Initialize the settings helper; this will wait till trust is established | |
| 39 // for the enterprise policies then call the callback to notify the caller. | |
| 40 void Initialize(const base::Closure& notify_initialized); | |
| 41 bool is_initialized() const { return is_initialized_; } | |
| 42 | |
| 43 // Getters for various Kiosk Mode values. | |
|
pastarmovj
2012/03/05 15:22:25
I'd rather comment what those are. Also please cha
rkc
2012/03/16 00:17:33
Changed to use base::TimeDelta instead.
| |
| 44 std::string GetScreensaverPath() const; | |
| 45 int64 GetScreensaverTimeout() const; | |
| 46 | |
| 47 private: | |
| 48 friend struct base::DefaultLazyInstanceTraits<KioskModeHelper>; | |
| 49 KioskModeHelper(); | |
| 50 | |
| 51 bool is_initialized_; | |
| 52 | |
| 53 DISALLOW_COPY_AND_ASSIGN(KioskModeHelper); | |
| 54 }; | |
| 55 | |
| 56 | |
|
pastarmovj
2012/03/05 15:22:25
Too many empty lines.
rkc
2012/03/16 00:17:33
Done.
| |
| 57 } // namespace chromeos | |
| 58 | |
| 59 #endif // CHROME_BROWSER_CHROMEOS_KIOSK_MODE_KIOSK_MODE_HELPER_H_ | |
| OLD | NEW |