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

Unified Diff: chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.cc

Issue 19733003: Implement cloud policy invalidations using the invalidation service framework. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 5 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/chromeos/policy/user_cloud_policy_manager_chromeos.cc
diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.cc b/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.cc
index f08c1a083c8111d372505474f4cff6ea37e0cc6d..cca9531294626f920406d458101409f35eb822d7 100644
--- a/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.cc
+++ b/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.cc
@@ -6,16 +6,19 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
+#include "base/command_line.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.h"
#include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
+#include "chrome/browser/invalidation/invalidation_service_factory.h"
#include "chrome/browser/policy/cloud/cloud_policy_refresh_scheduler.h"
#include "chrome/browser/policy/cloud/resource_cache.h"
#include "chrome/browser/policy/policy_bundle.h"
#include "chrome/browser/policy/policy_domain_descriptor.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "net/url_request/url_request_context_getter.h"
@@ -24,12 +27,14 @@ namespace em = enterprise_management;
namespace policy {
UserCloudPolicyManagerChromeOS::UserCloudPolicyManagerChromeOS(
+ Profile* profile,
scoped_ptr<CloudPolicyStore> store,
scoped_ptr<ResourceCache> resource_cache,
bool wait_for_policy_fetch)
: CloudPolicyManager(
PolicyNamespaceKey(dm_protocol::kChromeUserPolicyType, std::string()),
store.get()),
+ profile_(profile),
store_(store.Pass()),
wait_for_policy_fetch_(wait_for_policy_fetch) {
if (resource_cache) {
@@ -273,6 +278,12 @@ void UserCloudPolicyManagerChromeOS::StartRefreshScheduler() {
core()->StartRefreshScheduler();
core()->TrackRefreshDelayPref(local_state_, prefs::kUserPolicyRefreshRate);
+
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
Joao da Silva 2013/07/23 20:44:47 Check the command line flag on CreateInvalidator i
Steve Condie 2013/07/24 01:42:04 Done.
+ switches::kEnableCloudPolicyPush)) {
+ CreateInvalidator(
+ invalidation::InvalidationServiceFactory::GetForProfile(profile_));
+ }
}
} // namespace policy

Powered by Google App Engine
This is Rietveld 408576698