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

Unified Diff: trunk/src/chrome/browser/chromeos/policy/device_local_account_policy_provider.cc

Issue 343103005: Revert 278518 "Wire up component cloud policy to device local ac..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 6 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: trunk/src/chrome/browser/chromeos/policy/device_local_account_policy_provider.cc
===================================================================
--- trunk/src/chrome/browser/chromeos/policy/device_local_account_policy_provider.cc (revision 278641)
+++ trunk/src/chrome/browser/chromeos/policy/device_local_account_policy_provider.cc (working copy)
@@ -5,7 +5,6 @@
#include "chrome/browser/chromeos/policy/device_local_account_policy_provider.h"
#include "base/bind.h"
-#include "base/command_line.h"
#include "base/values.h"
#include "chrome/browser/chromeos/policy/device_local_account.h"
#include "chrome/browser/chromeos/policy/device_local_account_external_data_manager.h"
@@ -15,9 +14,6 @@
#include "components/policy/core/common/policy_bundle.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/core/common/policy_namespace.h"
-#include "components/policy/core/common/policy_switches.h"
-#include "content/public/browser/browser_thread.h"
-#include "net/url_request/url_request_context_getter.h"
#include "policy/policy_constants.h"
namespace policy {
@@ -98,19 +94,10 @@
return provider.Pass();
}
-void DeviceLocalAccountPolicyProvider::Init(SchemaRegistry* schema_registry) {
- ConfigurationPolicyProvider::Init(schema_registry);
- MaybeCreateComponentPolicyService();
-}
-
bool DeviceLocalAccountPolicyProvider::IsInitializationComplete(
PolicyDomain domain) const {
if (domain == POLICY_DOMAIN_CHROME)
return store_initialized_;
- if (ComponentCloudPolicyService::SupportsDomain(domain) &&
- component_policy_service_) {
- return component_policy_service_->is_initialized();
- }
return true;
}
@@ -126,37 +113,16 @@
}
}
-void DeviceLocalAccountPolicyProvider::Shutdown() {
- component_policy_service_.reset();
- ConfigurationPolicyProvider::Shutdown();
-}
-
void DeviceLocalAccountPolicyProvider::OnPolicyUpdated(
const std::string& user_id) {
- if (user_id == user_id_) {
- MaybeCreateComponentPolicyService();
+ if (user_id == user_id_)
UpdateFromBroker();
- }
}
void DeviceLocalAccountPolicyProvider::OnDeviceLocalAccountsChanged() {
- MaybeCreateComponentPolicyService();
UpdateFromBroker();
}
-void DeviceLocalAccountPolicyProvider::OnBrokerShutdown(
- DeviceLocalAccountPolicyBroker* broker) {
- if (broker->user_id() == user_id_) {
- // The |component_policy_service_| relies on the broker's CloudPolicyCore,
- // so destroy it if the broker is going away.
- component_policy_service_.reset();
- }
-}
-
-void DeviceLocalAccountPolicyProvider::OnComponentCloudPolicyUpdated() {
- UpdateFromBroker();
-}
-
DeviceLocalAccountPolicyBroker* DeviceLocalAccountPolicyProvider::GetBroker() {
return service_->GetBrokerForUser(user_id_);
}
@@ -187,9 +153,6 @@
bundle->CopyFrom(policies());
}
- if (component_policy_service_)
- bundle->MergeFrom(component_policy_service_->policy());
-
// Apply overrides.
if (chrome_policy_overrides_) {
PolicyMap& chrome_policy =
@@ -206,35 +169,4 @@
UpdatePolicy(bundle.Pass());
}
-void DeviceLocalAccountPolicyProvider::MaybeCreateComponentPolicyService() {
- if (component_policy_service_)
- return; // Already started.
-
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDisableComponentCloudPolicy)) {
- // Disabled via the command line.
- return;
- }
-
- DeviceLocalAccountPolicyBroker* broker = GetBroker();
- if (!broker || !schema_registry())
- return; // Missing broker or not initialized yet.
-
- scoped_ptr<ResourceCache> resource_cache(
- new ResourceCache(broker->GetComponentPolicyCachePath(),
- content::BrowserThread::GetMessageLoopProxyForThread(
- content::BrowserThread::FILE)));
-
- component_policy_service_.reset(new ComponentCloudPolicyService(
- this,
- schema_registry(),
- broker->core(),
- resource_cache.Pass(),
- service_->request_context(),
- content::BrowserThread::GetMessageLoopProxyForThread(
- content::BrowserThread::FILE),
- content::BrowserThread::GetMessageLoopProxyForThread(
- content::BrowserThread::IO)));
-}
-
} // namespace policy

Powered by Google App Engine
This is Rietveld 408576698