| 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_;
|
|
|
|
|