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 // A BrowserPluginGuest is the browser side of a browser <--> embedder | 5 // A BrowserPluginGuest is the browser side of a browser <--> embedder |
6 // renderer channel. A BrowserPlugin (a WebPlugin) is on the embedder | 6 // renderer channel. A BrowserPlugin (a WebPlugin) is on the embedder |
7 // renderer side of browser <--> embedder renderer communication. | 7 // renderer side of browser <--> embedder renderer communication. |
8 // | 8 // |
9 // BrowserPluginGuest lives on the UI thread of the browser process. Any | 9 // BrowserPluginGuest lives on the UI thread of the browser process. Any |
10 // messages about the guest render process that the embedder might be interested | 10 // messages about the guest render process that the embedder might be interested |
(...skipping 25 matching lines...) Expand all Loading... |
36 #include "ui/base/ime/text_input_mode.h" | 36 #include "ui/base/ime/text_input_mode.h" |
37 #include "ui/base/ime/text_input_type.h" | 37 #include "ui/base/ime/text_input_type.h" |
38 #include "ui/gfx/rect.h" | 38 #include "ui/gfx/rect.h" |
39 | 39 |
40 class SkBitmap; | 40 class SkBitmap; |
41 struct BrowserPluginHostMsg_Attach_Params; | 41 struct BrowserPluginHostMsg_Attach_Params; |
42 struct BrowserPluginHostMsg_ResizeGuest_Params; | 42 struct BrowserPluginHostMsg_ResizeGuest_Params; |
43 struct FrameHostMsg_CompositorFrameSwappedACK_Params; | 43 struct FrameHostMsg_CompositorFrameSwappedACK_Params; |
44 struct FrameHostMsg_ReclaimCompositorResources_Params; | 44 struct FrameHostMsg_ReclaimCompositorResources_Params; |
45 #if defined(OS_MACOSX) | 45 #if defined(OS_MACOSX) |
46 struct ViewHostMsg_ShowPopup_Params; | 46 struct FrameHostMsg_ShowPopup_Params; |
47 #endif | 47 #endif |
48 struct ViewHostMsg_TextInputState_Params; | 48 struct ViewHostMsg_TextInputState_Params; |
49 struct ViewHostMsg_UpdateRect_Params; | 49 struct ViewHostMsg_UpdateRect_Params; |
50 | 50 |
51 namespace blink { | 51 namespace blink { |
52 class WebInputEvent; | 52 class WebInputEvent; |
53 } | 53 } |
54 | 54 |
55 namespace gfx { | 55 namespace gfx { |
56 class Range; | 56 class Range; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 | 146 |
147 // WebContentsObserver implementation. | 147 // WebContentsObserver implementation. |
148 virtual void DidCommitProvisionalLoadForFrame( | 148 virtual void DidCommitProvisionalLoadForFrame( |
149 RenderFrameHost* render_frame_host, | 149 RenderFrameHost* render_frame_host, |
150 const GURL& url, | 150 const GURL& url, |
151 PageTransition transition_type) OVERRIDE; | 151 PageTransition transition_type) OVERRIDE; |
152 | 152 |
153 virtual void RenderViewReady() OVERRIDE; | 153 virtual void RenderViewReady() OVERRIDE; |
154 virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE; | 154 virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE; |
155 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 155 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 156 virtual bool OnMessageReceived(const IPC::Message& message, |
| 157 RenderFrameHost* render_frame_host) OVERRIDE; |
156 | 158 |
157 // Exposes the protected web_contents() from WebContentsObserver. | 159 // Exposes the protected web_contents() from WebContentsObserver. |
158 WebContentsImpl* GetWebContents() const; | 160 WebContentsImpl* GetWebContents() const; |
159 | 161 |
160 gfx::Point GetScreenCoordinates(const gfx::Point& relative_position) const; | 162 gfx::Point GetScreenCoordinates(const gfx::Point& relative_position) const; |
161 | 163 |
162 // Helper to send messages to embedder. This methods fills the message with | 164 // Helper to send messages to embedder. This methods fills the message with |
163 // the correct routing id. | 165 // the correct routing id. |
164 void SendMessageToEmbedder(IPC::Message* msg); | 166 void SendMessageToEmbedder(IPC::Message* msg); |
165 | 167 |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 #endif | 299 #endif |
298 | 300 |
299 // Message handlers for messages from guest. | 301 // Message handlers for messages from guest. |
300 | 302 |
301 void OnDragStopped(); | 303 void OnDragStopped(); |
302 void OnHandleInputEventAck( | 304 void OnHandleInputEventAck( |
303 blink::WebInputEvent::Type event_type, | 305 blink::WebInputEvent::Type event_type, |
304 InputEventAckState ack_result); | 306 InputEventAckState ack_result); |
305 void OnHasTouchEventHandlers(bool accept); | 307 void OnHasTouchEventHandlers(bool accept); |
306 void OnSetCursor(const WebCursor& cursor); | 308 void OnSetCursor(const WebCursor& cursor); |
| 309 #if defined(OS_MACOSX) |
307 // On MacOSX popups are painted by the browser process. We handle them here | 310 // On MacOSX popups are painted by the browser process. We handle them here |
308 // so that they are positioned correctly. | 311 // so that they are positioned correctly. |
309 #if defined(OS_MACOSX) | 312 void OnShowPopup(const FrameHostMsg_ShowPopup_Params& params); |
310 void OnShowPopup(const ViewHostMsg_ShowPopup_Params& params); | |
311 #endif | 313 #endif |
312 void OnShowWidget(int route_id, const gfx::Rect& initial_pos); | 314 void OnShowWidget(int route_id, const gfx::Rect& initial_pos); |
313 void OnTakeFocus(bool reverse); | 315 void OnTakeFocus(bool reverse); |
314 void OnUpdateFrameName(int frame_id, | 316 void OnUpdateFrameName(int frame_id, |
315 bool is_top_level, | 317 bool is_top_level, |
316 const std::string& name); | 318 const std::string& name); |
317 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); | 319 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); |
318 | 320 |
319 // Forwards all messages from the |pending_messages_| queue to the embedder. | 321 // Forwards all messages from the |pending_messages_| queue to the embedder. |
320 void SendQueuedMessages(); | 322 void SendQueuedMessages(); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 ui::TextInputType last_text_input_type_; | 361 ui::TextInputType last_text_input_type_; |
360 ui::TextInputMode last_input_mode_; | 362 ui::TextInputMode last_input_mode_; |
361 bool last_can_compose_inline_; | 363 bool last_can_compose_inline_; |
362 | 364 |
363 // This is a queue of messages that are destined to be sent to the embedder | 365 // This is a queue of messages that are destined to be sent to the embedder |
364 // once the guest is attached to a particular embedder. | 366 // once the guest is attached to a particular embedder. |
365 std::deque<linked_ptr<IPC::Message> > pending_messages_; | 367 std::deque<linked_ptr<IPC::Message> > pending_messages_; |
366 | 368 |
367 BrowserPluginGuestDelegate* const delegate_; | 369 BrowserPluginGuestDelegate* const delegate_; |
368 | 370 |
| 371 // Used during IPC message dispatching from the RenderFrame so that the |
| 372 // handlers can get a pointer to the RFH through which the message was |
| 373 // received. |
| 374 RenderFrameHost* render_frame_message_source_; |
| 375 |
369 // Weak pointer used to ask GeolocationPermissionContext about geolocation | 376 // Weak pointer used to ask GeolocationPermissionContext about geolocation |
370 // permission. | 377 // permission. |
371 base::WeakPtrFactory<BrowserPluginGuest> weak_ptr_factory_; | 378 base::WeakPtrFactory<BrowserPluginGuest> weak_ptr_factory_; |
372 | 379 |
373 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); | 380 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); |
374 }; | 381 }; |
375 | 382 |
376 } // namespace content | 383 } // namespace content |
377 | 384 |
378 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ | 385 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ |
OLD | NEW |