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/callback_forward.h" | 8 #include "base/callback_forward.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
(...skipping 18 matching lines...) Expand all Loading... | |
29 } | 29 } |
30 | 30 |
31 namespace v8 { | 31 namespace v8 { |
32 template <typename T> class Handle; | 32 template <typename T> class Handle; |
33 class Context; | 33 class Context; |
34 class Isolate; | 34 class Isolate; |
35 } | 35 } |
36 | 36 |
37 namespace content { | 37 namespace content { |
38 class ContextMenuClient; | 38 class ContextMenuClient; |
39 class PluginInstanceThrottler; | |
39 class RenderView; | 40 class RenderView; |
40 class ServiceRegistry; | 41 class ServiceRegistry; |
41 struct ContextMenuParams; | 42 struct ContextMenuParams; |
42 struct WebPluginInfo; | 43 struct WebPluginInfo; |
43 struct WebPreferences; | 44 struct WebPreferences; |
44 | 45 |
45 // This interface wraps functionality, which is specific to frames, such as | 46 // This interface wraps functionality, which is specific to frames, such as |
46 // navigation. It provides communication with a corresponding RenderFrameHost | 47 // navigation. It provides communication with a corresponding RenderFrameHost |
47 // in the browser process. | 48 // in the browser process. |
48 class CONTENT_EXPORT RenderFrame : public IPC::Listener, | 49 class CONTENT_EXPORT RenderFrame : public IPC::Listener, |
49 public IPC::Sender { | 50 public IPC::Sender { |
50 public: | 51 public: |
51 enum PluginPowerSaverMode { | |
52 // Plugin content is main content, and therefore never throttled. | |
53 POWER_SAVER_MODE_ESSENTIAL = 0, | |
54 // Plugin content is peripheral, but throttling is disabled. | |
55 POWER_SAVER_MODE_PERIPHERAL_UNTHROTTLED = 1, | |
56 // Plugin content is peripheral, and throttling is enabled. | |
57 POWER_SAVER_MODE_PERIPHERAL_THROTTLED = 2 | |
58 }; | |
59 | |
60 // Returns the RenderFrame given a WebFrame. | 52 // Returns the RenderFrame given a WebFrame. |
61 static RenderFrame* FromWebFrame(blink::WebFrame* web_frame); | 53 static RenderFrame* FromWebFrame(blink::WebFrame* web_frame); |
62 | 54 |
63 // Returns the RenderView associated with this frame. | 55 // Returns the RenderView associated with this frame. |
64 virtual RenderView* GetRenderView() = 0; | 56 virtual RenderView* GetRenderView() = 0; |
65 | 57 |
66 // Get the routing ID of the frame. | 58 // Get the routing ID of the frame. |
67 virtual int GetRoutingID() = 0; | 59 virtual int GetRoutingID() = 0; |
68 | 60 |
69 // Returns the associated WebFrame. | 61 // Returns the associated WebFrame. |
(...skipping 17 matching lines...) Expand all Loading... | |
87 const ContextMenuParams& params) = 0; | 79 const ContextMenuParams& params) = 0; |
88 | 80 |
89 // Cancels a context menu in the event that the client is destroyed before the | 81 // Cancels a context menu in the event that the client is destroyed before the |
90 // menu is closed. | 82 // menu is closed. |
91 virtual void CancelContextMenu(int request_id) = 0; | 83 virtual void CancelContextMenu(int request_id) = 0; |
92 | 84 |
93 // Gets the node that the context menu was pressed over. | 85 // Gets the node that the context menu was pressed over. |
94 virtual blink::WebNode GetContextMenuNode() const = 0; | 86 virtual blink::WebNode GetContextMenuNode() const = 0; |
95 | 87 |
96 // Create a new NPAPI/Pepper plugin depending on |info|. Returns NULL if no | 88 // Create a new NPAPI/Pepper plugin depending on |info|. Returns NULL if no |
97 // plugin was found. | 89 // plugin was found. |throttler| may be NULL. |
Bernhard Bauer
2015/01/13 23:29:36
Nit: s/NULL/nullptr/? :)
tommycli
2015/01/14 01:44:59
Done.
| |
98 virtual blink::WebPlugin* CreatePlugin( | 90 virtual blink::WebPlugin* CreatePlugin( |
99 blink::WebFrame* frame, | 91 blink::WebFrame* frame, |
100 const WebPluginInfo& info, | 92 const WebPluginInfo& info, |
101 const blink::WebPluginParams& params, | 93 const blink::WebPluginParams& params, |
102 PluginPowerSaverMode power_saver_mode) = 0; | 94 PluginInstanceThrottler* throttler) = 0; |
Bernhard Bauer
2015/01/13 23:29:36
This takes ownership of |throttler|, right? In whi
tommycli
2015/01/14 01:45:00
Done.
| |
103 | 95 |
104 // The client should handle the navigation externally. | 96 // The client should handle the navigation externally. |
105 virtual void LoadURLExternally(blink::WebLocalFrame* frame, | 97 virtual void LoadURLExternally(blink::WebLocalFrame* frame, |
106 const blink::WebURLRequest& request, | 98 const blink::WebURLRequest& request, |
107 blink::WebNavigationPolicy policy) = 0; | 99 blink::WebNavigationPolicy policy) = 0; |
108 | 100 |
109 // Execute a string of JavaScript in this frame's context. | 101 // Execute a string of JavaScript in this frame's context. |
110 virtual void ExecuteJavaScript(const base::string16& javascript) = 0; | 102 virtual void ExecuteJavaScript(const base::string16& javascript) = 0; |
111 | 103 |
112 // Return true if this frame is hidden. | 104 // Return true if this frame is hidden. |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
178 | 170 |
179 private: | 171 private: |
180 // This interface should only be implemented inside content. | 172 // This interface should only be implemented inside content. |
181 friend class RenderFrameImpl; | 173 friend class RenderFrameImpl; |
182 RenderFrame() {} | 174 RenderFrame() {} |
183 }; | 175 }; |
184 | 176 |
185 } // namespace content | 177 } // namespace content |
186 | 178 |
187 #endif // CONTENT_PUBLIC_RENDERER_RENDER_FRAME_H_ | 179 #endif // CONTENT_PUBLIC_RENDERER_RENDER_FRAME_H_ |
OLD | NEW |