Chromium Code Reviews| 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..70c4dcf5e3c2cc3b0d7339360b23f37458444138 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,48 @@ 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; |
|
James Hawkins
2011/09/05 22:10:38
I'm not a fan of these typedefs. They're essential
simo
2011/09/07 12:18:16
Done.
|
| + |
| + // Callback for the "requestData" message. |
| + void HandleRequestData(const ListValue* args); |
|
James Hawkins
2011/09/05 22:10:38
Document the param. Specify unused if it's unused.
simo
2011/09/07 12:18:16
Done.
|
| + |
| + // 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(); |
| + |
| + // Fetches policy if the appropriate device tokens are available. Returns |
| + // true, if any policy was fetched (device or user), returns true. Returns |
|
James Hawkins
2011/09/05 22:10:38
You specified 'returns true' twice.
simo
2011/09/07 12:18:16
Done.
|
| + // false otherwise. |
| + bool FetchPolicyIfTokensAvailable(); |
| + |
| + // Returns the time at which policy was last fetched by the |
| + // CloudPolicySubsystem |subsystem| in string form. |
| + string16 GetLastFetchTime(CloudPolicySubsystem* subsystem); |
| + |
| + // Gets device ids for for both device and user policy and writes them to |
| + // |result|. |
|
James Hawkins
2011/09/05 22:10:38
s/result/results/. Should document whether |result
simo
2011/09/07 12:18:16
I have changed the method signature.
|
| + void GetDeviceIds(DictionaryValue* results); |
| + |
| + // Gets policy fetch intervals for both device and user policy and writes them |
| + // to |result|. |
| + void GetPolicyFetchIntervals(DictionaryValue* results); |
| - // 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_; |