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

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

Issue 5088001: Add pyauto hook for getting and manipulating the data underneath the NTP. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/test/functional
Patch Set: ... Created 10 years, 1 month 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
OLDNEW
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/automation_provider_json.h" 14 #include "chrome/browser/automation/automation_provider_json.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/automation_messages.h" 27 #include "chrome/common/automation_messages.h"
25 #include "chrome/common/notification_observer.h" 28 #include "chrome/common/notification_observer.h"
26 #include "chrome/common/notification_registrar.h" 29 #include "chrome/common/notification_registrar.h"
27 #include "chrome/common/notification_type.h" 30 #include "chrome/common/notification_type.h"
28 31
29 class AutocompleteEditModel; 32 class AutocompleteEditModel;
30 class AutomationProvider; 33 class AutomationProvider;
31 class BalloonCollection; 34 class BalloonCollection;
32 class Browser; 35 class Browser;
33 class Extension; 36 class Extension;
34 class ExtensionProcessManager; 37 class ExtensionProcessManager;
35 class NavigationController; 38 class NavigationController;
36 class RenderViewHost; 39 class RenderViewHost;
37 class SavePackage; 40 class SavePackage;
38 class TabContents; 41 class TabContents;
39 class TranslateInfoBarDelegate; 42 class TranslateInfoBarDelegate;
40 43
44 namespace history {
45 class TopSites;
46 }
47
41 namespace IPC { 48 namespace IPC {
42 class Message; 49 class Message;
43 } 50 }
44 51
45 class InitialLoadObserver : public NotificationObserver { 52 class InitialLoadObserver : public NotificationObserver {
46 public: 53 public:
47 InitialLoadObserver(size_t tab_count, AutomationProvider* automation); 54 InitialLoadObserver(size_t tab_count, AutomationProvider* automation);
48 ~InitialLoadObserver(); 55 ~InitialLoadObserver();
49 56
50 virtual void Observe(NotificationType type, 57 virtual void Observe(NotificationType type,
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 AutomationProvider* automation_; 920 AutomationProvider* automation_;
914 IPC::Message* reply_message_; 921 IPC::Message* reply_message_;
915 RenderViewHost* render_view_; 922 RenderViewHost* render_view_;
916 FilePath image_path_; 923 FilePath image_path_;
917 bool received_width_; 924 bool received_width_;
918 gfx::Size entire_page_size_; 925 gfx::Size entire_page_size_;
919 926
920 DISALLOW_COPY_AND_ASSIGN(PageSnapshotTaker); 927 DISALLOW_COPY_AND_ASSIGN(PageSnapshotTaker);
921 }; 928 };
922 929
930 class NTPInfoObserver : public NotificationObserver {
931 public:
932 NTPInfoObserver(AutomationProvider* automation,
933 IPC::Message* reply_message,
934 CancelableRequestConsumer* consumer);
935
936 virtual void Observe(NotificationType type,
937 const NotificationSource& source,
938 const NotificationDetails& details);
939
940 private:
941 void OnTopSitesLoaded();
942 void OnTopSitesReceived(const history::MostVisitedURLList& visited_list);
943
944 AutomationProvider* automation_;
945 IPC::Message* reply_message_;
946 CancelableRequestConsumer* consumer_;
947 CancelableRequestProvider::Handle request_;
948 scoped_ptr<DictionaryValue> ntp_info_;
949 history::TopSites* top_sites_;
950 NotificationRegistrar registrar_;
951
952 DISALLOW_COPY_AND_ASSIGN(NTPInfoObserver);
953 };
954
923 // Allows automation provider to wait until the autocomplete edit 955 // Allows automation provider to wait until the autocomplete edit
924 // has received focus 956 // has received focus
925 class AutocompleteEditFocusedObserver : public NotificationObserver { 957 class AutocompleteEditFocusedObserver : public NotificationObserver {
926 public: 958 public:
927 AutocompleteEditFocusedObserver(AutomationProvider* automation, 959 AutocompleteEditFocusedObserver(AutomationProvider* automation,
928 AutocompleteEditModel* autocomplete_edit, 960 AutocompleteEditModel* autocomplete_edit,
929 IPC::Message* reply_message); 961 IPC::Message* reply_message);
930 962
931 virtual void Observe(NotificationType type, 963 virtual void Observe(NotificationType type,
932 const NotificationSource& source, 964 const NotificationSource& source,
(...skipping 22 matching lines...) Expand all
955 private: 987 private:
956 AutomationJSONReply reply_; 988 AutomationJSONReply reply_;
957 BalloonCollection* collection_; 989 BalloonCollection* collection_;
958 int count_; 990 int count_;
959 991
960 DISALLOW_COPY_AND_ASSIGN(OnNotificationBalloonCountObserver); 992 DISALLOW_COPY_AND_ASSIGN(OnNotificationBalloonCountObserver);
961 }; 993 };
962 994
963 995
964 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ 996 #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') | chrome/browser/history/top_sites.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698