| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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> |
| 11 #include <set> | 11 #include <set> |
| 12 | 12 |
| 13 #include "base/scoped_ptr.h" |
| 13 #include "chrome/browser/automation/testing_automation_provider.h" | 14 #include "chrome/browser/automation/testing_automation_provider.h" |
| 14 #include "chrome/browser/bookmarks/bookmark_model_observer.h" | 15 #include "chrome/browser/bookmarks/bookmark_model_observer.h" |
| 15 #include "chrome/browser/browsing_data_remover.h" | 16 #include "chrome/browser/browsing_data_remover.h" |
| 17 #include "chrome/browser/cancelable_request.h" |
| 16 #include "chrome/browser/download/download_item.h" | 18 #include "chrome/browser/download/download_item.h" |
| 17 #include "chrome/browser/download/download_manager.h" | 19 #include "chrome/browser/download/download_manager.h" |
| 18 #include "chrome/browser/history/history.h" | 20 #include "chrome/browser/history/history.h" |
| 21 #include "chrome/browser/history/history_types.h" |
| 19 #include "chrome/browser/importer/importer.h" | 22 #include "chrome/browser/importer/importer.h" |
| 20 #include "chrome/browser/importer/importer_data_types.h" | 23 #include "chrome/browser/importer/importer_data_types.h" |
| 21 #include "chrome/browser/password_manager/password_store.h" | 24 #include "chrome/browser/password_manager/password_store.h" |
| 22 #include "chrome/browser/search_engines/template_url_model_observer.h" | 25 #include "chrome/browser/search_engines/template_url_model_observer.h" |
| 23 #include "chrome/browser/tabs/tab_strip_model.h" | 26 #include "chrome/browser/tabs/tab_strip_model.h" |
| 24 #include "chrome/common/notification_observer.h" | 27 #include "chrome/common/notification_observer.h" |
| 25 #include "chrome/common/notification_registrar.h" | 28 #include "chrome/common/notification_registrar.h" |
| 26 #include "chrome/common/notification_type.h" | 29 #include "chrome/common/notification_type.h" |
| 27 #include "chrome/test/automation/automation_messages.h" | 30 #include "chrome/test/automation/automation_messages.h" |
| 28 | 31 |
| 29 class AutocompleteEditModel; | 32 class AutocompleteEditModel; |
| 30 class AutomationProvider; | 33 class AutomationProvider; |
| 31 class Browser; | 34 class Browser; |
| 32 class Extension; | 35 class Extension; |
| 33 class ExtensionProcessManager; | 36 class ExtensionProcessManager; |
| 34 class NavigationController; | 37 class NavigationController; |
| 35 class SavePackage; | 38 class SavePackage; |
| 36 class TabContents; | 39 class TabContents; |
| 37 class TranslateInfoBarDelegate; | 40 class TranslateInfoBarDelegate; |
| 38 | 41 |
| 42 namespace history { |
| 43 class TopSites; |
| 44 } |
| 45 |
| 39 namespace IPC { | 46 namespace IPC { |
| 40 class Message; | 47 class Message; |
| 41 } | 48 } |
| 42 | 49 |
| 43 class InitialLoadObserver : public NotificationObserver { | 50 class InitialLoadObserver : public NotificationObserver { |
| 44 public: | 51 public: |
| 45 InitialLoadObserver(size_t tab_count, AutomationProvider* automation); | 52 InitialLoadObserver(size_t tab_count, AutomationProvider* automation); |
| 46 ~InitialLoadObserver(); | 53 ~InitialLoadObserver(); |
| 47 | 54 |
| 48 virtual void Observe(NotificationType type, | 55 virtual void Observe(NotificationType type, |
| (...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 856 const NotificationDetails& details); | 863 const NotificationDetails& details); |
| 857 | 864 |
| 858 private: | 865 private: |
| 859 NotificationRegistrar registrar_; | 866 NotificationRegistrar registrar_; |
| 860 AutomationProvider* automation_; | 867 AutomationProvider* automation_; |
| 861 IPC::Message* reply_message_; | 868 IPC::Message* reply_message_; |
| 862 | 869 |
| 863 DISALLOW_COPY_AND_ASSIGN(SavePackageNotificationObserver); | 870 DISALLOW_COPY_AND_ASSIGN(SavePackageNotificationObserver); |
| 864 }; | 871 }; |
| 865 | 872 |
| 873 class NTPInfoObserver { |
| 874 public: |
| 875 NTPInfoObserver(AutomationProvider* automation, |
| 876 IPC::Message* reply_message, |
| 877 CancelableRequestConsumer* consumer); |
| 878 |
| 879 private: |
| 880 void OnTopSitesRefreshed(); |
| 881 void OnTopSitesReceived(history::MostVisitedURLList visited_list); |
| 882 |
| 883 AutomationProvider* automation_; |
| 884 IPC::Message* reply_message_; |
| 885 CancelableRequestConsumer* consumer_; |
| 886 scoped_ptr<DictionaryValue> ntp_info_; |
| 887 history::TopSites* top_sites_; |
| 888 |
| 889 DISALLOW_COPY_AND_ASSIGN(NTPInfoObserver); |
| 890 }; |
| 891 |
| 866 // Allows automation provider to wait until the autocomplete edit | 892 // Allows automation provider to wait until the autocomplete edit |
| 867 // has received focus | 893 // has received focus |
| 868 class AutocompleteEditFocusedObserver : public NotificationObserver { | 894 class AutocompleteEditFocusedObserver : public NotificationObserver { |
| 869 public: | 895 public: |
| 870 AutocompleteEditFocusedObserver(AutomationProvider* automation, | 896 AutocompleteEditFocusedObserver(AutomationProvider* automation, |
| 871 AutocompleteEditModel* autocomplete_edit, | 897 AutocompleteEditModel* autocomplete_edit, |
| 872 IPC::Message* reply_message); | 898 IPC::Message* reply_message); |
| 873 | 899 |
| 874 virtual void Observe(NotificationType type, | 900 virtual void Observe(NotificationType type, |
| 875 const NotificationSource& source, | 901 const NotificationSource& source, |
| 876 const NotificationDetails& details); | 902 const NotificationDetails& details); |
| 877 | 903 |
| 878 private: | 904 private: |
| 879 NotificationRegistrar registrar_; | 905 NotificationRegistrar registrar_; |
| 880 AutomationProvider* automation_; | 906 AutomationProvider* automation_; |
| 881 IPC::Message* reply_message_; | 907 IPC::Message* reply_message_; |
| 882 AutocompleteEditModel* autocomplete_edit_model_; | 908 AutocompleteEditModel* autocomplete_edit_model_; |
| 883 | 909 |
| 884 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditFocusedObserver); | 910 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditFocusedObserver); |
| 885 }; | 911 }; |
| 886 | 912 |
| 887 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ | 913 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ |
| OLD | NEW |