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

Unified Diff: chrome/browser/chromeos/policy/login_screen_power_management_policy.h

Issue 18153007: Add policies to control power management on the Chrome OS login screen (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Correct example in policy_templates.json. Created 7 years, 5 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/policy/login_screen_power_management_policy.h
diff --git a/chrome/browser/chromeos/policy/login_screen_power_management_policy.h b/chrome/browser/chromeos/policy/login_screen_power_management_policy.h
new file mode 100644
index 0000000000000000000000000000000000000000..c651d06770cbcce214ff1cb695ff55d0566b3d37
--- /dev/null
+++ b/chrome/browser/chromeos/policy/login_screen_power_management_policy.h
@@ -0,0 +1,61 @@
+// Copyright 2013 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_POLICY_LOGIN_SCREEN_POWER_MANAGEMENT_POLICY_H_
+#define CHROME_BROWSER_CHROMEOS_POLICY_LOGIN_SCREEN_POWER_MANAGEMENT_POLICY_H_
+
+#include <string>
+
+#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
+
+namespace base {
+class Value;
+}
+
+namespace policy {
+
+class PolicyErrorMap;
+
+// Parses power management policy encoded as a JSON string and extracts the
+// individual settings.
+// TODO(bartfab): Remove this code once the policy system has full support for
+// the 'dict' policy type, parsing JSON strings and verifying them against a
+// JSON schema internally. http://crbug.com/258339
+class LoginScreenPowerManagementPolicy {
+ public:
+ LoginScreenPowerManagementPolicy();
+ ~LoginScreenPowerManagementPolicy();
+
+ bool Init(const std::string& json, PolicyErrorMap* errors);
+
+ const base::Value* GetScreenDimDelayAC() const;
+ const base::Value* GetScreenOffDelayAC() const;
+ const base::Value* GetIdleDelayAC() const;
+ const base::Value* GetScreenDimDelayBattery() const;
+ const base::Value* GetScreenOffDelayBattery() const;
+ const base::Value* GetIdleDelayBattery() const;
+ const base::Value* GetIdleActionAC() const;
+ const base::Value* GetIdleActionBattery() const;
+ const base::Value* GetLidCloseAction() const;
+ const base::Value* GetUserActivityScreenDimDelayScale() const;
+
+ private:
+ scoped_ptr<base::Value> screen_dim_delay_ac_;
+ scoped_ptr<base::Value> screen_off_delay_ac_;
+ scoped_ptr<base::Value> idle_delay_ac_;
+ scoped_ptr<base::Value> screen_dim_delay_battery_;
+ scoped_ptr<base::Value> screen_off_delay_battery_;
+ scoped_ptr<base::Value> idle_delay_battery_;
+ scoped_ptr<base::Value> idle_action_ac_;
+ scoped_ptr<base::Value> idle_action_battery_;
+ scoped_ptr<base::Value> lid_close_action_;
+ scoped_ptr<base::Value> user_activity_screen_dim_delay_scale_;
+
+ DISALLOW_COPY_AND_ASSIGN(LoginScreenPowerManagementPolicy);
+};
+
+} // namespace policy
+
+#endif // CHROME_BROWSER_CHROMEOS_POLICY_LOGIN_SCREEN_POWER_MANAGEMENT_POLICY_H_

Powered by Google App Engine
This is Rietveld 408576698