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

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

Issue 14977013: Delete Automation[Tab/Renderer]Helper and users. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update now that 202087 is committed Created 7 years, 7 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
diff --git a/chrome/browser/automation/automation_provider_observers.h b/chrome/browser/automation/automation_provider_observers.h
index bed5996fffc38b2c42cd66406cf21b5ce377582a..9d7406d29a1a89a444e0a8e6ef9c4b1559a8b2c7 100644
--- a/chrome/browser/automation/automation_provider_observers.h
+++ b/chrome/browser/automation/automation_provider_observers.h
@@ -19,7 +19,6 @@
#include "base/synchronization/waitable_event.h"
#include "base/values.h"
#include "chrome/browser/automation/automation_provider_json.h"
-#include "chrome/browser/automation/automation_tab_helper.h"
#include "chrome/browser/bookmarks/bookmark_model_observer.h"
#include "components/autofill/browser/personal_data_manager.h"
#include "components/autofill/browser/personal_data_manager_observer.h"
@@ -53,7 +52,6 @@
#include "ui/gfx/point.h"
#include "ui/gfx/size.h"
-struct AutomationMouseEvent;
class AutomationProvider;
class BalloonCollection;
class Browser;
@@ -1266,91 +1264,6 @@ class SavePackageNotificationObserver
DISALLOW_COPY_AND_ASSIGN(SavePackageNotificationObserver);
};
-// This class manages taking a snapshot of a page.
-class PageSnapshotTaker : public TabEventObserver,
- public content::NotificationObserver {
- public:
- PageSnapshotTaker(AutomationProvider* automation,
- IPC::Message* reply_message,
- content::WebContents* web_contents,
- const base::FilePath& path);
- virtual ~PageSnapshotTaker();
-
- // Start the process of taking a snapshot of the entire page.
- void Start();
-
- private:
- // Overridden from TabEventObserver:
- virtual void OnSnapshotEntirePageACK(
- bool success,
- const std::vector<unsigned char>& png_data,
- const std::string& error_msg) OVERRIDE;
-
- // Overridden from content::NotificationObserver:
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) OVERRIDE;
-
- // Helper method to send a response back to the client. Deletes this.
- void SendMessage(bool success, const std::string& error_msg);
-
- base::WeakPtr<AutomationProvider> automation_;
- scoped_ptr<IPC::Message> reply_message_;
- content::WebContents* web_contents_;
- base::FilePath image_path_;
- content::NotificationRegistrar registrar_;
-
- DISALLOW_COPY_AND_ASSIGN(PageSnapshotTaker);
-};
-
-// Processes automation mouse events and invokes a callback when processing
-// has completed.
-class AutomationMouseEventProcessor : public content::RenderViewHostObserver,
- public content::NotificationObserver {
- public:
- typedef base::Callback<void(const gfx::Point&)> CompletionCallback;
- typedef base::Callback<void(const automation::Error&)> ErrorCallback;
-
- // Creates a new processor which immediately processes the given event.
- // Either the |completion_callback| or |error_callback| will be called
- // exactly once. After invoking the callback, this class will delete itself.
- // The |completion_callback| will be given the point at which the mouse event
- // occurred.
- AutomationMouseEventProcessor(content::RenderViewHost* render_view_host,
- const AutomationMouseEvent& event,
- const CompletionCallback& completion_callback,
- const ErrorCallback& error_callback);
- virtual ~AutomationMouseEventProcessor();
-
- private:
- // IPC message handlers.
- virtual void OnWillProcessMouseEventAt(const gfx::Point& point);
- virtual void OnProcessMouseEventACK(
- bool success,
- const std::string& error_msg);
-
- // Overriden from RenderViewHostObserver.
- virtual void RenderViewHostDestroyed(content::RenderViewHost* host) OVERRIDE;
- virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
-
- // Overridden from content::NotificationObserver:
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) OVERRIDE;
-
- // Helper method to invoke the appropriate callback. Uses the given error
- // only if the operation failed. Deletes this.
- void InvokeCallback(const automation::Error& error);
-
- content::NotificationRegistrar registrar_;
- CompletionCallback completion_callback_;
- ErrorCallback error_callback_;
- bool has_point_;
- gfx::Point point_;
-
- DISALLOW_COPY_AND_ASSIGN(AutomationMouseEventProcessor);
-};
-
class NTPInfoObserver : public content::NotificationObserver {
public:
NTPInfoObserver(AutomationProvider* automation, IPC::Message* reply_message);
@@ -1525,45 +1438,6 @@ class InputEventAckNotificationObserver : public content::NotificationObserver {
DISALLOW_COPY_AND_ASSIGN(InputEventAckNotificationObserver);
};
-// Allows the automation provider to wait for all render views to finish any
-// pending loads. This wait is only guaranteed for views that exist at the
-// observer's creation. Will send a message on construction if no views are
-// currently loading.
-class AllViewsStoppedLoadingObserver : public TabEventObserver,
- public content::NotificationObserver {
- public:
- AllViewsStoppedLoadingObserver(
- AutomationProvider* automation,
- IPC::Message* reply_message,
- ExtensionProcessManager* extension_process_manager);
- virtual ~AllViewsStoppedLoadingObserver();
-
- // TabEventObserver implementation.
- virtual void OnFirstPendingLoad(content::WebContents* web_contents) OVERRIDE;
- virtual void OnNoMorePendingLoads(
- content::WebContents* web_contents) OVERRIDE;
-
- // Overridden from content::NotificationObserver:
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) OVERRIDE;
-
- private:
- typedef std::set<content::WebContents*> TabSet;
-
- // Checks if there are no pending loads. If none, it will send an automation
- // relpy and delete itself.
- void CheckIfNoMorePendingLoads();
-
- base::WeakPtr<AutomationProvider> automation_;
- scoped_ptr<IPC::Message> reply_message_;
- ExtensionProcessManager* extension_process_manager_;
- content::NotificationRegistrar registrar_;
- TabSet pending_tabs_;
-
- DISALLOW_COPY_AND_ASSIGN(AllViewsStoppedLoadingObserver);
-};
-
// Observer used to listen for new tab creation to complete.
class NewTabObserver : public content::NotificationObserver {
public:
« no previous file with comments | « chrome/browser/automation/automation_misc_browsertest.cc ('k') | chrome/browser/automation/automation_provider_observers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698