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" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 virtual void DidCreateDataSource(WebKit::WebFrame* frame, | 57 virtual void DidCreateDataSource(WebKit::WebFrame* frame, |
58 WebKit::WebDataSource* ds) {} | 58 WebKit::WebDataSource* ds) {} |
59 virtual void PrintPage(WebKit::WebFrame* frame) {} | 59 virtual void PrintPage(WebKit::WebFrame* frame) {} |
60 virtual void LogCrossFramePropertyAccess( | 60 virtual void LogCrossFramePropertyAccess( |
61 WebKit::WebFrame* frame, | 61 WebKit::WebFrame* frame, |
62 WebKit::WebFrame* target, | 62 WebKit::WebFrame* target, |
63 bool cross_origin, | 63 bool cross_origin, |
64 const WebKit::WebString& property_name, | 64 const WebKit::WebString& property_name, |
65 unsigned long long event_id) {} | 65 unsigned long long event_id) {} |
66 virtual void FocusedNodeChanged(const WebKit::WebNode& node) {} | 66 virtual void FocusedNodeChanged(const WebKit::WebNode& node) {} |
| 67 // If any observer returns false, then the request will be denied. |
| 68 virtual bool AllowImages(WebKit::WebFrame* frame, bool enabled_per_settings); |
| 69 virtual bool AllowPlugins(WebKit::WebFrame* frame, bool enabled_per_settings); |
| 70 virtual bool AllowScript(WebKit::WebFrame* frame, bool enabled_per_settings); |
| 71 virtual void DidNotAllowPlugins(WebKit::WebFrame* frame) {} |
| 72 virtual void DidNotAllowScript(WebKit::WebFrame* frame) {} |
67 | 73 |
68 // These match the RenderView methods. | 74 // These match the RenderView methods. |
69 virtual void DidHandleMouseEvent(const WebKit::WebMouseEvent& event) {} | 75 virtual void DidHandleMouseEvent(const WebKit::WebMouseEvent& event) {} |
70 | 76 |
71 protected: | 77 protected: |
72 explicit RenderViewObserver(RenderView* render_view); | 78 explicit RenderViewObserver(RenderView* render_view); |
73 virtual ~RenderViewObserver(); | 79 virtual ~RenderViewObserver(); |
74 | 80 |
75 // IPC::Channel::Listener implementation. | 81 // IPC::Channel::Listener implementation. |
76 virtual bool OnMessageReceived(const IPC::Message& message); | 82 virtual bool OnMessageReceived(const IPC::Message& message); |
(...skipping 10 matching lines...) Expand all Loading... |
87 void set_render_view(RenderView* rv) { render_view_ = rv; } | 93 void set_render_view(RenderView* rv) { render_view_ = rv; } |
88 | 94 |
89 RenderView* render_view_; | 95 RenderView* render_view_; |
90 // The routing ID of the associated RenderView. | 96 // The routing ID of the associated RenderView. |
91 int routing_id_; | 97 int routing_id_; |
92 | 98 |
93 DISALLOW_COPY_AND_ASSIGN(RenderViewObserver); | 99 DISALLOW_COPY_AND_ASSIGN(RenderViewObserver); |
94 }; | 100 }; |
95 | 101 |
96 #endif // CONTENT_RENDERER_RENDER_VIEW_OBSERVER_H_ | 102 #endif // CONTENT_RENDERER_RENDER_VIEW_OBSERVER_H_ |
OLD | NEW |