| Index: chrome/browser/automation/automation_provider_observers.cc
|
| diff --git a/chrome/browser/automation/automation_provider_observers.cc b/chrome/browser/automation/automation_provider_observers.cc
|
| index f7abc4176fcb7030a896a7d7dbaaa57be677348a..acd7faf0c19dbd6fe144bf9c25637c7b9be572e0 100644
|
| --- a/chrome/browser/automation/automation_provider_observers.cc
|
| +++ b/chrome/browser/automation/automation_provider_observers.cc
|
| @@ -43,7 +43,6 @@
|
| #include "chrome/browser/notifications/notification.h"
|
| #include "chrome/browser/notifications/notification_ui_manager.h"
|
| #include "chrome/browser/password_manager/password_store_change.h"
|
| -#include "chrome/browser/policy/browser_policy_connector.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| #include "chrome/browser/renderer_host/chrome_render_message_filter.h"
|
| #include "chrome/browser/search_engines/template_url_service.h"
|
| @@ -2945,92 +2944,6 @@ void BrowserOpenedWithNewProfileNotificationObserver::Observe(
|
| }
|
| }
|
|
|
| -#if defined(ENABLE_CONFIGURATION_POLICY)
|
| -
|
| -PolicyUpdatesObserver::PolicyUpdatesObserver(
|
| - AutomationProvider* automation,
|
| - IPC::Message* reply_message,
|
| - policy::BrowserPolicyConnector* browser_policy_connector)
|
| - : automation_(automation->AsWeakPtr()),
|
| - reply_message_(reply_message) {
|
| - policy::ConfigurationPolicyProvider* providers[] = {
|
| - browser_policy_connector->GetManagedCloudProvider(),
|
| - browser_policy_connector->GetManagedPlatformProvider(),
|
| - browser_policy_connector->GetRecommendedCloudProvider(),
|
| - browser_policy_connector->GetRecommendedPlatformProvider(),
|
| - };
|
| - for (size_t i = 0; i < arraysize(providers); ++i) {
|
| - if (providers[i]) {
|
| - registrars_.push_back(new policy::ConfigurationPolicyObserverRegistrar);
|
| - registrars_.back()->Init(providers[i], this);
|
| - }
|
| - }
|
| - MaybeReply();
|
| -}
|
| -
|
| -PolicyUpdatesObserver::~PolicyUpdatesObserver() {}
|
| -
|
| -// static
|
| -void PolicyUpdatesObserver::PostCallbackAfterPolicyUpdates(
|
| - const base::Closure& callback) {
|
| - // Some policies (e.g. URLBlacklist) post tasks to other message loops before
|
| - // they start enforcing updated policy values; make sure those tasks have
|
| - // finished after a policy update.
|
| - // Updates of the URLBlacklist are done on IO, after building the blacklist
|
| - // on FILE, which is initiated from IO.
|
| - PostTask(BrowserThread::IO,
|
| - base::Bind(&PostTask, BrowserThread::FILE,
|
| - base::Bind(&PostTask, BrowserThread::IO,
|
| - base::Bind(&PostTask, BrowserThread::UI, callback))));
|
| -}
|
| -
|
| -void PolicyUpdatesObserver::OnUpdatePolicy(
|
| - policy::ConfigurationPolicyProvider* provider) {
|
| - std::vector<policy::ConfigurationPolicyObserverRegistrar*>::iterator it;
|
| - for (it = registrars_.begin(); it != registrars_.end(); ++it) {
|
| - if ((*it)->provider() == provider) {
|
| - delete *it;
|
| - registrars_.erase(it);
|
| - MaybeReply();
|
| - return;
|
| - }
|
| - }
|
| -}
|
| -
|
| -void PolicyUpdatesObserver::OnProviderGoingAway(
|
| - policy::ConfigurationPolicyProvider* provider) {
|
| - STLDeleteElements(®istrars_);
|
| - if (automation_) {
|
| - AutomationJSONReply(automation_, reply_message_.release()).SendError(
|
| - "Policy provider went away.");
|
| - }
|
| - delete this;
|
| -}
|
| -
|
| -void PolicyUpdatesObserver::MaybeReply() {
|
| - if (registrars_.empty()) {
|
| - PostCallbackAfterPolicyUpdates(
|
| - base::Bind(&PolicyUpdatesObserver::Reply, base::Owned(this)));
|
| - }
|
| -}
|
| -
|
| -void PolicyUpdatesObserver::Reply() {
|
| - if (automation_) {
|
| - AutomationJSONReply(
|
| - automation_, reply_message_.release()).SendSuccess(NULL);
|
| - }
|
| - // Reply() is only called from MaybeReply(), which makes the callback own
|
| - // |this|; so |this| will be deleted once this method returns.
|
| -}
|
| -
|
| -// static
|
| -void PolicyUpdatesObserver::PostTask(content::BrowserThread::ID id,
|
| - const base::Closure& callback) {
|
| - content::BrowserThread::PostTask(id, FROM_HERE, callback);
|
| -}
|
| -
|
| -#endif // defined(ENABLE_CONFIGURATION_POLICY)
|
| -
|
| ExtensionPopupObserver::ExtensionPopupObserver(
|
| AutomationProvider* automation,
|
| IPC::Message* reply_message,
|
|
|