[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |
| 6 | #define CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |
| 7 | |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 8 | #include <vector> |
| 9 | |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 10 | #include "base/basictypes.h" |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 11 | #include "base/files/file_path.h" |
[email protected] | a09d53ce | 2014-01-31 00:46:42 | [diff] [blame] | 12 | #include "base/gtest_prod_util.h" |
| 13 | #include "base/id_map.h" |
[email protected] | abc501e | 2014-01-27 19:27:26 | [diff] [blame] | 14 | #include "base/memory/weak_ptr.h" |
[email protected] | 2e2d963 | 2013-12-03 00:55:26 | [diff] [blame] | 15 | #include "base/observer_list.h" |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 16 | #include "base/process/process_handle.h" |
[email protected] | 9564021 | 2014-07-26 18:14:30 | [diff] [blame] | 17 | #include "content/common/accessibility_mode_enums.h" |
[email protected] | c52a141 | 2014-06-25 06:09:25 | [diff] [blame] | 18 | #include "content/common/mojo/service_registry_impl.h" |
[email protected] | 87de04b0 | 2014-04-08 22:14:49 | [diff] [blame] | 19 | #include "content/public/common/javascript_message_type.h" |
[email protected] | 65920f33 | 2014-03-04 21:14:18 | [diff] [blame] | 20 | #include "content/public/common/referrer.h" |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 21 | #include "content/public/renderer/render_frame.h" |
[email protected] | 5a7100d | 2014-05-19 01:29:04 | [diff] [blame] | 22 | #include "content/renderer/render_frame_proxy.h" |
[email protected] | f3add92 | 2013-12-20 23:17:16 | [diff] [blame] | 23 | #include "content/renderer/renderer_webcookiejar_impl.h" |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 24 | #include "ipc/ipc_message.h" |
acolwell | 9e0840d | 2014-09-06 19:01:32 | [diff] [blame] | 25 | #include "media/blink/webmediaplayer_delegate.h" |
[email protected] | 9564021 | 2014-07-26 18:14:30 | [diff] [blame] | 26 | #include "third_party/WebKit/public/web/WebAXObject.h" |
[email protected] | 85d85fd | 2013-06-19 00:57:41 | [diff] [blame] | 27 | #include "third_party/WebKit/public/web/WebDataSource.h" |
| 28 | #include "third_party/WebKit/public/web/WebFrameClient.h" |
[email protected] | 68057554 | 2014-04-03 17:12:52 | [diff] [blame] | 29 | #include "third_party/WebKit/public/web/WebHistoryCommitType.h" |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 30 | #include "ui/gfx/range/range.h" |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 31 | |
[email protected] | a017938b | 2014-05-27 21:17:17 | [diff] [blame] | 32 | #if defined(OS_ANDROID) |
| 33 | #include "content/renderer/media/android/renderer_media_player_manager.h" |
| 34 | #endif |
| 35 | |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 36 | class TransportDIB; |
[email protected] | c6bc2033 | 2014-02-28 18:30:39 | [diff] [blame] | 37 | struct FrameMsg_Navigate_Params; |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 38 | |
| 39 | namespace blink { |
[email protected] | 5ee7f18 | 2014-04-25 19:45:26 | [diff] [blame] | 40 | class WebGeolocationClient; |
[email protected] | 5cdd8fd8 | 2014-02-05 20:12:12 | [diff] [blame] | 41 | class WebInputEvent; |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 42 | class WebMouseEvent; |
[email protected] | 82ce5b9 | 2014-03-22 05:15:26 | [diff] [blame] | 43 | class WebContentDecryptionModule; |
[email protected] | 9630731 | 2014-05-04 01:00:19 | [diff] [blame] | 44 | class WebMediaPlayer; |
[email protected] | 1c04825 | 2014-04-11 23:27:34 | [diff] [blame] | 45 | class WebNotificationPresenter; |
[email protected] | 4592086 | 2014-07-02 12:53:02 | [diff] [blame] | 46 | class WebPushClient; |
[email protected] | 82ce5b9 | 2014-03-22 05:15:26 | [diff] [blame] | 47 | class WebSecurityOrigin; |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 48 | struct WebCompositionUnderline; |
[email protected] | a09d53ce | 2014-01-31 00:46:42 | [diff] [blame] | 49 | struct WebContextMenuData; |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 50 | struct WebCursorInfo; |
| 51 | } |
| 52 | |
| 53 | namespace gfx { |
[email protected] | a09d53ce | 2014-01-31 00:46:42 | [diff] [blame] | 54 | class Point; |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 55 | class Range; |
| 56 | class Rect; |
| 57 | } |
| 58 | |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 59 | namespace content { |
| 60 | |
[email protected] | bffc830 | 2014-01-23 20:52:16 | [diff] [blame] | 61 | class ChildFrameCompositingHelper; |
avi | 485e5fd6 | 2014-08-25 23:26:14 | [diff] [blame] | 62 | class ExternalPopupMenu; |
[email protected] | 8eae080 | 2014-06-02 21:35:55 | [diff] [blame] | 63 | class GeolocationDispatcher; |
mlamouri | efdca9d | 2014-09-16 16:55:40 | [diff] [blame^] | 64 | class ManifestManager; |
[email protected] | 977db4a4 | 2014-07-17 08:04:32 | [diff] [blame] | 65 | class MediaStreamDispatcher; |
[email protected] | ae2477e | 2014-05-27 23:47:08 | [diff] [blame] | 66 | class MediaStreamRendererFactory; |
[email protected] | 52d3e17 | 2014-06-16 16:57:02 | [diff] [blame] | 67 | class MidiDispatcher; |
[email protected] | 4459599e | 2014-07-29 22:40:09 | [diff] [blame] | 68 | class NotificationPermissionDispatcher; |
[email protected] | 2626d14 | 2014-04-22 17:24:02 | [diff] [blame] | 69 | class NotificationProvider; |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 70 | class PepperPluginInstanceImpl; |
[email protected] | 4592086 | 2014-07-02 12:53:02 | [diff] [blame] | 71 | class PushMessagingDispatcher; |
[email protected] | 9564021 | 2014-07-26 18:14:30 | [diff] [blame] | 72 | class RendererAccessibility; |
[email protected] | 4b556cf | 2014-06-10 23:21:53 | [diff] [blame] | 73 | class RendererCdmManager; |
| 74 | class RendererMediaPlayerManager; |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 75 | class RendererPpapiHost; |
[email protected] | 2e2d963 | 2013-12-03 00:55:26 | [diff] [blame] | 76 | class RenderFrameObserver; |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 77 | class RenderViewImpl; |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 78 | class RenderWidget; |
| 79 | class RenderWidgetFullscreenPepper; |
[email protected] | cf78eda | 2014-06-13 16:57:41 | [diff] [blame] | 80 | class ScreenOrientationDispatcher; |
perkj | 1a2d043 | 2014-09-03 13:52:33 | [diff] [blame] | 81 | class UserMediaClientImpl; |
[email protected] | a09d53ce | 2014-01-31 00:46:42 | [diff] [blame] | 82 | struct CustomContextMenuContext; |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 83 | |
[email protected] | 85d85fd | 2013-06-19 00:57:41 | [diff] [blame] | 84 | class CONTENT_EXPORT RenderFrameImpl |
| 85 | : public RenderFrame, |
[email protected] | 9630731 | 2014-05-04 01:00:19 | [diff] [blame] | 86 | NON_EXPORTED_BASE(public blink::WebFrameClient), |
acolwell | 9e0840d | 2014-09-06 19:01:32 | [diff] [blame] | 87 | NON_EXPORTED_BASE(public media::WebMediaPlayerDelegate) { |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 88 | public: |
[email protected] | 2f61bdd | 2013-07-02 18:38:47 | [diff] [blame] | 89 | // Creates a new RenderFrame. |render_view| is the RenderView object that this |
| 90 | // frame belongs to. |
[email protected] | b70da4c | 2014-01-06 19:57:09 | [diff] [blame] | 91 | // Callers *must* call |SetWebFrame| immediately after creation. |
[email protected] | 82307f6b | 2014-08-07 03:30:12 | [diff] [blame] | 92 | // Note: This is called only when RenderFrame is created by Blink through |
| 93 | // createChildFrame. |
[email protected] | b70da4c | 2014-01-06 19:57:09 | [diff] [blame] | 94 | // TODO(creis): We should structure this so that |SetWebFrame| isn't needed. |
[email protected] | 2f61bdd | 2013-07-02 18:38:47 | [diff] [blame] | 95 | static RenderFrameImpl* Create(RenderViewImpl* render_view, int32 routing_id); |
| 96 | |
[email protected] | 82307f6b | 2014-08-07 03:30:12 | [diff] [blame] | 97 | // Creates a new RenderFrame with |routing_id| as a child of the RenderFrame |
| 98 | // identified by |parent_routing_id| or as the top-level frame if the latter |
| 99 | // is MSG_ROUTING_NONE. It creates the Blink WebLocalFrame and inserts it in |
| 100 | // the proper place in the frame tree. |
| 101 | // Note: This is called only when RenderFrame is being created in response to |
| 102 | // IPC message from the browser process. All other frame creation is driven |
| 103 | // through Blink and Create. |
| 104 | static void CreateFrame(int routing_id, int parent_routing_id); |
| 105 | |
[email protected] | 5a7100d | 2014-05-19 01:29:04 | [diff] [blame] | 106 | // Returns the RenderFrameImpl for the given routing ID. |
| 107 | static RenderFrameImpl* FromRoutingID(int routing_id); |
| 108 | |
[email protected] | a5ac6dc | 2014-01-15 07:02:14 | [diff] [blame] | 109 | // Just like RenderFrame::FromWebFrame but returns the implementation. |
| 110 | static RenderFrameImpl* FromWebFrame(blink::WebFrame* web_frame); |
[email protected] | b70da4c | 2014-01-06 19:57:09 | [diff] [blame] | 111 | |
[email protected] | 2f61bdd | 2013-07-02 18:38:47 | [diff] [blame] | 112 | // Used by content_layouttest_support to hook into the creation of |
| 113 | // RenderFrameImpls. |
| 114 | static void InstallCreateHook( |
| 115 | RenderFrameImpl* (*create_render_frame_impl)(RenderViewImpl*, int32)); |
| 116 | |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 117 | virtual ~RenderFrameImpl(); |
| 118 | |
[email protected] | b70da4c | 2014-01-06 19:57:09 | [diff] [blame] | 119 | bool is_swapped_out() const { |
| 120 | return is_swapped_out_; |
| 121 | } |
| 122 | |
[email protected] | 5a7100d | 2014-05-19 01:29:04 | [diff] [blame] | 123 | // TODO(nasko): This can be removed once we don't have a swapped out state on |
| 124 | // RenderFrames. See https://crbug.com/357747. |
| 125 | void set_render_frame_proxy(RenderFrameProxy* proxy) { |
| 126 | render_frame_proxy_ = proxy; |
| 127 | } |
| 128 | |
[email protected] | bffc830 | 2014-01-23 20:52:16 | [diff] [blame] | 129 | // Out-of-process child frames receive a signal from RenderWidgetCompositor |
| 130 | // when a compositor frame has committed. |
| 131 | void DidCommitCompositorFrame(); |
| 132 | |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 133 | // TODO(jam): this is a temporary getter until all the code is transitioned |
| 134 | // to using RenderFrame instead of RenderView. |
[email protected] | abc501e | 2014-01-27 19:27:26 | [diff] [blame] | 135 | RenderViewImpl* render_view() { return render_view_.get(); } |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 136 | |
[email protected] | f3add92 | 2013-12-20 23:17:16 | [diff] [blame] | 137 | RendererWebCookieJarImpl* cookie_jar() { return &cookie_jar_; } |
| 138 | |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 139 | // Returns the RenderWidget associated with this frame. |
| 140 | RenderWidget* GetRenderWidget(); |
| 141 | |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 142 | // This is called right after creation with the WebLocalFrame for this |
[email protected] | 0287e76 | 2014-04-11 13:07:58 | [diff] [blame] | 143 | // RenderFrame. It must be called before Initialize. |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 144 | void SetWebFrame(blink::WebLocalFrame* web_frame); |
[email protected] | b70da4c | 2014-01-06 19:57:09 | [diff] [blame] | 145 | |
[email protected] | 0287e76 | 2014-04-11 13:07:58 | [diff] [blame] | 146 | // This method must be called after the frame has been added to the frame |
| 147 | // tree. It creates all objects that depend on the frame being at its proper |
| 148 | // spot. |
| 149 | void Initialize(); |
| 150 | |
[email protected] | de3c5d8 | 2014-05-28 22:12:59 | [diff] [blame] | 151 | // Notifications from RenderWidget. |
| 152 | void WasHidden(); |
| 153 | void WasShown(); |
| 154 | |
[email protected] | 723971b | 2014-02-12 11:08:25 | [diff] [blame] | 155 | // Start/Stop loading notifications. |
| 156 | // TODO(nasko): Those are page-level methods at this time and come from |
| 157 | // WebViewClient. We should move them to be WebFrameClient calls and put |
| 158 | // logic in the browser side to balance starts/stops. |
[email protected] | e3b10d1 | 2014-03-28 16:06:09 | [diff] [blame] | 159 | // |to_different_document| will be true unless the load is a fragment |
| 160 | // navigation, or triggered by history.pushState/replaceState. |
[email protected] | 6dd5c32 | 2014-03-12 07:58:46 | [diff] [blame] | 161 | virtual void didStartLoading(bool to_different_document); |
| 162 | virtual void didStopLoading(); |
| 163 | virtual void didChangeLoadProgress(double load_progress); |
[email protected] | 723971b | 2014-02-12 11:08:25 | [diff] [blame] | 164 | |
[email protected] | 9564021 | 2014-07-26 18:14:30 | [diff] [blame] | 165 | AccessibilityMode accessibility_mode() { |
| 166 | return accessibility_mode_; |
| 167 | } |
| 168 | |
| 169 | RendererAccessibility* renderer_accessibility() { |
| 170 | return renderer_accessibility_; |
| 171 | } |
| 172 | |
| 173 | void HandleWebAccessibilityEvent(const blink::WebAXObject& obj, |
| 174 | blink::WebAXEvent event); |
| 175 | |
| 176 | // TODO(dmazzoni): the only reason this is here is to plumb it through to |
| 177 | // RendererAccessibility. It should be part of RenderFrameObserver, once |
| 178 | // blink has a separate accessibility tree per frame. |
| 179 | void FocusedNodeChanged(const blink::WebNode& node); |
| 180 | |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 181 | #if defined(ENABLE_PLUGINS) |
[email protected] | 271ff579 | 2013-12-04 22:29:31 | [diff] [blame] | 182 | // Notification that a PPAPI plugin has been created. |
| 183 | void PepperPluginCreated(RendererPpapiHost* host); |
| 184 | |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 185 | // Notifies that |instance| has changed the cursor. |
| 186 | // This will update the cursor appearance if it is currently over the plugin |
| 187 | // instance. |
| 188 | void PepperDidChangeCursor(PepperPluginInstanceImpl* instance, |
| 189 | const blink::WebCursorInfo& cursor); |
| 190 | |
| 191 | // Notifies that |instance| has received a mouse event. |
| 192 | void PepperDidReceiveMouseEvent(PepperPluginInstanceImpl* instance); |
| 193 | |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 194 | // Informs the render view that a PPAPI plugin has changed text input status. |
| 195 | void PepperTextInputTypeChanged(PepperPluginInstanceImpl* instance); |
| 196 | void PepperCaretPositionChanged(PepperPluginInstanceImpl* instance); |
| 197 | |
| 198 | // Cancels current composition. |
| 199 | void PepperCancelComposition(PepperPluginInstanceImpl* instance); |
| 200 | |
| 201 | // Informs the render view that a PPAPI plugin has changed selection. |
| 202 | void PepperSelectionChanged(PepperPluginInstanceImpl* instance); |
| 203 | |
| 204 | // Creates a fullscreen container for a pepper plugin instance. |
| 205 | RenderWidgetFullscreenPepper* CreatePepperFullscreenContainer( |
| 206 | PepperPluginInstanceImpl* plugin); |
| 207 | |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 208 | bool IsPepperAcceptingCompositionEvents() const; |
| 209 | |
| 210 | // Notification that the given plugin has crashed. |
| 211 | void PluginCrashed(const base::FilePath& plugin_path, |
| 212 | base::ProcessId plugin_pid); |
| 213 | |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 214 | // Simulates IME events for testing purpose. |
| 215 | void SimulateImeSetComposition( |
[email protected] | fcf75d4 | 2013-12-03 20:11:26 | [diff] [blame] | 216 | const base::string16& text, |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 217 | const std::vector<blink::WebCompositionUnderline>& underlines, |
| 218 | int selection_start, |
| 219 | int selection_end); |
[email protected] | fcf75d4 | 2013-12-03 20:11:26 | [diff] [blame] | 220 | void SimulateImeConfirmComposition(const base::string16& text, |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 221 | const gfx::Range& replacement_range); |
| 222 | |
| 223 | // TODO(jam): remove these once the IPC handler moves from RenderView to |
| 224 | // RenderFrame. |
| 225 | void OnImeSetComposition( |
[email protected] | fcf75d4 | 2013-12-03 20:11:26 | [diff] [blame] | 226 | const base::string16& text, |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 227 | const std::vector<blink::WebCompositionUnderline>& underlines, |
| 228 | int selection_start, |
| 229 | int selection_end); |
| 230 | void OnImeConfirmComposition( |
[email protected] | fcf75d4 | 2013-12-03 20:11:26 | [diff] [blame] | 231 | const base::string16& text, |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 232 | const gfx::Range& replacement_range, |
| 233 | bool keep_selection); |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 234 | #endif // ENABLE_PLUGINS |
| 235 | |
[email protected] | 977db4a4 | 2014-07-17 08:04:32 | [diff] [blame] | 236 | // May return NULL in some cases, especially if userMediaClient() returns |
| 237 | // NULL. |
| 238 | MediaStreamDispatcher* GetMediaStreamDispatcher(); |
| 239 | |
avi | 485e5fd6 | 2014-08-25 23:26:14 | [diff] [blame] | 240 | #if defined(OS_MACOSX) || defined(OS_ANDROID) |
| 241 | void DidHideExternalPopupMenu(); |
| 242 | #endif |
| 243 | |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 244 | // IPC::Sender |
| 245 | virtual bool Send(IPC::Message* msg) OVERRIDE; |
| 246 | |
| 247 | // IPC::Listener |
| 248 | virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
| 249 | |
[email protected] | 271ff579 | 2013-12-04 22:29:31 | [diff] [blame] | 250 | // RenderFrame implementation: |
[email protected] | b849847b | 2013-12-10 21:57:58 | [diff] [blame] | 251 | virtual RenderView* GetRenderView() OVERRIDE; |
[email protected] | 60eca4eb | 2013-12-06 00:02:16 | [diff] [blame] | 252 | virtual int GetRoutingID() OVERRIDE; |
mlamouri | 862a2ed | 2014-09-10 15:14:54 | [diff] [blame] | 253 | virtual blink::WebLocalFrame* GetWebFrame() OVERRIDE; |
[email protected] | d019e1a38 | 2013-12-11 17:52:06 | [diff] [blame] | 254 | virtual WebPreferences& GetWebkitPreferences() OVERRIDE; |
| 255 | virtual int ShowContextMenu(ContextMenuClient* client, |
| 256 | const ContextMenuParams& params) OVERRIDE; |
| 257 | virtual void CancelContextMenu(int request_id) OVERRIDE; |
[email protected] | 1a6d011 | 2014-03-10 19:08:41 | [diff] [blame] | 258 | virtual blink::WebNode GetContextMenuNode() const OVERRIDE; |
[email protected] | 271ff579 | 2013-12-04 22:29:31 | [diff] [blame] | 259 | virtual blink::WebPlugin* CreatePlugin( |
| 260 | blink::WebFrame* frame, |
| 261 | const WebPluginInfo& info, |
| 262 | const blink::WebPluginParams& params) OVERRIDE; |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 263 | virtual void LoadURLExternally(blink::WebLocalFrame* frame, |
| 264 | const blink::WebURLRequest& request, |
| 265 | blink::WebNavigationPolicy policy) OVERRIDE; |
[email protected] | db3be76f | 2014-03-25 02:27:47 | [diff] [blame] | 266 | virtual void ExecuteJavaScript(const base::string16& javascript) OVERRIDE; |
[email protected] | 291abdb | 2014-06-05 14:19:11 | [diff] [blame] | 267 | virtual bool IsHidden() OVERRIDE; |
[email protected] | c52a141 | 2014-06-25 06:09:25 | [diff] [blame] | 268 | virtual ServiceRegistry* GetServiceRegistry() OVERRIDE; |
[email protected] | 59e94c16 | 2014-07-23 06:27:08 | [diff] [blame] | 269 | virtual bool IsFTPDirectoryListing() OVERRIDE; |
[email protected] | 2101c4c | 2014-08-22 00:16:16 | [diff] [blame] | 270 | virtual void AttachGuest(int element_instance_id) OVERRIDE; |
[email protected] | 271ff579 | 2013-12-04 22:29:31 | [diff] [blame] | 271 | |
[email protected] | 9630731 | 2014-05-04 01:00:19 | [diff] [blame] | 272 | // blink::WebFrameClient implementation: |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 273 | virtual blink::WebPlugin* createPlugin(blink::WebLocalFrame* frame, |
| 274 | const blink::WebPluginParams& params); |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 275 | virtual blink::WebMediaPlayer* createMediaPlayer( |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 276 | blink::WebLocalFrame* frame, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 277 | const blink::WebURL& url, |
| 278 | blink::WebMediaPlayerClient* client); |
[email protected] | 82ce5b9 | 2014-03-22 05:15:26 | [diff] [blame] | 279 | virtual blink::WebContentDecryptionModule* createContentDecryptionModule( |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 280 | blink::WebLocalFrame* frame, |
[email protected] | 82ce5b9 | 2014-03-22 05:15:26 | [diff] [blame] | 281 | const blink::WebSecurityOrigin& security_origin, |
| 282 | const blink::WebString& key_system); |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 283 | virtual blink::WebApplicationCacheHost* createApplicationCacheHost( |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 284 | blink::WebLocalFrame* frame, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 285 | blink::WebApplicationCacheHostClient* client); |
| 286 | virtual blink::WebWorkerPermissionClientProxy* |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 287 | createWorkerPermissionClientProxy(blink::WebLocalFrame* frame); |
[email protected] | b20c322 | 2014-08-22 00:50:22 | [diff] [blame] | 288 | virtual blink::WebExternalPopupMenu* createExternalPopupMenu( |
| 289 | const blink::WebPopupMenuInfo& popup_menu_info, |
| 290 | blink::WebExternalPopupMenuClient* popup_menu_client); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 291 | virtual blink::WebCookieJar* cookieJar(blink::WebLocalFrame* frame); |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 292 | virtual blink::WebServiceWorkerProvider* createServiceWorkerProvider( |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 293 | blink::WebLocalFrame* frame); |
| 294 | virtual void didAccessInitialDocument(blink::WebLocalFrame* frame); |
| 295 | virtual blink::WebFrame* createChildFrame(blink::WebLocalFrame* parent, |
| 296 | const blink::WebString& name); |
| 297 | virtual void didDisownOpener(blink::WebLocalFrame* frame); |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 298 | virtual void frameDetached(blink::WebFrame* frame); |
[email protected] | 9c9343b | 2014-03-08 02:56:07 | [diff] [blame] | 299 | virtual void frameFocused(); |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 300 | virtual void willClose(blink::WebFrame* frame); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 301 | virtual void didChangeName(blink::WebLocalFrame* frame, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 302 | const blink::WebString& name); |
[email protected] | f5b6dd112 | 2013-10-04 02:42:50 | [diff] [blame] | 303 | virtual void didMatchCSS( |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 304 | blink::WebLocalFrame* frame, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 305 | const blink::WebVector<blink::WebString>& newly_matching_selectors, |
| 306 | const blink::WebVector<blink::WebString>& stopped_matching_selectors); |
[email protected] | c31a8480 | 2014-04-03 15:55:49 | [diff] [blame] | 307 | virtual bool shouldReportDetailedMessageForSource( |
| 308 | const blink::WebString& source); |
| 309 | virtual void didAddMessageToConsole(const blink::WebConsoleMessage& message, |
| 310 | const blink::WebString& source_name, |
| 311 | unsigned source_line, |
| 312 | const blink::WebString& stack_trace); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 313 | virtual void loadURLExternally(blink::WebLocalFrame* frame, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 314 | const blink::WebURLRequest& request, |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 315 | blink::WebNavigationPolicy policy, |
| 316 | const blink::WebString& suggested_name); |
[email protected] | 1a4e975 | 2013-12-31 20:10:58 | [diff] [blame] | 317 | // The WebDataSource::ExtraData* is assumed to be a DocumentState* subclass. |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 318 | virtual blink::WebNavigationPolicy decidePolicyForNavigation( |
[email protected] | 0c3c54f | 2014-07-31 01:29:00 | [diff] [blame] | 319 | const NavigationPolicyInfo& info); |
[email protected] | 68057554 | 2014-04-03 17:12:52 | [diff] [blame] | 320 | virtual blink::WebHistoryItem historyItemForNewChildFrame( |
| 321 | blink::WebFrame* frame); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 322 | virtual void willSendSubmitEvent(blink::WebLocalFrame* frame, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 323 | const blink::WebFormElement& form); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 324 | virtual void willSubmitForm(blink::WebLocalFrame* frame, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 325 | const blink::WebFormElement& form); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 326 | virtual void didCreateDataSource(blink::WebLocalFrame* frame, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 327 | blink::WebDataSource* datasource); |
[email protected] | 0c3c54f | 2014-07-31 01:29:00 | [diff] [blame] | 328 | virtual void didStartProvisionalLoad(blink::WebLocalFrame* frame, |
| 329 | bool is_transition_navigation); |
[email protected] | 85d85fd | 2013-06-19 00:57:41 | [diff] [blame] | 330 | virtual void didReceiveServerRedirectForProvisionalLoad( |
[email protected] | 45d877f | 2014-04-05 07:36:22 | [diff] [blame] | 331 | blink::WebLocalFrame* frame); |
[email protected] | 85d85fd | 2013-06-19 00:57:41 | [diff] [blame] | 332 | virtual void didFailProvisionalLoad( |
[email protected] | 45d877f | 2014-04-05 07:36:22 | [diff] [blame] | 333 | blink::WebLocalFrame* frame, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 334 | const blink::WebURLError& error); |
[email protected] | 68057554 | 2014-04-03 17:12:52 | [diff] [blame] | 335 | virtual void didCommitProvisionalLoad( |
[email protected] | 45d877f | 2014-04-05 07:36:22 | [diff] [blame] | 336 | blink::WebLocalFrame* frame, |
[email protected] | 68057554 | 2014-04-03 17:12:52 | [diff] [blame] | 337 | const blink::WebHistoryItem& item, |
| 338 | blink::WebHistoryCommitType commit_type); |
[email protected] | 06181e5 | 2014-05-10 11:59:09 | [diff] [blame] | 339 | virtual void didClearWindowObject(blink::WebLocalFrame* frame); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 340 | virtual void didCreateDocumentElement(blink::WebLocalFrame* frame); |
| 341 | virtual void didReceiveTitle(blink::WebLocalFrame* frame, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 342 | const blink::WebString& title, |
| 343 | blink::WebTextDirection direction); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 344 | virtual void didChangeIcon(blink::WebLocalFrame* frame, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 345 | blink::WebIconURL::Type icon_type); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 346 | virtual void didFinishDocumentLoad(blink::WebLocalFrame* frame); |
| 347 | virtual void didHandleOnloadEvents(blink::WebLocalFrame* frame); |
| 348 | virtual void didFailLoad(blink::WebLocalFrame* frame, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 349 | const blink::WebURLError& error); |
[email protected] | 45d877f | 2014-04-05 07:36:22 | [diff] [blame] | 350 | virtual void didFinishLoad(blink::WebLocalFrame* frame); |
| 351 | virtual void didNavigateWithinPage(blink::WebLocalFrame* frame, |
[email protected] | 68057554 | 2014-04-03 17:12:52 | [diff] [blame] | 352 | const blink::WebHistoryItem& item, |
| 353 | blink::WebHistoryCommitType commit_type); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 354 | virtual void didUpdateCurrentHistoryItem(blink::WebLocalFrame* frame); |
[email protected] | 9e6bea41 | 2014-08-08 06:35:25 | [diff] [blame] | 355 | virtual void addNavigationTransitionData( |
| 356 | const blink::WebString& allowedDestinationOrigin, |
| 357 | const blink::WebString& selector, |
| 358 | const blink::WebString& markup); |
[email protected] | 37b64c5 | 2014-07-11 21:14:05 | [diff] [blame] | 359 | virtual void didChangeThemeColor(); |
[email protected] | 4459599e | 2014-07-29 22:40:09 | [diff] [blame] | 360 | virtual void requestNotificationPermission( |
| 361 | const blink::WebSecurityOrigin& origin, |
| 362 | blink::WebNotificationPermissionCallback* callback); |
[email protected] | 1c04825 | 2014-04-11 23:27:34 | [diff] [blame] | 363 | virtual blink::WebNotificationPresenter* notificationPresenter(); |
[email protected] | c3f2c70 | 2014-03-19 23:39:48 | [diff] [blame] | 364 | virtual void didChangeSelection(bool is_empty_selection); |
[email protected] | f3c59d6 | 2014-04-09 16:33:55 | [diff] [blame] | 365 | virtual blink::WebColorChooser* createColorChooser( |
[email protected] | eb8c216a | 2014-04-09 19:19:19 | [diff] [blame] | 366 | blink::WebColorChooserClient* client, |
[email protected] | f3c59d6 | 2014-04-09 16:33:55 | [diff] [blame] | 367 | const blink::WebColor& initial_color, |
| 368 | const blink::WebVector<blink::WebColorSuggestion>& suggestions); |
[email protected] | 87de04b0 | 2014-04-08 22:14:49 | [diff] [blame] | 369 | virtual void runModalAlertDialog(const blink::WebString& message); |
| 370 | virtual bool runModalConfirmDialog(const blink::WebString& message); |
| 371 | virtual bool runModalPromptDialog(const blink::WebString& message, |
| 372 | const blink::WebString& default_value, |
| 373 | blink::WebString* actual_value); |
| 374 | virtual bool runModalBeforeUnloadDialog(bool is_reload, |
| 375 | const blink::WebString& message); |
[email protected] | 12cc511 | 2014-03-03 17:01:10 | [diff] [blame] | 376 | virtual void showContextMenu(const blink::WebContextMenuData& data); |
[email protected] | 9107034 | 2014-03-07 00:29:02 | [diff] [blame] | 377 | virtual void clearContextMenu(); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 378 | virtual void willSendRequest(blink::WebLocalFrame* frame, |
| 379 | unsigned identifier, |
| 380 | blink::WebURLRequest& request, |
| 381 | const blink::WebURLResponse& redirect_response); |
| 382 | virtual void didReceiveResponse(blink::WebLocalFrame* frame, |
| 383 | unsigned identifier, |
| 384 | const blink::WebURLResponse& response); |
| 385 | virtual void didFinishResourceLoad(blink::WebLocalFrame* frame, |
[email protected] | 255eea09 | 2013-06-28 17:19:14 | [diff] [blame] | 386 | unsigned identifier); |
[email protected] | 85d85fd | 2013-06-19 00:57:41 | [diff] [blame] | 387 | virtual void didLoadResourceFromMemoryCache( |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 388 | blink::WebLocalFrame* frame, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 389 | const blink::WebURLRequest& request, |
| 390 | const blink::WebURLResponse& response); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 391 | virtual void didDisplayInsecureContent(blink::WebLocalFrame* frame); |
| 392 | virtual void didRunInsecureContent(blink::WebLocalFrame* frame, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 393 | const blink::WebSecurityOrigin& origin, |
| 394 | const blink::WebURL& target); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 395 | virtual void didAbortLoading(blink::WebLocalFrame* frame); |
| 396 | virtual void didCreateScriptContext(blink::WebLocalFrame* frame, |
[email protected] | 85d85fd | 2013-06-19 00:57:41 | [diff] [blame] | 397 | v8::Handle<v8::Context> context, |
| 398 | int extension_group, |
[email protected] | 255eea09 | 2013-06-28 17:19:14 | [diff] [blame] | 399 | int world_id); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 400 | virtual void willReleaseScriptContext(blink::WebLocalFrame* frame, |
[email protected] | 85d85fd | 2013-06-19 00:57:41 | [diff] [blame] | 401 | v8::Handle<v8::Context> context, |
[email protected] | 255eea09 | 2013-06-28 17:19:14 | [diff] [blame] | 402 | int world_id); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 403 | virtual void didFirstVisuallyNonEmptyLayout(blink::WebLocalFrame* frame); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 404 | virtual void didChangeScrollOffset(blink::WebLocalFrame* frame); |
| 405 | virtual void willInsertBody(blink::WebLocalFrame* frame); |
[email protected] | 85d85fd | 2013-06-19 00:57:41 | [diff] [blame] | 406 | virtual void reportFindInPageMatchCount(int request_id, |
| 407 | int count, |
[email protected] | 255eea09 | 2013-06-28 17:19:14 | [diff] [blame] | 408 | bool final_update); |
[email protected] | 85d85fd | 2013-06-19 00:57:41 | [diff] [blame] | 409 | virtual void reportFindInPageSelection(int request_id, |
| 410 | int active_match_ordinal, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 411 | const blink::WebRect& sel); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 412 | virtual void requestStorageQuota(blink::WebLocalFrame* frame, |
| 413 | blink::WebStorageQuotaType type, |
| 414 | unsigned long long requested_size, |
| 415 | blink::WebStorageQuotaCallbacks callbacks); |
[email protected] | 85d85fd | 2013-06-19 00:57:41 | [diff] [blame] | 416 | virtual void willOpenSocketStream( |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 417 | blink::WebSocketStreamHandle* handle); |
[email protected] | a14903e0 | 2014-06-02 07:35:12 | [diff] [blame] | 418 | virtual void willOpenWebSocket(blink::WebSocketHandle* handle); |
[email protected] | 5ee7f18 | 2014-04-25 19:45:26 | [diff] [blame] | 419 | virtual blink::WebGeolocationClient* geolocationClient(); |
[email protected] | 4592086 | 2014-07-02 12:53:02 | [diff] [blame] | 420 | virtual blink::WebPushClient* pushClient(); |
[email protected] | 85d85fd | 2013-06-19 00:57:41 | [diff] [blame] | 421 | virtual void willStartUsingPeerConnectionHandler( |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 422 | blink::WebLocalFrame* frame, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 423 | blink::WebRTCPeerConnectionHandler* handler); |
[email protected] | bfe45e2 | 2014-04-25 16:47:53 | [diff] [blame] | 424 | virtual blink::WebUserMediaClient* userMediaClient(); |
[email protected] | 8538385f | 2014-04-25 19:45:04 | [diff] [blame] | 425 | virtual blink::WebMIDIClient* webMIDIClient(); |
[email protected] | 85d85fd | 2013-06-19 00:57:41 | [diff] [blame] | 426 | virtual bool willCheckAndDispatchMessageEvent( |
[email protected] | ce5064f | 2014-05-07 22:49:20 | [diff] [blame] | 427 | blink::WebLocalFrame* source_frame, |
| 428 | blink::WebFrame* target_frame, |
| 429 | blink::WebSecurityOrigin target_origin, |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 430 | blink::WebDOMMessageEvent event); |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 431 | virtual blink::WebString userAgentOverride(blink::WebLocalFrame* frame, |
| 432 | const blink::WebURL& url); |
| 433 | virtual blink::WebString doNotTrackValue(blink::WebLocalFrame* frame); |
| 434 | virtual bool allowWebGL(blink::WebLocalFrame* frame, bool default_value); |
| 435 | virtual void didLoseWebGLContext(blink::WebLocalFrame* frame, |
[email protected] | 255eea09 | 2013-06-28 17:19:14 | [diff] [blame] | 436 | int arb_robustness_status_code); |
[email protected] | 5cdd8fd8 | 2014-02-05 20:12:12 | [diff] [blame] | 437 | virtual void forwardInputEvent(const blink::WebInputEvent* event); |
[email protected] | 9ef43adc | 2014-02-19 08:02:15 | [diff] [blame] | 438 | virtual void initializeChildFrame(const blink::WebRect& frame_rect, |
| 439 | float scale_factor); |
[email protected] | cf78eda | 2014-06-13 16:57:41 | [diff] [blame] | 440 | virtual blink::WebScreenOrientationClient* webScreenOrientationClient(); |
horo | 96d38da | 2014-09-10 10:32:03 | [diff] [blame] | 441 | virtual bool isControlledByServiceWorker(); |
dmazzoni | 0b5d248 | 2014-09-10 19:45:57 | [diff] [blame] | 442 | virtual void postAccessibilityEvent(const blink::WebAXObject& obj, |
| 443 | blink::WebAXEvent event); |
mlamouri | efdca9d | 2014-09-16 16:55:40 | [diff] [blame^] | 444 | virtual void didChangeManifest(blink::WebLocalFrame*); |
[email protected] | 85d85fd | 2013-06-19 00:57:41 | [diff] [blame] | 445 | |
[email protected] | 9630731 | 2014-05-04 01:00:19 | [diff] [blame] | 446 | // WebMediaPlayerDelegate implementation: |
| 447 | virtual void DidPlay(blink::WebMediaPlayer* player) OVERRIDE; |
| 448 | virtual void DidPause(blink::WebMediaPlayer* player) OVERRIDE; |
| 449 | virtual void PlayerGone(blink::WebMediaPlayer* player) OVERRIDE; |
| 450 | |
[email protected] | c6bc2033 | 2014-02-28 18:30:39 | [diff] [blame] | 451 | // TODO(nasko): Make all tests in RenderViewImplTest friends and then move |
| 452 | // this back to private member. |
| 453 | void OnNavigate(const FrameMsg_Navigate_Params& params); |
| 454 | |
[email protected] | c52a141 | 2014-06-25 06:09:25 | [diff] [blame] | 455 | // Binds this render frame's service registry to a handle to the remote |
| 456 | // service registry. |
| 457 | void BindServiceRegistry( |
| 458 | mojo::ScopedMessagePipeHandle service_provider_handle); |
| 459 | |
[email protected] | 2f61bdd | 2013-07-02 18:38:47 | [diff] [blame] | 460 | protected: |
| 461 | RenderFrameImpl(RenderViewImpl* render_view, int32 routing_id); |
| 462 | |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 463 | private: |
[email protected] | 2e2d963 | 2013-12-03 00:55:26 | [diff] [blame] | 464 | friend class RenderFrameObserver; |
[email protected] | 9564021 | 2014-07-26 18:14:30 | [diff] [blame] | 465 | friend class RendererAccessibilityTest; |
avi | 485e5fd6 | 2014-08-25 23:26:14 | [diff] [blame] | 466 | FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuDisplayNoneTest, SelectItem); |
| 467 | FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuRemoveTest, RemoveOnChange); |
| 468 | FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, NormalCase); |
| 469 | FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuTest, ShowPopupThenNavigate); |
[email protected] | 66bbadaf | 2014-03-28 16:25:54 | [diff] [blame] | 470 | FRIEND_TEST_ALL_PREFIXES(RendererAccessibilityTest, |
| 471 | AccessibilityMessagesQueueWhileSwappedOut); |
[email protected] | ae2477e | 2014-05-27 23:47:08 | [diff] [blame] | 472 | FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest, |
[email protected] | a09d53ce | 2014-01-31 00:46:42 | [diff] [blame] | 473 | ShouldUpdateSelectionTextFromContextMenuParams); |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 474 | FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, |
| 475 | OnExtendSelectionAndDelete); |
[email protected] | 66bbadaf | 2014-03-28 16:25:54 | [diff] [blame] | 476 | FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, ReloadWhileSwappedOut); |
| 477 | FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, SendSwapOutACK); |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 478 | FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, |
| 479 | SetEditableSelectionAndComposition); |
[email protected] | 9564021 | 2014-07-26 18:14:30 | [diff] [blame] | 480 | FRIEND_TEST_ALL_PREFIXES(RenderViewImplTest, |
| 481 | OnSetAccessibilityMode); |
[email protected] | 2e2d963 | 2013-12-03 00:55:26 | [diff] [blame] | 482 | |
[email protected] | 37567b43 | 2014-02-12 01:12:22 | [diff] [blame] | 483 | typedef std::map<GURL, double> HostZoomLevels; |
| 484 | |
[email protected] | 2e2d963 | 2013-12-03 00:55:26 | [diff] [blame] | 485 | // Functions to add and remove observers for this object. |
| 486 | void AddObserver(RenderFrameObserver* observer); |
| 487 | void RemoveObserver(RenderFrameObserver* observer); |
[email protected] | 1c2052f | 2013-08-28 08:24:34 | [diff] [blame] | 488 | |
[email protected] | f0906a0 | 2014-08-07 07:18:55 | [diff] [blame] | 489 | // Builds and sends DidCommitProvisionalLoad to the host. |
| 490 | void SendDidCommitProvisionalLoad(blink::WebFrame* frame); |
[email protected] | 37567b43 | 2014-02-12 01:12:22 | [diff] [blame] | 491 | |
[email protected] | 9c9343b | 2014-03-08 02:56:07 | [diff] [blame] | 492 | // Gets the focused element. If no such element exists then the element will |
| 493 | // be NULL. |
| 494 | blink::WebElement GetFocusedElement(); |
| 495 | |
[email protected] | b70da4c | 2014-01-06 19:57:09 | [diff] [blame] | 496 | // IPC message handlers ------------------------------------------------------ |
| 497 | // |
| 498 | // The documentation for these functions should be in |
| 499 | // content/common/*_messages.h for the message that the function is handling. |
[email protected] | f76f3223 | 2014-03-11 17:36:17 | [diff] [blame] | 500 | void OnBeforeUnload(); |
[email protected] | 5a7100d | 2014-05-19 01:29:04 | [diff] [blame] | 501 | void OnSwapOut(int proxy_routing_id); |
Nasko Oskov | 85f6022 | 2014-08-28 22:53:30 | [diff] [blame] | 502 | void OnStop(); |
[email protected] | a09d53ce | 2014-01-31 00:46:42 | [diff] [blame] | 503 | void OnShowContextMenu(const gfx::Point& location); |
| 504 | void OnContextMenuClosed(const CustomContextMenuContext& custom_context); |
| 505 | void OnCustomContextMenuAction(const CustomContextMenuContext& custom_context, |
| 506 | unsigned action); |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 507 | void OnUndo(); |
| 508 | void OnRedo(); |
[email protected] | 9c9343b | 2014-03-08 02:56:07 | [diff] [blame] | 509 | void OnCut(); |
| 510 | void OnCopy(); |
| 511 | void OnPaste(); |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 512 | void OnPasteAndMatchStyle(); |
| 513 | void OnDelete(); |
| 514 | void OnSelectAll(); |
| 515 | void OnSelectRange(const gfx::Point& start, const gfx::Point& end); |
| 516 | void OnUnselect(); |
[email protected] | 1f3fc1d | 2014-04-03 14:50:17 | [diff] [blame] | 517 | void OnReplace(const base::string16& text); |
| 518 | void OnReplaceMisspelling(const base::string16& text); |
[email protected] | e31b8ebb | 2014-03-07 17:59:34 | [diff] [blame] | 519 | void OnCSSInsertRequest(const std::string& css); |
[email protected] | f13ab89 | 2014-03-12 06:48:52 | [diff] [blame] | 520 | void OnJavaScriptExecuteRequest(const base::string16& javascript, |
| 521 | int id, |
| 522 | bool notify_result); |
zeeshanq | 3454e9c | 2014-09-04 21:30:28 | [diff] [blame] | 523 | void OnJavaScriptExecuteRequestForTests(const base::string16& javascript, |
| 524 | int id, |
| 525 | bool notify_result); |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 526 | void OnSetEditableSelectionOffsets(int start, int end); |
[email protected] | e5e438d6 | 2014-03-27 21:47:16 | [diff] [blame] | 527 | void OnSetCompositionFromExistingText( |
| 528 | int start, int end, |
| 529 | const std::vector<blink::WebCompositionUnderline>& underlines); |
| 530 | void OnExtendSelectionAndDelete(int before, int after); |
[email protected] | 4fed370 | 2014-04-01 09:08:00 | [diff] [blame] | 531 | void OnReload(bool ignore_cache); |
[email protected] | 96bb613 | 2014-06-16 17:22:19 | [diff] [blame] | 532 | void OnTextSurroundingSelectionRequest(size_t max_length); |
[email protected] | 2e531f7 | 2014-06-20 23:23:39 | [diff] [blame] | 533 | void OnAddStyleSheetByURL(const std::string& url); |
[email protected] | 9e6bea41 | 2014-08-08 06:35:25 | [diff] [blame] | 534 | void OnSetupTransitionView(const std::string& markup); |
| 535 | void OnBeginExitTransition(const std::string& css_selector); |
[email protected] | 9564021 | 2014-07-26 18:14:30 | [diff] [blame] | 536 | void OnSetAccessibilityMode(AccessibilityMode new_mode); |
creis | bbbeb06 | 2014-08-25 18:20:31 | [diff] [blame] | 537 | void OnDisownOpener(); |
avi | 485e5fd6 | 2014-08-25 23:26:14 | [diff] [blame] | 538 | #if defined(OS_ANDROID) |
| 539 | void OnSelectPopupMenuItems(bool canceled, |
| 540 | const std::vector<int>& selected_indices); |
| 541 | #elif defined(OS_MACOSX) |
| 542 | void OnSelectPopupMenuItem(int selected_index); |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 543 | void OnCopyToFindPboard(); |
| 544 | #endif |
[email protected] | 9c9343b | 2014-03-08 02:56:07 | [diff] [blame] | 545 | |
[email protected] | 65920f33 | 2014-03-04 21:14:18 | [diff] [blame] | 546 | // Virtual since overridden by WebTestProxy for layout tests. |
| 547 | virtual blink::WebNavigationPolicy DecidePolicyForNavigation( |
| 548 | RenderFrame* render_frame, |
[email protected] | 0c3c54f | 2014-07-31 01:29:00 | [diff] [blame] | 549 | const NavigationPolicyInfo& info); |
[email protected] | 65920f33 | 2014-03-04 21:14:18 | [diff] [blame] | 550 | void OpenURL(blink::WebFrame* frame, |
| 551 | const GURL& url, |
| 552 | const Referrer& referrer, |
| 553 | blink::WebNavigationPolicy policy); |
[email protected] | a09d53ce | 2014-01-31 00:46:42 | [diff] [blame] | 554 | |
[email protected] | ef3adfc | 2014-05-11 00:04:54 | [diff] [blame] | 555 | // Update current main frame's encoding and send it to browser window. |
| 556 | // Since we want to let users see the right encoding info from menu |
| 557 | // before finishing loading, we call the UpdateEncoding in |
| 558 | // a) function:DidCommitLoadForFrame. When this function is called, |
| 559 | // that means we have got first data. In here we try to get encoding |
| 560 | // of page if it has been specified in http header. |
| 561 | // b) function:DidReceiveTitle. When this function is called, |
| 562 | // that means we have got specified title. Because in most of webpages, |
| 563 | // title tags will follow meta tags. In here we try to get encoding of |
| 564 | // page if it has been specified in meta tag. |
| 565 | // c) function:DidFinishDocumentLoadForFrame. When this function is |
| 566 | // called, that means we have got whole html page. In here we should |
| 567 | // finally get right encoding of page. |
| 568 | void UpdateEncoding(blink::WebFrame* frame, |
| 569 | const std::string& encoding_name); |
| 570 | |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 571 | // Dispatches the current state of selection on the webpage to the browser if |
| 572 | // it has changed. |
| 573 | // TODO(varunjain): delete this method once we figure out how to keep |
| 574 | // selection handles in sync with the webpage. |
| 575 | void SyncSelectionIfRequired(); |
| 576 | |
[email protected] | a09d53ce | 2014-01-31 00:46:42 | [diff] [blame] | 577 | // Returns whether |params.selection_text| should be synchronized to the |
| 578 | // browser before bringing up the context menu. Static for testing. |
| 579 | static bool ShouldUpdateSelectionTextFromContextMenuParams( |
| 580 | const base::string16& selection_text, |
| 581 | size_t selection_text_offset, |
| 582 | const gfx::Range& selection_range, |
| 583 | const ContextMenuParams& params); |
[email protected] | b70da4c | 2014-01-06 19:57:09 | [diff] [blame] | 584 | |
[email protected] | 87de04b0 | 2014-04-08 22:14:49 | [diff] [blame] | 585 | bool RunJavaScriptMessage(JavaScriptMessageType type, |
| 586 | const base::string16& message, |
| 587 | const base::string16& default_value, |
| 588 | const GURL& frame_url, |
| 589 | base::string16* result); |
| 590 | |
[email protected] | 457736d | 2014-04-30 15:54:27 | [diff] [blame] | 591 | // Loads the appropriate error page for the specified failure into the frame. |
| 592 | void LoadNavigationErrorPage(const blink::WebURLRequest& failed_request, |
| 593 | const blink::WebURLError& error, |
| 594 | bool replace); |
| 595 | |
zeeshanq | 3454e9c | 2014-09-04 21:30:28 | [diff] [blame] | 596 | void HandleJavascriptExecutionResult(const base::string16& javascript, |
| 597 | int id, |
| 598 | bool notify_result, |
| 599 | v8::Handle<v8::Value> result); |
| 600 | |
[email protected] | 977db4a4 | 2014-07-17 08:04:32 | [diff] [blame] | 601 | // Initializes |web_user_media_client_|. If this fails, because it wasn't |
| 602 | // possible to create a MediaStreamClient (e.g., WebRTC is disabled), then |
| 603 | // |web_user_media_client_| will remain NULL. |
| 604 | void InitializeUserMediaClient(); |
[email protected] | 9630731 | 2014-05-04 01:00:19 | [diff] [blame] | 605 | |
| 606 | blink::WebMediaPlayer* CreateWebMediaPlayerForMediaStream( |
| 607 | const blink::WebURL& url, |
| 608 | blink::WebMediaPlayerClient* client); |
| 609 | |
[email protected] | ae2477e | 2014-05-27 23:47:08 | [diff] [blame] | 610 | // Creates a factory object used for creating audio and video renderers. |
| 611 | // The method is virtual so that layouttests can override it. |
| 612 | virtual scoped_ptr<MediaStreamRendererFactory> CreateRendererFactory(); |
| 613 | |
[email protected] | f3a9531 | 2014-06-12 16:46:58 | [diff] [blame] | 614 | // Returns the URL being loaded by the |frame_|'s request. |
| 615 | GURL GetLoadingUrl() const; |
| 616 | |
[email protected] | 9630731 | 2014-05-04 01:00:19 | [diff] [blame] | 617 | #if defined(OS_ANDROID) |
[email protected] | 65f3d1aa | 2014-05-29 01:57:00 | [diff] [blame] | 618 | blink::WebMediaPlayer* CreateAndroidWebMediaPlayer( |
[email protected] | 9630731 | 2014-05-04 01:00:19 | [diff] [blame] | 619 | const blink::WebURL& url, |
| 620 | blink::WebMediaPlayerClient* client); |
[email protected] | a017938b | 2014-05-27 21:17:17 | [diff] [blame] | 621 | |
[email protected] | 65f3d1aa | 2014-05-29 01:57:00 | [diff] [blame] | 622 | RendererMediaPlayerManager* GetMediaPlayerManager(); |
[email protected] | 4b556cf | 2014-06-10 23:21:53 | [diff] [blame] | 623 | #endif |
| 624 | |
| 625 | #if defined(ENABLE_BROWSER_CDMS) |
[email protected] | 65f3d1aa | 2014-05-29 01:57:00 | [diff] [blame] | 626 | RendererCdmManager* GetCdmManager(); |
[email protected] | 9630731 | 2014-05-04 01:00:19 | [diff] [blame] | 627 | #endif |
| 628 | |
[email protected] | 35b2a97 | 2014-04-04 15:50:22 | [diff] [blame] | 629 | // Stores the WebLocalFrame we are associated with. |
| 630 | blink::WebLocalFrame* frame_; |
[email protected] | b70da4c | 2014-01-06 19:57:09 | [diff] [blame] | 631 | |
[email protected] | abc501e | 2014-01-27 19:27:26 | [diff] [blame] | 632 | base::WeakPtr<RenderViewImpl> render_view_; |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 633 | int routing_id_; |
[email protected] | 1c2052f | 2013-08-28 08:24:34 | [diff] [blame] | 634 | bool is_swapped_out_; |
[email protected] | 5a7100d | 2014-05-19 01:29:04 | [diff] [blame] | 635 | // RenderFrameProxy exists only when is_swapped_out_ is true. |
| 636 | // TODO(nasko): This can be removed once we don't have a swapped out state on |
| 637 | // RenderFrame. See https://crbug.com/357747. |
| 638 | RenderFrameProxy* render_frame_proxy_; |
[email protected] | 1c2052f | 2013-08-28 08:24:34 | [diff] [blame] | 639 | bool is_detaching_; |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 640 | |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 641 | #if defined(ENABLE_PLUGINS) |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 642 | // Current text input composition text. Empty if no composition is in |
| 643 | // progress. |
[email protected] | fcf75d4 | 2013-12-03 20:11:26 | [diff] [blame] | 644 | base::string16 pepper_composition_text_; |
[email protected] | 7a4e253 | 2013-12-02 21:30:02 | [diff] [blame] | 645 | #endif |
| 646 | |
[email protected] | f3add92 | 2013-12-20 23:17:16 | [diff] [blame] | 647 | RendererWebCookieJarImpl cookie_jar_; |
| 648 | |
[email protected] | 2e2d963 | 2013-12-03 00:55:26 | [diff] [blame] | 649 | // All the registered observers. |
| 650 | ObserverList<RenderFrameObserver> observers_; |
| 651 | |
[email protected] | bffc830 | 2014-01-23 20:52:16 | [diff] [blame] | 652 | scoped_refptr<ChildFrameCompositingHelper> compositing_helper_; |
| 653 | |
[email protected] | 4ecee35 | 2014-03-11 21:12:19 | [diff] [blame] | 654 | // The node that the context menu was pressed over. |
| 655 | blink::WebNode context_menu_node_; |
| 656 | |
[email protected] | a09d53ce | 2014-01-31 00:46:42 | [diff] [blame] | 657 | // External context menu requests we're waiting for. "Internal" |
| 658 | // (WebKit-originated) context menu events will have an ID of 0 and will not |
| 659 | // be in this map. |
| 660 | // |
| 661 | // We don't want to add internal ones since some of the "special" page |
| 662 | // handlers in the browser process just ignore the context menu requests so |
| 663 | // avoid showing context menus, and so this will cause right clicks to leak |
| 664 | // entries in this map. Most users of the custom context menu (e.g. Pepper |
| 665 | // plugins) are normally only on "regular" pages and the regular pages will |
| 666 | // always respond properly to the request, so we don't have to worry so |
| 667 | // much about leaks. |
| 668 | IDMap<ContextMenuClient, IDMapExternalPointer> pending_context_menus_; |
| 669 | |
[email protected] | 4ee6462 | 2014-03-21 22:34:15 | [diff] [blame] | 670 | // The text selection the last time DidChangeSelection got called. May contain |
| 671 | // additional characters before and after the selected text, for IMEs. The |
| 672 | // portion of this string that is the actual selected text starts at index |
| 673 | // |selection_range_.GetMin() - selection_text_offset_| and has length |
| 674 | // |selection_range_.length()|. |
| 675 | base::string16 selection_text_; |
| 676 | // The offset corresponding to the start of |selection_text_| in the document. |
| 677 | size_t selection_text_offset_; |
| 678 | // Range over the document corresponding to the actual selected text (which |
| 679 | // could correspond to a substring of |selection_text_|; see above). |
| 680 | gfx::Range selection_range_; |
| 681 | // Used to inform didChangeSelection() when it is called in the context |
| 682 | // of handling a InputMsg_SelectRange IPC. |
| 683 | bool handling_select_range_; |
| 684 | |
[email protected] | 2626d14 | 2014-04-22 17:24:02 | [diff] [blame] | 685 | // The next group of objects all implement RenderFrameObserver, so are deleted |
| 686 | // along with the RenderFrame automatically. This is why we just store weak |
| 687 | // references. |
| 688 | |
[email protected] | 4459599e | 2014-07-29 22:40:09 | [diff] [blame] | 689 | // Dispatches permission requests for Web Notifications. |
| 690 | NotificationPermissionDispatcher* notification_permission_dispatcher_; |
| 691 | |
[email protected] | 2626d14 | 2014-04-22 17:24:02 | [diff] [blame] | 692 | // Holds a reference to the service which provides desktop notifications. |
[email protected] | 4459599e | 2014-07-29 22:40:09 | [diff] [blame] | 693 | // TODO(peter) Remove this once Web Notifications are routed through Platform. |
[email protected] | 2626d14 | 2014-04-22 17:24:02 | [diff] [blame] | 694 | NotificationProvider* notification_provider_; |
| 695 | |
[email protected] | 977db4a4 | 2014-07-17 08:04:32 | [diff] [blame] | 696 | // Destroyed via the RenderFrameObserver::OnDestruct() mechanism. |
perkj | 1a2d043 | 2014-09-03 13:52:33 | [diff] [blame] | 697 | UserMediaClientImpl* web_user_media_client_; |
[email protected] | 9630731 | 2014-05-04 01:00:19 | [diff] [blame] | 698 | |
[email protected] | 52d3e17 | 2014-06-16 16:57:02 | [diff] [blame] | 699 | // MidiClient attached to this frame; lazily initialized. |
| 700 | MidiDispatcher* midi_dispatcher_; |
| 701 | |
[email protected] | a017938b | 2014-05-27 21:17:17 | [diff] [blame] | 702 | #if defined(OS_ANDROID) |
[email protected] | 4b556cf | 2014-06-10 23:21:53 | [diff] [blame] | 703 | // Manages all media players in this render frame for communicating with the |
| 704 | // real media player in the browser process. It's okay to use a raw pointer |
| 705 | // since it's a RenderFrameObserver. |
[email protected] | a017938b | 2014-05-27 21:17:17 | [diff] [blame] | 706 | RendererMediaPlayerManager* media_player_manager_; |
[email protected] | 4b556cf | 2014-06-10 23:21:53 | [diff] [blame] | 707 | #endif |
| 708 | |
| 709 | #if defined(ENABLE_BROWSER_CDMS) |
| 710 | // Manage all CDMs in this render frame for communicating with the real CDM in |
| 711 | // the browser process. It's okay to use a raw pointer since it's a |
| 712 | // RenderFrameObserver. |
[email protected] | 65f3d1aa | 2014-05-29 01:57:00 | [diff] [blame] | 713 | RendererCdmManager* cdm_manager_; |
[email protected] | a017938b | 2014-05-27 21:17:17 | [diff] [blame] | 714 | #endif |
| 715 | |
[email protected] | a6e21c37 | 2014-07-12 02:27:21 | [diff] [blame] | 716 | #if defined(VIDEO_HOLE) |
| 717 | // Whether or not this RenderFrameImpl contains a media player. Used to |
| 718 | // register as an observer for video-hole-specific events. |
| 719 | bool contains_media_player_; |
| 720 | #endif |
| 721 | |
[email protected] | 4592086 | 2014-07-02 12:53:02 | [diff] [blame] | 722 | // The geolocation dispatcher attached to this frame, lazily initialized. |
[email protected] | 8eae080 | 2014-06-02 21:35:55 | [diff] [blame] | 723 | GeolocationDispatcher* geolocation_dispatcher_; |
| 724 | |
[email protected] | 4592086 | 2014-07-02 12:53:02 | [diff] [blame] | 725 | // The push messaging dispatcher attached to this frame, lazily initialized. |
| 726 | PushMessagingDispatcher* push_messaging_dispatcher_; |
| 727 | |
[email protected] | c52a141 | 2014-06-25 06:09:25 | [diff] [blame] | 728 | ServiceRegistryImpl service_registry_; |
| 729 | |
[email protected] | 4592086 | 2014-07-02 12:53:02 | [diff] [blame] | 730 | // The screen orientation dispatcher attached to the frame, lazily |
| 731 | // initialized. |
[email protected] | cf78eda | 2014-06-13 16:57:41 | [diff] [blame] | 732 | ScreenOrientationDispatcher* screen_orientation_dispatcher_; |
| 733 | |
mlamouri | efdca9d | 2014-09-16 16:55:40 | [diff] [blame^] | 734 | // The Manifest Manager handles the manifest requests from the browser |
| 735 | // process. |
| 736 | ManifestManager* manifest_manager_; |
| 737 | |
[email protected] | 9564021 | 2014-07-26 18:14:30 | [diff] [blame] | 738 | // The current accessibility mode. |
| 739 | AccessibilityMode accessibility_mode_; |
| 740 | |
| 741 | // Only valid if |accessibility_mode_| is anything other than |
| 742 | // AccessibilityModeOff. |
| 743 | RendererAccessibility* renderer_accessibility_; |
| 744 | |
avi | 485e5fd6 | 2014-08-25 23:26:14 | [diff] [blame] | 745 | #if defined(OS_MACOSX) || defined(OS_ANDROID) |
| 746 | // The external popup for the currently showing select popup. |
| 747 | scoped_ptr<ExternalPopupMenu> external_popup_menu_; |
| 748 | #endif |
| 749 | |
[email protected] | 9630731 | 2014-05-04 01:00:19 | [diff] [blame] | 750 | base::WeakPtrFactory<RenderFrameImpl> weak_factory_; |
| 751 | |
[email protected] | 227692c5 | 2013-05-31 22:43:04 | [diff] [blame] | 752 | DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); |
| 753 | }; |
| 754 | |
| 755 | } // namespace content |
| 756 | |
[email protected] | 85d85fd | 2013-06-19 00:57:41 | [diff] [blame] | 757 | #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |