Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(472)

Unified Diff: chrome/browser/chromeos/kiosk_mode/kiosk_mode_helper.h

Issue 9538002: Create Login UI for Demo User. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..bc35cab20c156e8828e2f1f7d94923ae4a018768
--- /dev/null
+++ b/chrome/browser/chromeos/kiosk_mode/kiosk_mode_helper.h
@@ -0,0 +1,60 @@
+// 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;
+}
+
+// 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:
+ static KioskModeHelper* Get();
+
+ // This method checks if Kiosk Mode is enabled or not.
+ // This method does not need the helper to be initialized.
+ bool IsKioskModeEnabled() const;
+
+ // 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.
+ std::string GetScreensaverPath() const;
+ int64 GetScreensaverTimeout() const;
+
+ private:
+ friend struct base::DefaultLazyInstanceTraits<KioskModeHelper>;
+ KioskModeHelper();
+
+ bool is_initialized_;
+
+ DISALLOW_COPY_AND_ASSIGN(KioskModeHelper);
+};
+
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_KIOSK_MODE_KIOSK_MODE_HELPER_H_

Powered by Google App Engine
This is Rietveld 408576698