| 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 BrowserPluginEmbedder handles messages coming from a BrowserPlugin's | 5 // A BrowserPluginEmbedder handles messages coming from a BrowserPlugin's |
| 6 // embedder that are not directed at any particular existing guest process. | 6 // embedder that are not directed at any particular existing guest process. |
| 7 // In the beginning, when a BrowserPlugin instance in the embedder renderer | 7 // In the beginning, when a BrowserPlugin instance in the embedder renderer |
| 8 // process requests an initial navigation, the WebContents for that renderer | 8 // process requests an initial navigation, the WebContents for that renderer |
| 9 // renderer creates a BrowserPluginEmbedder for itself. The | 9 // renderer creates a BrowserPluginEmbedder for itself. The |
| 10 // BrowserPluginEmbedder, in turn, forwards the requests to a | 10 // BrowserPluginEmbedder, in turn, forwards the requests to a |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 static BrowserPluginEmbedder* Create(WebContentsImpl* web_contents); | 35 static BrowserPluginEmbedder* Create(WebContentsImpl* web_contents); |
| 36 | 36 |
| 37 // Called when embedder's |rwh| has sent screen rects to renderer. | 37 // Called when embedder's |rwh| has sent screen rects to renderer. |
| 38 void DidSendScreenRects(); | 38 void DidSendScreenRects(); |
| 39 | 39 |
| 40 // WebContentsObserver implementation. | 40 // WebContentsObserver implementation. |
| 41 bool OnMessageReceived(const IPC::Message& message) override; | 41 bool OnMessageReceived(const IPC::Message& message) override; |
| 42 bool OnMessageReceived(const IPC::Message& message, | 42 bool OnMessageReceived(const IPC::Message& message, |
| 43 RenderFrameHost* render_frame_host) override; | 43 RenderFrameHost* render_frame_host) override; |
| 44 | 44 |
| 45 // Sends a 'dragend' message to the guest that started the drag. |
| 45 void DragSourceEndedAt(int client_x, int client_y, int screen_x, | 46 void DragSourceEndedAt(int client_x, int client_y, int screen_x, |
| 46 int screen_y, blink::WebDragOperation operation); | 47 int screen_y, blink::WebDragOperation operation); |
| 47 | 48 |
| 48 void DragEnteredGuest(BrowserPluginGuest* guest); | 49 // Indicates that a drag operation has entered into the bounds of a given |
| 50 // |guest|. Returns whether the |guest| also started the operation. |
| 51 bool DragEnteredGuest(BrowserPluginGuest* guest); |
| 49 | 52 |
| 53 // Indicates that a drag operation has left the bounds of a given |guest|. |
| 50 void DragLeftGuest(BrowserPluginGuest* guest); | 54 void DragLeftGuest(BrowserPluginGuest* guest); |
| 51 | 55 |
| 56 // Called by WebContentsViewGuest when a drag operation is started within |
| 57 // |guest|. This |guest| will be signaled at the end of the drag operation. |
| 52 void StartDrag(BrowserPluginGuest* guest); | 58 void StartDrag(BrowserPluginGuest* guest); |
| 53 | 59 |
| 54 // Sends EndSystemDrag message to the guest that initiated the last drag/drop | 60 // Sends EndSystemDrag message to the guest that initiated the last drag/drop |
| 55 // operation, if there's any. | 61 // operation, if there's any. |
| 56 void SystemDragEnded(); | 62 void SystemDragEnded(); |
| 57 | 63 |
| 58 // Used to handle special keyboard events. | 64 // Used to handle special keyboard events. |
| 59 bool HandleKeyboardEvent(const NativeWebKeyboardEvent& event); | 65 bool HandleKeyboardEvent(const NativeWebKeyboardEvent& event); |
| 60 | 66 |
| 61 // Find the given |search_text| in the page. Returns true if the find request | 67 // Find the given |search_text| in the page. Returns true if the find request |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 bool guest_drag_ending_; | 111 bool guest_drag_ending_; |
| 106 | 112 |
| 107 base::WeakPtrFactory<BrowserPluginEmbedder> weak_ptr_factory_; | 113 base::WeakPtrFactory<BrowserPluginEmbedder> weak_ptr_factory_; |
| 108 | 114 |
| 109 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder); | 115 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder); |
| 110 }; | 116 }; |
| 111 | 117 |
| 112 } // namespace content | 118 } // namespace content |
| 113 | 119 |
| 114 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ | 120 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ |
| OLD | NEW |