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

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

Issue 1106193003: Allow user to manually fetch remote commands (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remote-0420
Patch Set: rebase; fixes Created 5 years, 7 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
« no previous file with comments | « no previous file | components/policy/core/common/remote_commands/remote_commands_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/policy_ui.cc
diff --git a/chrome/browser/ui/webui/policy_ui.cc b/chrome/browser/ui/webui/policy_ui.cc
index d2e73e74be61fda360dd2c42cc5b626cb4339405..32aa620785d2b719e101121dab6660ced3269c2d 100644
--- a/chrome/browser/ui/webui/policy_ui.cc
+++ b/chrome/browser/ui/webui/policy_ui.cc
@@ -36,6 +36,7 @@
#include "components/policy/core/common/policy_namespace.h"
#include "components/policy/core/common/policy_service.h"
#include "components/policy/core/common/policy_types.h"
+#include "components/policy/core/common/remote_commands/remote_commands_service.h"
#include "components/policy/core/common/schema.h"
#include "components/policy/core/common/schema_map.h"
#include "components/policy/core/common/schema_registry.h"
@@ -52,6 +53,7 @@
#include "ui/base/l10n/time_format.h"
#if defined(OS_CHROMEOS)
+#include "chrome/browser/browser_process_platform_part.h"
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
#include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h"
#include "chrome/browser/chromeos/policy/device_local_account_policy_service.h"
@@ -807,9 +809,22 @@ void PolicyUIHandler::HandleInitialized(const base::ListValue* args) {
}
void PolicyUIHandler::HandleReloadPolicies(const base::ListValue* args) {
- GetPolicyService()->RefreshPolicies(
- base::Bind(&PolicyUIHandler::OnRefreshPoliciesDone,
- weak_factory_.GetWeakPtr()));
+#if defined(OS_CHROMEOS)
+ // Allow user to manually fetch remote commands, in case invalidation
+ // service is not working properly.
+ // TODO(binjin): evaluate and possibly remove this after invalidation
+ // service is landed and tested. http://crbug.com/480982
+ policy::BrowserPolicyConnectorChromeOS* connector =
+ g_browser_process->platform_part()->browser_policy_connector_chromeos();
+ policy::RemoteCommandsService* remote_commands_service =
+ connector->GetDeviceCloudPolicyManager()
+ ->core()
+ ->remote_commands_service();
+ if (remote_commands_service)
+ remote_commands_service->FetchRemoteCommands();
+#endif
+ GetPolicyService()->RefreshPolicies(base::Bind(
+ &PolicyUIHandler::OnRefreshPoliciesDone, weak_factory_.GetWeakPtr()));
}
void PolicyUIHandler::OnRefreshPoliciesDone() const {
« no previous file with comments | « no previous file | components/policy/core/common/remote_commands/remote_commands_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698