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

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

Powered by Google App Engine
This is Rietveld 408576698