Chromium Code Reviews| Index: chrome/browser/chromeos/kiosk_mode/kiosk_mode_helper.h |
| diff --git a/chrome/browser/chromeos/kiosk_mode/kiosk_mode_helper.h b/chrome/browser/chromeos/kiosk_mode/kiosk_mode_helper.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ee64927c1248c6e0a9225ef81bec294c2f0a5c54 |
| --- /dev/null |
| +++ b/chrome/browser/chromeos/kiosk_mode/kiosk_mode_helper.h |
| @@ -0,0 +1,59 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_CHROMEOS_KIOSK_MODE_KIOSK_MODE_HELPER_H_ |
| +#define CHROME_BROWSER_CHROMEOS_KIOSK_MODE_KIOSK_MODE_HELPER_H_ |
| +#pragma once |
| + |
| +#include <string> |
| + |
| +#include "base/basictypes.h" |
| +#include "base/callback_forward.h" |
| + |
| +namespace base { |
| +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
|
| +} |
| + |
| +// This class centralizes all our code to get KioskMode settings; since |
| +// KioskMode interferes with normal operations all over Chrome, having all |
| +// data about it pulled from a central location would make future |
| +// refactorings easier. This class also handles getting trust for the policies |
| +// via it's init method. |
| +// |
| +// Note: If Initialize is not called before the various Getters, we'll return |
| +// invalid values. |
| +// |
| +// TODO(rkc): Once the enterprise policy side of this code is checked in, add |
| +// code to pull from the enterprise policy instead of flags and constants. |
| +namespace chromeos { |
| + |
| +class KioskModeHelper { |
| + public: |
| + // This method checks if Kiosk Mode is enabled or not. |
| + static bool IsKioskModeEnabled(); |
| + |
| + static KioskModeHelper* Get(); |
| + |
| + // Initialize the settings helper; this will wait till trust is established |
| + // for the enterprise policies then call the callback to notify the caller. |
| + void Initialize(const base::Closure& notify_initialized); |
| + bool is_initialized() const { return is_initialized_; } |
| + |
| + // 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.
|
| + std::string GetScreensaverPath() const; |
| + int64 GetScreensaverTimeout() const; |
| + |
| + private: |
| + friend struct base::DefaultLazyInstanceTraits<KioskModeHelper>; |
| + KioskModeHelper(); |
| + |
| + bool is_initialized_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(KioskModeHelper); |
| +}; |
| + |
| + |
|
pastarmovj
2012/03/05 15:22:25
Too many empty lines.
rkc
2012/03/16 00:17:33
Done.
|
| +} // namespace chromeos |
| + |
| +#endif // CHROME_BROWSER_CHROMEOS_KIOSK_MODE_KIOSK_MODE_HELPER_H_ |