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

Unified Diff: chrome/browser/ui/webui/policy_ui.h

Issue 7828042: Implemented status section functionality for about:policy. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 4 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/ui/webui/policy_ui.h
diff --git a/chrome/browser/ui/webui/policy_ui.h b/chrome/browser/ui/webui/policy_ui.h
index f773a4bdff31cdde246883fc696a2e2a937cf679..8e40537eb664a53dce0b2bc72c16c950d46f88a6 100644
--- a/chrome/browser/ui/webui/policy_ui.h
+++ b/chrome/browser/ui/webui/policy_ui.h
@@ -7,13 +7,16 @@
#pragma once
#include "base/scoped_ptr.h"
+#include "base/time.h"
#include "base/values.h"
+#include "chrome/browser/policy/cloud_policy_subsystem.h"
#include "chrome/browser/policy/configuration_policy_reader.h"
#include "chrome/browser/ui/webui/chrome_web_ui.h"
#include "content/common/notification_observer.h"
// The base class handler of Javascript messages of the about:policy page.
-class PolicyUIHandler : public WebUIMessageHandler {
+class PolicyUIHandler : public WebUIMessageHandler,
+ public policy::PolicyStatus::Observer {
public:
PolicyUIHandler();
virtual ~PolicyUIHandler();
@@ -22,11 +25,38 @@ class PolicyUIHandler : public WebUIMessageHandler {
virtual WebUIMessageHandler* Attach(WebUI* web_ui) OVERRIDE;
virtual void RegisterMessages() OVERRIDE;
+ // policy::ConfigurationPolicyReader::Observer implementation.
+ virtual void OnPolicyValuesChanged() OVERRIDE;
+
private:
typedef policy::ConfigurationPolicyReader ConfigurationPolicyReader;
+ typedef policy::CloudPolicySubsystem CloudPolicySubsystem;
+
+ // Callback for the "requestData" message.
+ void HandleRequestData(const ListValue* args);
+
+ // Callback for the "updateFetchTimes" message.
+ void HandleUpdateFetchTimes(const ListValue* args);
+
+ // Callback for the "fetchPolicy" message.
+ void HandleFetchPolicy(const ListValue* args);
+
+ // Send requested data to UI. If is_policy_update is true, the data is sent as
+ // a policy update, otherwise it is sent normally.
+ void SendDataToUI(bool is_policy_update);
+
+ // Returns a DictionaryValue pointer containing information about the status
+ // of the policy system.
+ DictionaryValue* GetStatusData(bool is_policy_update);
+
+ // Returns the time at which policy was last fetched by the
+ // CloudPolicySubsystem |subsystem| in string form.
+ string16 GetLastFetchTime(CloudPolicySubsystem* subsystem);
- // Callback for the "requestPolicyData" message.
- void HandleRequestPolicyData(const ListValue* args);
+ // Returns the string corresponding to the CloudPolicySubsystem::ErrorDetails
+ // enum value |error_details|.
+ static string16 CreateStatusMessageString(
+ CloudPolicySubsystem::ErrorDetails error_details);
scoped_ptr<policy::PolicyStatus> policy_status_;

Powered by Google App Engine
This is Rietveld 408576698