OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_FRAME_H_ | 5 #ifndef CONTENT_PUBLIC_RENDERER_RENDER_FRAME_H_ |
6 #define CONTENT_PUBLIC_RENDERER_RENDER_FRAME_H_ | 6 #define CONTENT_PUBLIC_RENDERER_RENDER_FRAME_H_ |
7 | 7 |
8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 #include "ipc/ipc_listener.h" | 10 #include "ipc/ipc_listener.h" |
11 #include "ipc/ipc_sender.h" | 11 #include "ipc/ipc_sender.h" |
12 // TODO(dcheng): Convert back to a forward declare. | |
13 #include "third_party/WebKit/public/web/WebLocalFrame.h" | |
Charlie Reis
2014/04/02 23:34:15
Why is this needed for now? And what will change
dcheng
2014/04/02 23:47:08
WebLocalFrame is currently a typedef, and you cann
Charlie Reis
2014/04/03 00:37:11
I see, thanks.
| |
12 #include "third_party/WebKit/public/web/WebNavigationPolicy.h" | 14 #include "third_party/WebKit/public/web/WebNavigationPolicy.h" |
13 | 15 |
14 struct WebPreferences; | 16 struct WebPreferences; |
15 | 17 |
16 namespace blink { | 18 namespace blink { |
17 class WebFrame; | 19 class WebFrame; |
18 class WebNode; | 20 class WebNode; |
19 class WebPlugin; | 21 class WebPlugin; |
20 class WebURLRequest; | 22 class WebURLRequest; |
21 struct WebPluginParams; | 23 struct WebPluginParams; |
22 } | 24 } |
23 | 25 |
24 namespace content { | 26 namespace content { |
25 class ContextMenuClient; | 27 class ContextMenuClient; |
26 class RenderView; | 28 class RenderView; |
27 struct ContextMenuParams; | 29 struct ContextMenuParams; |
28 struct WebPluginInfo; | 30 struct WebPluginInfo; |
29 | 31 |
30 // This interface wraps functionality, which is specific to frames, such as | 32 // This interface wraps functionality, which is specific to frames, such as |
31 // navigation. It provides communication with a corresponding RenderFrameHost | 33 // navigation. It provides communication with a corresponding RenderFrameHost |
32 // in the browser process. | 34 // in the browser process. |
33 class CONTENT_EXPORT RenderFrame : public IPC::Listener, | 35 class CONTENT_EXPORT RenderFrame : public IPC::Listener, |
34 public IPC::Sender { | 36 public IPC::Sender { |
35 public: | 37 public: |
36 // Returns the RenderFrame given a WebFrame. | 38 // Returns the RenderFrame given a WebFrame. |
37 static RenderFrame* FromWebFrame(blink::WebFrame* web_frame); | 39 static RenderFrame* FromWebFrame(blink::WebFrame* web_frame); |
Charlie Reis
2014/04/02 23:34:15
I'm not sure why some uses of WebFrame are being r
dcheng
2014/04/02 23:47:08
Because this didn't fail to compile. It's true tha
Charlie Reis
2014/04/03 00:37:11
Just to fill me in, what didn't compile? I'd like
dcheng
2014/04/03 20:39:57
For figuring out what needs to change, I changed W
Charlie Reis
2014/04/03 20:56:31
I think the part that I was missing was that you h
| |
38 | 40 |
39 // Returns the RenderView associated with this frame. | 41 // Returns the RenderView associated with this frame. |
40 virtual RenderView* GetRenderView() = 0; | 42 virtual RenderView* GetRenderView() = 0; |
41 | 43 |
42 // Get the routing ID of the frame. | 44 // Get the routing ID of the frame. |
43 virtual int GetRoutingID() = 0; | 45 virtual int GetRoutingID() = 0; |
44 | 46 |
45 // Returns the associated WebFrame. | 47 // Returns the associated WebFrame. |
46 virtual blink::WebFrame* GetWebFrame() = 0; | 48 virtual blink::WebFrame* GetWebFrame() = 0; |
47 | 49 |
(...skipping 22 matching lines...) Expand all Loading... | |
70 virtual blink::WebNode GetContextMenuNode() const = 0; | 72 virtual blink::WebNode GetContextMenuNode() const = 0; |
71 | 73 |
72 // Create a new NPAPI/Pepper plugin depending on |info|. Returns NULL if no | 74 // Create a new NPAPI/Pepper plugin depending on |info|. Returns NULL if no |
73 // plugin was found. | 75 // plugin was found. |
74 virtual blink::WebPlugin* CreatePlugin( | 76 virtual blink::WebPlugin* CreatePlugin( |
75 blink::WebFrame* frame, | 77 blink::WebFrame* frame, |
76 const WebPluginInfo& info, | 78 const WebPluginInfo& info, |
77 const blink::WebPluginParams& params) = 0; | 79 const blink::WebPluginParams& params) = 0; |
78 | 80 |
79 // The client should handle the navigation externally. | 81 // The client should handle the navigation externally. |
80 virtual void LoadURLExternally( | 82 virtual void LoadURLExternally(blink::WebLocalFrame* frame, |
81 blink::WebFrame* frame, | 83 const blink::WebURLRequest& request, |
82 const blink::WebURLRequest& request, | 84 blink::WebNavigationPolicy policy) = 0; |
83 blink::WebNavigationPolicy policy) = 0; | |
84 | 85 |
85 // Execute a string of JavaScript in this frame's context. | 86 // Execute a string of JavaScript in this frame's context. |
86 virtual void ExecuteJavaScript(const base::string16& javascript) = 0; | 87 virtual void ExecuteJavaScript(const base::string16& javascript) = 0; |
87 | 88 |
88 protected: | 89 protected: |
89 virtual ~RenderFrame() {} | 90 virtual ~RenderFrame() {} |
90 | 91 |
91 private: | 92 private: |
92 // This interface should only be implemented inside content. | 93 // This interface should only be implemented inside content. |
93 friend class RenderFrameImpl; | 94 friend class RenderFrameImpl; |
94 RenderFrame() {} | 95 RenderFrame() {} |
95 }; | 96 }; |
96 | 97 |
97 } // namespace content | 98 } // namespace content |
98 | 99 |
99 #endif // CONTENT_PUBLIC_RENDERER_RENDER_FRAME_H_ | 100 #endif // CONTENT_PUBLIC_RENDERER_RENDER_FRAME_H_ |
OLD | NEW |