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

Unified 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 side-by-side diff with in-line comments
Download patch
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 cfa6e146c652138fddbf008a910ac3766825fd5b..deb38fed66dd76d9b81ee5b76dda1bd90c225a08 100644
--- a/chrome/browser/automation/automation_provider_observers.h
+++ b/chrome/browser/automation/automation_provider_observers.h
@@ -10,12 +10,15 @@
#include <map>
#include <set>
+#include "base/scoped_ptr.h"
#include "chrome/browser/automation/automation_provider_json.h"
#include "chrome/browser/bookmarks/bookmark_model_observer.h"
#include "chrome/browser/browsing_data_remover.h"
+#include "chrome/browser/cancelable_request.h"
#include "chrome/browser/download/download_item.h"
#include "chrome/browser/download/download_manager.h"
#include "chrome/browser/history/history.h"
+#include "chrome/browser/history/history_types.h"
#include "chrome/browser/importer/importer.h"
#include "chrome/browser/importer/importer_data_types.h"
#include "chrome/browser/password_manager/password_store.h"
@@ -38,6 +41,10 @@ class SavePackage;
class TabContents;
class TranslateInfoBarDelegate;
+namespace history {
+class TopSites;
+}
+
namespace IPC {
class Message;
}
@@ -920,6 +927,31 @@ class PageSnapshotTaker : public DomOperationObserver {
DISALLOW_COPY_AND_ASSIGN(PageSnapshotTaker);
};
+class NTPInfoObserver : public NotificationObserver {
+ public:
+ NTPInfoObserver(AutomationProvider* automation,
+ IPC::Message* reply_message,
+ CancelableRequestConsumer* consumer);
+
+ virtual void Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details);
+
+ private:
+ void OnTopSitesLoaded();
+ void OnTopSitesReceived(const history::MostVisitedURLList& visited_list);
+
+ AutomationProvider* automation_;
+ IPC::Message* reply_message_;
+ CancelableRequestConsumer* consumer_;
+ CancelableRequestProvider::Handle request_;
+ scoped_ptr<DictionaryValue> ntp_info_;
+ history::TopSites* top_sites_;
+ NotificationRegistrar registrar_;
+
+ DISALLOW_COPY_AND_ASSIGN(NTPInfoObserver);
+};
+
// Allows automation provider to wait until the autocomplete edit
// has received focus
class AutocompleteEditFocusedObserver : public NotificationObserver {
« 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