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

Side by Side Diff: chrome/browser/automation/automation_provider_observers.h

Issue 10236003: Added RefreshPolicies to PolicyService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/automation/automation_provider_observers.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ 5 #ifndef CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_
6 #define CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ 6 #define CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_
7 #pragma once 7 #pragma once
8 8
9 #include <deque> 9 #include <deque>
10 #include <map> 10 #include <map>
(...skipping 24 matching lines...) Expand all
35 #include "chrome/browser/chromeos/options/take_photo_dialog.h" 35 #include "chrome/browser/chromeos/options/take_photo_dialog.h"
36 #endif // defined(OS_CHROMEOS) 36 #endif // defined(OS_CHROMEOS)
37 #include "chrome/browser/cancelable_request.h" 37 #include "chrome/browser/cancelable_request.h"
38 #include "chrome/browser/history/history.h" 38 #include "chrome/browser/history/history.h"
39 #include "chrome/browser/history/history_types.h" 39 #include "chrome/browser/history/history_types.h"
40 #include "chrome/browser/importer/importer_data_types.h" 40 #include "chrome/browser/importer/importer_data_types.h"
41 #include "chrome/browser/importer/importer_progress_observer.h" 41 #include "chrome/browser/importer/importer_progress_observer.h"
42 #include "chrome/browser/memory_details.h" 42 #include "chrome/browser/memory_details.h"
43 #include "chrome/browser/password_manager/password_store_change.h" 43 #include "chrome/browser/password_manager/password_store_change.h"
44 #include "chrome/browser/password_manager/password_store_consumer.h" 44 #include "chrome/browser/password_manager/password_store_consumer.h"
45 #include "chrome/browser/policy/configuration_policy_provider.h"
46 #include "chrome/browser/search_engines/template_url_service_observer.h" 45 #include "chrome/browser/search_engines/template_url_service_observer.h"
47 #include "chrome/browser/tabs/tab_strip_model.h" 46 #include "chrome/browser/tabs/tab_strip_model.h"
48 #include "chrome/common/automation_constants.h" 47 #include "chrome/common/automation_constants.h"
49 #include "chrome/common/extensions/extension_constants.h" 48 #include "chrome/common/extensions/extension_constants.h"
50 #include "content/public/browser/download_item.h" 49 #include "content/public/browser/download_item.h"
51 #include "content/public/browser/download_manager.h" 50 #include "content/public/browser/download_manager.h"
52 #include "content/public/browser/notification_observer.h" 51 #include "content/public/browser/notification_observer.h"
53 #include "content/public/browser/notification_registrar.h" 52 #include "content/public/browser/notification_registrar.h"
54 #include "content/public/browser/notification_types.h" 53 #include "content/public/browser/notification_types.h"
55 #include "ui/gfx/size.h" 54 #include "ui/gfx/size.h"
(...skipping 1732 matching lines...) Expand 10 before | Expand all | Expand 10 after
1788 1787
1789 private: 1788 private:
1790 content::NotificationRegistrar registrar_; 1789 content::NotificationRegistrar registrar_;
1791 base::WeakPtr<AutomationProvider> automation_; 1790 base::WeakPtr<AutomationProvider> automation_;
1792 scoped_ptr<IPC::Message> reply_message_; 1791 scoped_ptr<IPC::Message> reply_message_;
1793 int new_window_id_; 1792 int new_window_id_;
1794 1793
1795 DISALLOW_COPY_AND_ASSIGN(BrowserOpenedWithNewProfileNotificationObserver); 1794 DISALLOW_COPY_AND_ASSIGN(BrowserOpenedWithNewProfileNotificationObserver);
1796 }; 1795 };
1797 1796
1798 #if defined(ENABLE_CONFIGURATION_POLICY)
1799
1800 // Waits for a policy refresh on each policy provider available. Refreshes
1801 // can be triggered by invoking |connector|->RefreshPolicies().
1802 // Deletes itself when done.
1803 class PolicyUpdatesObserver
1804 : public policy::ConfigurationPolicyProvider::Observer {
1805 public:
1806 PolicyUpdatesObserver(AutomationProvider* automation,
1807 IPC::Message* reply_message,
1808 policy::BrowserPolicyConnector* connector);
1809 virtual ~PolicyUpdatesObserver();
1810
1811 // Invokes |callback| on the UI thread after policies that have changed
1812 // recently are ready and being enforced.
1813 static void PostCallbackAfterPolicyUpdates(const base::Closure& callback);
1814
1815 private:
1816 virtual void OnUpdatePolicy(
1817 policy::ConfigurationPolicyProvider* provider) OVERRIDE;
1818 virtual void OnProviderGoingAway(
1819 policy::ConfigurationPolicyProvider* provider) OVERRIDE;
1820 void MaybeReply();
1821 void Reply();
1822
1823 // Helper for WaitForPoliciesToBeReadyAndThen that resolves the overloading
1824 // of BrowserThread::PostTask within Bind calls.
1825 static void PostTask(content::BrowserThread::ID id,
1826 const base::Closure& callback);
1827
1828 base::WeakPtr<AutomationProvider> automation_;
1829 scoped_ptr<IPC::Message> reply_message_;
1830 std::vector<policy::ConfigurationPolicyObserverRegistrar*> registrars_;
1831
1832 DISALLOW_COPY_AND_ASSIGN(PolicyUpdatesObserver);
1833 };
1834
1835 #endif // defined(ENABLE_CONFIGURATION_POLICY)
1836
1837 // Waits for an extension popup to appear and load. 1797 // Waits for an extension popup to appear and load.
1838 class ExtensionPopupObserver : public content::NotificationObserver { 1798 class ExtensionPopupObserver : public content::NotificationObserver {
1839 public: 1799 public:
1840 ExtensionPopupObserver( 1800 ExtensionPopupObserver(
1841 AutomationProvider* automation, 1801 AutomationProvider* automation,
1842 IPC::Message* reply_message, 1802 IPC::Message* reply_message,
1843 const std::string& extension_id); 1803 const std::string& extension_id);
1844 ~ExtensionPopupObserver(); 1804 ~ExtensionPopupObserver();
1845 1805
1846 virtual void Observe(int type, 1806 virtual void Observe(int type,
1847 const content::NotificationSource& source, 1807 const content::NotificationSource& source,
1848 const content::NotificationDetails& details) OVERRIDE; 1808 const content::NotificationDetails& details) OVERRIDE;
1849 1809
1850 private: 1810 private:
1851 base::WeakPtr<AutomationProvider> automation_; 1811 base::WeakPtr<AutomationProvider> automation_;
1852 scoped_ptr<IPC::Message> reply_message_; 1812 scoped_ptr<IPC::Message> reply_message_;
1853 std::string extension_id_; 1813 std::string extension_id_;
1854 content::NotificationRegistrar registrar_; 1814 content::NotificationRegistrar registrar_;
1855 1815
1856 DISALLOW_COPY_AND_ASSIGN(ExtensionPopupObserver); 1816 DISALLOW_COPY_AND_ASSIGN(ExtensionPopupObserver);
1857 }; 1817 };
1858 1818
1859 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ 1819 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/automation/automation_provider_observers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698