Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Side by Side Diff: content/browser/browser_plugin/browser_plugin_embedder.cc

Issue 945333002: Implement <webview> droplink event (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cleanup_bpe
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "content/browser/browser_plugin/browser_plugin_embedder.h" 5 #include "content/browser/browser_plugin/browser_plugin_embedder.h"
6 6
7 #include "content/browser/browser_plugin/browser_plugin_guest.h" 7 #include "content/browser/browser_plugin/browser_plugin_guest.h"
8 #include "content/browser/renderer_host/render_view_host_impl.h" 8 #include "content/browser/renderer_host/render_view_host_impl.h"
9 #include "content/browser/web_contents/web_contents_impl.h" 9 #include "content/browser/web_contents/web_contents_impl.h"
10 #include "content/common/browser_plugin/browser_plugin_messages.h" 10 #include "content/common/browser_plugin/browser_plugin_messages.h"
(...skipping 15 matching lines...) Expand all
26 26
27 BrowserPluginEmbedder::~BrowserPluginEmbedder() { 27 BrowserPluginEmbedder::~BrowserPluginEmbedder() {
28 } 28 }
29 29
30 // static 30 // static
31 BrowserPluginEmbedder* BrowserPluginEmbedder::Create( 31 BrowserPluginEmbedder* BrowserPluginEmbedder::Create(
32 WebContentsImpl* web_contents) { 32 WebContentsImpl* web_contents) {
33 return new BrowserPluginEmbedder(web_contents); 33 return new BrowserPluginEmbedder(web_contents);
34 } 34 }
35 35
36 void BrowserPluginEmbedder::DragEnteredGuest(BrowserPluginGuest* guest) { 36 bool BrowserPluginEmbedder::DragEnteredGuest(BrowserPluginGuest* guest) {
37 guest_dragging_over_ = guest->AsWeakPtr(); 37 guest_dragging_over_ = guest->AsWeakPtr();
38 return guest_started_drag_.get() == guest;
38 } 39 }
39 40
40 void BrowserPluginEmbedder::DragLeftGuest(BrowserPluginGuest* guest) { 41 void BrowserPluginEmbedder::DragLeftGuest(BrowserPluginGuest* guest) {
41 // Avoid race conditions in switching between guests being hovered over by 42 // Avoid race conditions in switching between guests being hovered over by
42 // only un-setting if the caller is marked as the guest being dragged over. 43 // only un-setting if the caller is marked as the guest being dragged over.
43 if (guest_dragging_over_.get() == guest) { 44 if (guest_dragging_over_.get() == guest) {
44 guest_dragging_over_.reset(); 45 guest_dragging_over_.reset();
45 } 46 }
46 } 47 }
47 48
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 // to the guest that initiated the drag/drop operation. This will ensure that 119 // to the guest that initiated the drag/drop operation. This will ensure that
119 // the guest's RVH state is reset properly. 120 // the guest's RVH state is reset properly.
120 if (guest_started_drag_) 121 if (guest_started_drag_)
121 guest_started_drag_->EmbedderSystemDragEnded(); 122 guest_started_drag_->EmbedderSystemDragEnded();
122 123
123 guest_dragging_over_.reset(); 124 guest_dragging_over_.reset();
124 ClearGuestDragStateIfApplicable(); 125 ClearGuestDragStateIfApplicable();
125 } 126 }
126 127
127 void BrowserPluginEmbedder::OnUpdateDragCursor(bool* handled) { 128 void BrowserPluginEmbedder::OnUpdateDragCursor(bool* handled) {
128 *handled = (guest_dragging_over_.get() != NULL); 129 *handled = !!guest_dragging_over_;
129 } 130 }
130 131
131 void BrowserPluginEmbedder::OnAttach( 132 void BrowserPluginEmbedder::OnAttach(
132 RenderFrameHost* render_frame_host, 133 RenderFrameHost* render_frame_host,
133 int browser_plugin_instance_id, 134 int browser_plugin_instance_id,
134 const BrowserPluginHostMsg_Attach_Params& params) { 135 const BrowserPluginHostMsg_Attach_Params& params) {
135 // TODO(fsamuel): Change message routing to use the process ID of the 136 // TODO(fsamuel): Change message routing to use the process ID of the
136 // |render_frame_host| once BrowserPlugin IPCs get routed using the RFH 137 // |render_frame_host| once BrowserPlugin IPCs get routed using the RFH
137 // routing ID. See http://crbug.com/436339. 138 // routing ID. See http://crbug.com/436339.
138 WebContents* guest_web_contents = 139 WebContents* guest_web_contents =
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 if (static_cast<WebContentsImpl*>(guest)->GetBrowserPluginGuest() 213 if (static_cast<WebContentsImpl*>(guest)->GetBrowserPluginGuest()
213 ->StopFinding(action)) { 214 ->StopFinding(action)) {
214 // There can only ever currently be one browser plugin that handles find so 215 // There can only ever currently be one browser plugin that handles find so
215 // we can break the iteration at this point. 216 // we can break the iteration at this point.
216 return true; 217 return true;
217 } 218 }
218 return false; 219 return false;
219 } 220 }
220 221
221 } // namespace content 222 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698