| Index: chrome/browser/automation/automation_provider_observers.h
|
| diff --git a/chrome/browser/automation/automation_provider_observers.h b/chrome/browser/automation/automation_provider_observers.h
|
| index 653a092079ceff863b6e9a35ad0169e13900a9b2..31edcddc56b5464aeab911568380701dc6d27e3f 100644
|
| --- a/chrome/browser/automation/automation_provider_observers.h
|
| +++ b/chrome/browser/automation/automation_provider_observers.h
|
| @@ -1034,6 +1034,52 @@ class AutomationProviderGetPasswordsObserver : public PasswordStoreConsumer {
|
| scoped_ptr<IPC::Message> reply_message_;
|
| };
|
|
|
| +// Observes when login entries stored in the password store are changed. The
|
| +// notifications are sent on BrowserThread::DB, the thread that interacts with
|
| +// the web database.
|
| +class PasswordStoreLoginsChangedObserver
|
| + : public base::RefCountedThreadSafe<
|
| + PasswordStoreLoginsChangedObserver,
|
| + BrowserThread::DeleteOnUIThread>,
|
| + public NotificationObserver {
|
| + public:
|
| + PasswordStoreLoginsChangedObserver(AutomationProvider* automation,
|
| + IPC::Message* reply_message,
|
| + const std::string result_key);
|
| + virtual ~PasswordStoreLoginsChangedObserver();
|
| +
|
| + // Schedules a task on the BrowserThread::DB thread to register the
|
| + // appropriate observers.
|
| + virtual void Init();
|
| +
|
| + // NotificationObserver interface.
|
| + virtual void Observe(NotificationType type,
|
| + const NotificationSource& source,
|
| + const NotificationDetails& details);
|
| +
|
| + private:
|
| + friend struct BrowserThread::DeleteOnThread<BrowserThread::UI>;
|
| + friend class DeleteTask<PasswordStoreLoginsChangedObserver>;
|
| +
|
| + // Registers the appropriate observers. Called on thread BrowserThread::DB.
|
| + void RegisterObserversTask();
|
| +
|
| + // Sends the |reply_message_| to |automation_| indicating we're done. Called
|
| + // on thread BrowserThread::UI (the main browser UI thread).
|
| + void IndicateDone();
|
| +
|
| + base::WeakPtr<AutomationProvider> automation_;
|
| + scoped_ptr<IPC::Message> reply_message_;
|
| + NotificationRegistrar registrar_;
|
| + const std::string result_key_;
|
| +
|
| + // Used to ensure that thread BrowserThread::UI waits for thread
|
| + // BrowserThread::DB to finish registering observers before proceeding.
|
| + base::WaitableEvent done_event_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(PasswordStoreLoginsChangedObserver);
|
| +};
|
| +
|
| // Allows the automation provider to wait for clearing browser data to finish.
|
| class AutomationProviderBrowsingDataObserver
|
| : public BrowsingDataRemover::Observer {
|
|
|