| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CONTENT_RENDERER_RENDER_VIEW_OBSERVER_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_VIEW_OBSERVER_H_ |
| 6 #define CONTENT_RENDERER_RENDER_VIEW_OBSERVER_H_ | 6 #define CONTENT_RENDERER_RENDER_VIEW_OBSERVER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "ipc/ipc_channel.h" | 10 #include "ipc/ipc_channel.h" |
| 11 | 11 |
| 12 class RenderView; | 12 class RenderView; |
| 13 | 13 |
| 14 namespace WebKit { | 14 namespace WebKit { |
| 15 class WebDataSource; | 15 class WebDataSource; |
| 16 class WebFrame; | 16 class WebFrame; |
| 17 class WebFormElement; | 17 class WebFormElement; |
| 18 class WebMouseEvent; | 18 class WebMouseEvent; |
| 19 class WebNode; |
| 19 class WebString; | 20 class WebString; |
| 20 class WebURL; | 21 class WebURL; |
| 21 struct WebURLError; | 22 struct WebURLError; |
| 22 } | 23 } |
| 23 | 24 |
| 24 // Base class for objects that want to filter incoming IPCs, and also get | 25 // Base class for objects that want to filter incoming IPCs, and also get |
| 25 // notified of changes to the frame. | 26 // notified of changes to the frame. |
| 26 class RenderViewObserver : public IPC::Channel::Listener, | 27 class RenderViewObserver : public IPC::Channel::Listener, |
| 27 public IPC::Message::Sender { | 28 public IPC::Message::Sender { |
| 28 public: | 29 public: |
| (...skipping 26 matching lines...) Expand all Loading... |
| 55 const WebKit::WebFormElement& form) {} | 56 const WebKit::WebFormElement& form) {} |
| 56 virtual void DidCreateDataSource(WebKit::WebFrame* frame, | 57 virtual void DidCreateDataSource(WebKit::WebFrame* frame, |
| 57 WebKit::WebDataSource* ds) {} | 58 WebKit::WebDataSource* ds) {} |
| 58 virtual void PrintPage(WebKit::WebFrame* frame) {} | 59 virtual void PrintPage(WebKit::WebFrame* frame) {} |
| 59 virtual void LogCrossFramePropertyAccess( | 60 virtual void LogCrossFramePropertyAccess( |
| 60 WebKit::WebFrame* frame, | 61 WebKit::WebFrame* frame, |
| 61 WebKit::WebFrame* target, | 62 WebKit::WebFrame* target, |
| 62 bool cross_origin, | 63 bool cross_origin, |
| 63 const WebKit::WebString& property_name, | 64 const WebKit::WebString& property_name, |
| 64 unsigned long long event_id) {} | 65 unsigned long long event_id) {} |
| 66 virtual void FocusedNodeChanged(const WebKit::WebNode& node) {} |
| 65 | 67 |
| 66 // These match the RenderView methods below. | 68 // These match the RenderView methods. |
| 67 virtual void DidHandleMouseEvent(const WebKit::WebMouseEvent& event) {} | 69 virtual void DidHandleMouseEvent(const WebKit::WebMouseEvent& event) {} |
| 68 | 70 |
| 69 protected: | 71 protected: |
| 70 explicit RenderViewObserver(RenderView* render_view); | 72 explicit RenderViewObserver(RenderView* render_view); |
| 71 virtual ~RenderViewObserver(); | 73 virtual ~RenderViewObserver(); |
| 72 | 74 |
| 73 // IPC::Channel::Listener implementation. | 75 // IPC::Channel::Listener implementation. |
| 74 virtual bool OnMessageReceived(const IPC::Message& message); | 76 virtual bool OnMessageReceived(const IPC::Message& message); |
| 75 | 77 |
| 76 // IPC::Message::Sender implementation. | 78 // IPC::Message::Sender implementation. |
| 77 virtual bool Send(IPC::Message* message); | 79 virtual bool Send(IPC::Message* message); |
| 78 | 80 |
| 79 RenderView* render_view() { return render_view_; } | 81 RenderView* render_view() { return render_view_; } |
| 80 int routing_id() { return routing_id_; } | 82 int routing_id() { return routing_id_; } |
| 81 | 83 |
| 82 private: | 84 private: |
| 83 friend class RenderView; | 85 friend class RenderView; |
| 84 | 86 |
| 85 void set_render_view(RenderView* rv) { render_view_ = rv; } | 87 void set_render_view(RenderView* rv) { render_view_ = rv; } |
| 86 | 88 |
| 87 RenderView* render_view_; | 89 RenderView* render_view_; |
| 88 // The routing ID of the associated RenderView. | 90 // The routing ID of the associated RenderView. |
| 89 int routing_id_; | 91 int routing_id_; |
| 90 | 92 |
| 91 DISALLOW_COPY_AND_ASSIGN(RenderViewObserver); | 93 DISALLOW_COPY_AND_ASSIGN(RenderViewObserver); |
| 92 }; | 94 }; |
| 93 | 95 |
| 94 #endif // CONTENT_RENDERER_RENDER_VIEW_OBSERVER_H_ | 96 #endif // CONTENT_RENDERER_RENDER_VIEW_OBSERVER_H_ |
| OLD | NEW |