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

Unified Diff: chrome/browser/automation/automation_provider_observers.h

Issue 10855253: Convert the autofill pyauto tests to browser tests, and remove all the supporting automation hooks … (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: review comments Created 8 years, 4 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/automation/automation_provider_observers.h
===================================================================
--- chrome/browser/automation/automation_provider_observers.h (revision 152427)
+++ chrome/browser/automation/automation_provider_observers.h (working copy)
@@ -1487,112 +1487,6 @@
DISALLOW_COPY_AND_ASSIGN(AppLaunchObserver);
};
-// Observes when Autofill information is displayed in the renderer. This can
-// happen in two different ways: (1) a popup containing Autofill suggestions
-// has been shown in the renderer; (2) a webpage form is filled or previewed
-// with Autofill suggestions. A constructor argument specifies the appropriate
-// notification to wait for.
-class AutofillDisplayedObserver : public content::NotificationObserver {
- public:
- AutofillDisplayedObserver(int notification,
- content::RenderViewHost* render_view_host,
- AutomationProvider* automation,
- IPC::Message* reply_message);
- virtual ~AutofillDisplayedObserver();
-
- // Overridden from content::NotificationObserver:
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) OVERRIDE;
-
- private:
- int notification_;
- content::RenderViewHost* render_view_host_;
- base::WeakPtr<AutomationProvider> automation_;
- scoped_ptr<IPC::Message> reply_message_;
- content::NotificationRegistrar registrar_;
-
- DISALLOW_COPY_AND_ASSIGN(AutofillDisplayedObserver);
-};
-
-// Observes when a specified number of autofill profiles and credit cards have
-// been changed in the WebDataService. The notifications are sent on the DB
-// thread, the thread that interacts with the database.
-class AutofillChangedObserver
- : public base::RefCountedThreadSafe<
- AutofillChangedObserver,
- content::BrowserThread::DeleteOnUIThread>,
- public content::NotificationObserver {
- public:
- AutofillChangedObserver(AutomationProvider* automation,
- IPC::Message* reply_message,
- int num_profiles,
- int num_credit_cards);
-
- // Schedules a task on the DB thread to register the appropriate observers.
- virtual void Init();
-
- // Overridden from content::NotificationObserver:
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) OVERRIDE;
-
- private:
- friend struct content::BrowserThread::DeleteOnThread<
- content::BrowserThread::UI>;
- ~AutofillChangedObserver();
- friend class base::DeleteHelper<AutofillChangedObserver>;
-
- // Registers the appropriate observers. Called on the DB thread.
- void RegisterObserversTask();
-
- // Sends the |reply_message_| to |automation_| indicating we're done. Called
- // on the UI thread.
- void IndicateDone();
-
- base::WeakPtr<AutomationProvider> automation_;
- scoped_ptr<IPC::Message> reply_message_;
- scoped_ptr<content::NotificationRegistrar> registrar_;
- int num_profiles_;
- int num_credit_cards_;
-
- // Used to ensure that the UI thread waits for the DB thread to finish
- // registering observers before proceeding.
- base::WaitableEvent done_event_;
-
- DISALLOW_COPY_AND_ASSIGN(AutofillChangedObserver);
-};
-
-// Observes when an Autofill form submitted via a webpage has been processed.
-// This observer also takes care of accepting any infobars that appear as a
-// result of submitting the webpage form (submitting credit card information
-// causes a confirm infobar to appear).
-class AutofillFormSubmittedObserver
- : public PersonalDataManagerObserver,
- public content::NotificationObserver {
- public:
- AutofillFormSubmittedObserver(AutomationProvider* automation,
- IPC::Message* reply_message,
- PersonalDataManager* pdm);
- virtual ~AutofillFormSubmittedObserver();
-
- // PersonalDataManagerObserver interface.
- virtual void OnPersonalDataChanged() OVERRIDE;
- virtual void OnInsufficientFormData() OVERRIDE;
-
- // Overridden from content::NotificationObserver:
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) OVERRIDE;
-
- private:
- content::NotificationRegistrar registrar_;
- base::WeakPtr<AutomationProvider> automation_;
- scoped_ptr<IPC::Message> reply_message_;
- PersonalDataManager* pdm_;
- InfoBarTabHelper* infobar_helper_;
-};
-
// Allows the automation provider to wait until all the notification
// processes are ready.
class GetAllNotificationsObserver : public content::NotificationObserver {
« no previous file with comments | « chrome/browser/autofill/personal_data_manager.h ('k') | chrome/browser/automation/automation_provider_observers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698