OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PUBLIC_RENDERER_RENDER_VIEW_OBSERVER_H_ | 5 #ifndef CONTENT_PUBLIC_RENDERER_RENDER_VIEW_OBSERVER_H_ |
6 #define CONTENT_PUBLIC_RENDERER_RENDER_VIEW_OBSERVER_H_ | 6 #define CONTENT_PUBLIC_RENDERER_RENDER_VIEW_OBSERVER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
11 #include "ipc/ipc_listener.h" | 11 #include "ipc/ipc_listener.h" |
12 #include "ipc/ipc_sender.h" | 12 #include "ipc/ipc_sender.h" |
13 #include "third_party/WebKit/public/platform/WebVector.h" | 13 #include "third_party/WebKit/public/platform/WebVector.h" |
14 #include "third_party/WebKit/public/web/WebIconURL.h" | 14 #include "third_party/WebKit/public/web/WebIconURL.h" |
15 | 15 |
16 class GURL; | 16 class GURL; |
17 | 17 |
18 namespace ppapi { | 18 namespace ppapi { |
19 namespace host { | 19 namespace host { |
20 class PpapiHost; | 20 class PpapiHost; |
21 } | 21 } |
22 } | 22 } |
23 | 23 |
24 namespace WebKit { | 24 namespace blink { |
25 class WebDataSource; | 25 class WebDataSource; |
26 class WebFrame; | 26 class WebFrame; |
27 class WebFormElement; | 27 class WebFormElement; |
28 class WebGestureEvent; | 28 class WebGestureEvent; |
29 class WebMediaPlayerClient; | 29 class WebMediaPlayerClient; |
30 class WebMouseEvent; | 30 class WebMouseEvent; |
31 class WebNode; | 31 class WebNode; |
32 class WebTouchEvent; | 32 class WebTouchEvent; |
33 class WebURL; | 33 class WebURL; |
34 struct WebContextMenuData; | 34 struct WebContextMenuData; |
(...skipping 11 matching lines...) Expand all Loading... |
46 class CONTENT_EXPORT RenderViewObserver : public IPC::Listener, | 46 class CONTENT_EXPORT RenderViewObserver : public IPC::Listener, |
47 public IPC::Sender { | 47 public IPC::Sender { |
48 public: | 48 public: |
49 // By default, observers will be deleted when the RenderView goes away. If | 49 // By default, observers will be deleted when the RenderView goes away. If |
50 // they want to outlive it, they can override this function. | 50 // they want to outlive it, they can override this function. |
51 virtual void OnDestruct(); | 51 virtual void OnDestruct(); |
52 | 52 |
53 // These match the WebKit API notifications | 53 // These match the WebKit API notifications |
54 virtual void DidStartLoading() {} | 54 virtual void DidStartLoading() {} |
55 virtual void DidStopLoading() {} | 55 virtual void DidStopLoading() {} |
56 virtual void DidFinishDocumentLoad(WebKit::WebFrame* frame) {} | 56 virtual void DidFinishDocumentLoad(blink::WebFrame* frame) {} |
57 virtual void DidFailLoad(WebKit::WebFrame* frame, | 57 virtual void DidFailLoad(blink::WebFrame* frame, |
58 const WebKit::WebURLError& error) {} | 58 const blink::WebURLError& error) {} |
59 virtual void DidFinishLoad(WebKit::WebFrame* frame) {} | 59 virtual void DidFinishLoad(blink::WebFrame* frame) {} |
60 virtual void DidStartProvisionalLoad(WebKit::WebFrame* frame) {} | 60 virtual void DidStartProvisionalLoad(blink::WebFrame* frame) {} |
61 virtual void DidFailProvisionalLoad(WebKit::WebFrame* frame, | 61 virtual void DidFailProvisionalLoad(blink::WebFrame* frame, |
62 const WebKit::WebURLError& error) {} | 62 const blink::WebURLError& error) {} |
63 virtual void DidCommitProvisionalLoad(WebKit::WebFrame* frame, | 63 virtual void DidCommitProvisionalLoad(blink::WebFrame* frame, |
64 bool is_new_navigation) {} | 64 bool is_new_navigation) {} |
65 virtual void DidClearWindowObject(WebKit::WebFrame* frame) {} | 65 virtual void DidClearWindowObject(blink::WebFrame* frame) {} |
66 virtual void DidCreateDocumentElement(WebKit::WebFrame* frame) {} | 66 virtual void DidCreateDocumentElement(blink::WebFrame* frame) {} |
67 virtual void FrameCreated(WebKit::WebFrame* parent, | 67 virtual void FrameCreated(blink::WebFrame* parent, |
68 WebKit::WebFrame* frame) {} | 68 blink::WebFrame* frame) {} |
69 virtual void FrameDetached(WebKit::WebFrame* frame) {} | 69 virtual void FrameDetached(blink::WebFrame* frame) {} |
70 virtual void FrameWillClose(WebKit::WebFrame* frame) {} | 70 virtual void FrameWillClose(blink::WebFrame* frame) {} |
71 virtual void DidMatchCSS( | 71 virtual void DidMatchCSS( |
72 WebKit::WebFrame* frame, | 72 blink::WebFrame* frame, |
73 const WebKit::WebVector<WebKit::WebString>& newly_matching_selectors, | 73 const blink::WebVector<blink::WebString>& newly_matching_selectors, |
74 const WebKit::WebVector<WebKit::WebString>& stopped_matching_selectors) {} | 74 const blink::WebVector<blink::WebString>& stopped_matching_selectors) {} |
75 virtual void WillSendSubmitEvent(WebKit::WebFrame* frame, | 75 virtual void WillSendSubmitEvent(blink::WebFrame* frame, |
76 const WebKit::WebFormElement& form) {} | 76 const blink::WebFormElement& form) {} |
77 virtual void WillSubmitForm(WebKit::WebFrame* frame, | 77 virtual void WillSubmitForm(blink::WebFrame* frame, |
78 const WebKit::WebFormElement& form) {} | 78 const blink::WebFormElement& form) {} |
79 virtual void DidCreateDataSource(WebKit::WebFrame* frame, | 79 virtual void DidCreateDataSource(blink::WebFrame* frame, |
80 WebKit::WebDataSource* ds) {} | 80 blink::WebDataSource* ds) {} |
81 virtual void PrintPage(WebKit::WebFrame* frame, bool user_initiated) {} | 81 virtual void PrintPage(blink::WebFrame* frame, bool user_initiated) {} |
82 virtual void FocusedNodeChanged(const WebKit::WebNode& node) {} | 82 virtual void FocusedNodeChanged(const blink::WebNode& node) {} |
83 virtual void WillCreateMediaPlayer(WebKit::WebFrame* frame, | 83 virtual void WillCreateMediaPlayer(blink::WebFrame* frame, |
84 WebKit::WebMediaPlayerClient* client) {} | 84 blink::WebMediaPlayerClient* client) {} |
85 virtual void ZoomLevelChanged() {}; | 85 virtual void ZoomLevelChanged() {}; |
86 virtual void DidChangeScrollOffset(WebKit::WebFrame* frame) {} | 86 virtual void DidChangeScrollOffset(blink::WebFrame* frame) {} |
87 virtual void DraggableRegionsChanged(WebKit::WebFrame* frame) {} | 87 virtual void DraggableRegionsChanged(blink::WebFrame* frame) {} |
88 virtual void DidRequestShowContextMenu( | 88 virtual void DidRequestShowContextMenu( |
89 WebKit::WebFrame* frame, | 89 blink::WebFrame* frame, |
90 const WebKit::WebContextMenuData& data) {} | 90 const blink::WebContextMenuData& data) {} |
91 virtual void DidCommitCompositorFrame() {} | 91 virtual void DidCommitCompositorFrame() {} |
92 virtual void DidUpdateLayout() {} | 92 virtual void DidUpdateLayout() {} |
93 | 93 |
94 // These match the RenderView methods. | 94 // These match the RenderView methods. |
95 virtual void DidHandleMouseEvent(const WebKit::WebMouseEvent& event) {} | 95 virtual void DidHandleMouseEvent(const blink::WebMouseEvent& event) {} |
96 virtual void DidHandleTouchEvent(const WebKit::WebTouchEvent& event) {} | 96 virtual void DidHandleTouchEvent(const blink::WebTouchEvent& event) {} |
97 virtual void DidHandleGestureEvent(const WebKit::WebGestureEvent& event) {} | 97 virtual void DidHandleGestureEvent(const blink::WebGestureEvent& event) {} |
98 virtual void DidCreatePepperPlugin(RendererPpapiHost* host) {} | 98 virtual void DidCreatePepperPlugin(RendererPpapiHost* host) {} |
99 | 99 |
100 // Called when we receive a console message from WebKit for which we requested | 100 // Called when we receive a console message from WebKit for which we requested |
101 // extra details (like the stack trace). |message| is the error message, | 101 // extra details (like the stack trace). |message| is the error message, |
102 // |source| is the WebKit-reported source of the error (either external or | 102 // |source| is the WebKit-reported source of the error (either external or |
103 // internal), and |stack_trace| is the stack trace of the error in a | 103 // internal), and |stack_trace| is the stack trace of the error in a |
104 // human-readable format (each frame is formatted as | 104 // human-readable format (each frame is formatted as |
105 // "\n at function_name (source:line_number:column_number)"). | 105 // "\n at function_name (source:line_number:column_number)"). |
106 virtual void DetailedConsoleMessageAdded(const base::string16& message, | 106 virtual void DetailedConsoleMessageAdded(const base::string16& message, |
107 const base::string16& source, | 107 const base::string16& source, |
(...skipping 29 matching lines...) Expand all Loading... |
137 RenderView* render_view_; | 137 RenderView* render_view_; |
138 // The routing ID of the associated RenderView. | 138 // The routing ID of the associated RenderView. |
139 int routing_id_; | 139 int routing_id_; |
140 | 140 |
141 DISALLOW_COPY_AND_ASSIGN(RenderViewObserver); | 141 DISALLOW_COPY_AND_ASSIGN(RenderViewObserver); |
142 }; | 142 }; |
143 | 143 |
144 } // namespace content | 144 } // namespace content |
145 | 145 |
146 #endif // CONTENT_PUBLIC_RENDERER_RENDER_VIEW_OBSERVER_H_ | 146 #endif // CONTENT_PUBLIC_RENDERER_RENDER_VIEW_OBSERVER_H_ |
OLD | NEW |