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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 void SystemDragEnded(); | 68 void SystemDragEnded(); |
69 | 69 |
70 // Used to handle special keyboard events. | 70 // Used to handle special keyboard events. |
71 bool HandleKeyboardEvent(const NativeWebKeyboardEvent& event); | 71 bool HandleKeyboardEvent(const NativeWebKeyboardEvent& event); |
72 | 72 |
73 private: | 73 private: |
74 explicit BrowserPluginEmbedder(WebContentsImpl* web_contents); | 74 explicit BrowserPluginEmbedder(WebContentsImpl* web_contents); |
75 | 75 |
76 BrowserPluginGuestManager* GetBrowserPluginGuestManager() const; | 76 BrowserPluginGuestManager* GetBrowserPluginGuestManager() const; |
77 | 77 |
| 78 void ClearGuestDragStateIfApplicable(); |
| 79 |
78 bool DidSendScreenRectsCallback(WebContents* guest_web_contents); | 80 bool DidSendScreenRectsCallback(WebContents* guest_web_contents); |
79 | 81 |
80 bool SetZoomLevelCallback(double level, WebContents* guest_web_contents); | 82 bool SetZoomLevelCallback(double level, WebContents* guest_web_contents); |
81 | 83 |
82 bool UnlockMouseIfNecessaryCallback(bool* mouse_unlocked, WebContents* guest); | 84 bool UnlockMouseIfNecessaryCallback(bool* mouse_unlocked, WebContents* guest); |
83 | 85 |
84 // Called by the content embedder when a guest exists with the provided | 86 // Called by the content embedder when a guest exists with the provided |
85 // |instance_id|. | 87 // |instance_id|. |
86 void OnGuestCallback(int instance_id, | 88 void OnGuestCallback(int instance_id, |
87 const BrowserPluginHostMsg_Attach_Params& params, | 89 const BrowserPluginHostMsg_Attach_Params& params, |
(...skipping 13 matching lines...) Expand all Loading... |
101 // handle a race condition when dropping onto the guest that started the drag | 103 // handle a race condition when dropping onto the guest that started the drag |
102 // (the race is that the dragend message arrives before the drop message so | 104 // (the race is that the dragend message arrives before the drop message so |
103 // the drop never takes place). | 105 // the drop never takes place). |
104 // crbug.com/233571 | 106 // crbug.com/233571 |
105 base::WeakPtr<BrowserPluginGuest> guest_dragging_over_; | 107 base::WeakPtr<BrowserPluginGuest> guest_dragging_over_; |
106 | 108 |
107 // Pointer to the guest that started the drag, used to forward necessary drag | 109 // Pointer to the guest that started the drag, used to forward necessary drag |
108 // status messages to the correct guest. | 110 // status messages to the correct guest. |
109 base::WeakPtr<BrowserPluginGuest> guest_started_drag_; | 111 base::WeakPtr<BrowserPluginGuest> guest_started_drag_; |
110 | 112 |
| 113 // Keeps track of "dragend" state. |
| 114 bool seen_system_drag_ended_; |
| 115 bool seen_drag_source_ended_at_; |
| 116 |
111 base::WeakPtrFactory<BrowserPluginEmbedder> weak_ptr_factory_; | 117 base::WeakPtrFactory<BrowserPluginEmbedder> weak_ptr_factory_; |
112 | 118 |
113 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder); | 119 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder); |
114 }; | 120 }; |
115 | 121 |
116 } // namespace content | 122 } // namespace content |
117 | 123 |
118 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ | 124 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ |
OLD | NEW |