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

Unified Diff: chrome/renderer/page_click_tracker.h

Issue 6151011: Introduce RenderView::Observer interface so that RenderView doesn't have to k... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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
« no previous file with comments | « chrome/renderer/notification_provider.cc ('k') | chrome/renderer/page_click_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/page_click_tracker.h
===================================================================
--- chrome/renderer/page_click_tracker.h (revision 71253)
+++ chrome/renderer/page_click_tracker.h (working copy)
@@ -9,17 +9,12 @@
#include "base/basictypes.h"
#include "base/observer_list.h"
+#include "chrome/renderer/render_view_observer.h"
#include "third_party/WebKit/WebKit/chromium/public/WebDOMEventListener.h"
#include "third_party/WebKit/WebKit/chromium/public/WebNode.h"
class PageClickListener;
-class RenderView;
-namespace WebKit {
-class WebFrame;
-class WebDOMEvent;
-class WebMouseEvent;
-}
// This class is responsible for tracking clicks on elements in web pages and
// notifiying the associated listener when a node is clicked.
@@ -33,23 +28,12 @@
// could easily be changed to report click on any type of WebNode.
//
// There is one PageClickTracker per RenderView.
-
-class PageClickTracker : public WebKit::WebDOMEventListener {
+class PageClickTracker : public RenderViewObserver,
+ public WebKit::WebDOMEventListener {
public:
explicit PageClickTracker(RenderView* render_view);
virtual ~PageClickTracker();
- // Starts reporting node clicks for |frame| on the listener previously
- // specified with SetListener().
- void StartTrackingFrame(WebKit::WebFrame* frame);
-
- // Stops reporting node clicks for |frame|. |frame_detached| should be true
- // if the frame has already been detached.
- void StopTrackingFrame(WebKit::WebFrame* frame, bool frame_detached);
-
- // Called after the mouse event |event| has been processed by WebKit.
- void DidHandleMouseEvent(const WebKit::WebMouseEvent& event);
-
// Adds/removes a listener for getting notification when an element is
// clicked. Note that the order of insertion is important as a listener when
// notified can decide to stop the propagation of the event (so that listeners
@@ -58,9 +42,17 @@
void RemoveListener(PageClickListener* listener);
private:
+ // RenderView::Observer implementation.
+ virtual bool OnMessageReceived(const IPC::Message& message);
+ virtual void DidFinishDocumentLoad(WebKit::WebFrame* frame);
+ virtual void FrameDetached(WebKit::WebFrame* frame);
+
// WebKit::WebDOMEventListener implementation.
virtual void handleEvent(const WebKit::WebDOMEvent& event);
+ // Called after the mouse event |event| has been processed by WebKit.
+ void DidHandleMouseEvent(const WebKit::WebMouseEvent& event);
+
// Returns the currently focused node in the associated render view.
// That node may be null.
WebKit::WebNode GetFocusedNode();
@@ -68,9 +60,6 @@
// The last node that was clicked and had focus.
WebKit::WebNode last_node_clicked_;
- // The render view we are associated with.
- RenderView* render_view_;
-
// Whether the last clicked node had focused before it was clicked.
bool was_focused_;
« no previous file with comments | « chrome/renderer/notification_provider.cc ('k') | chrome/renderer/page_click_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698