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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 2509933002: Drag-and-drop: Target drag messages (the sequel). (Closed)
Patch Set: Rebased. Created 4 years, 1 month 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/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 #include <utility> 10 #include <utility>
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 #include "content/browser/renderer_host/text_input_manager.h" 73 #include "content/browser/renderer_host/text_input_manager.h"
74 #include "content/browser/screen_orientation/screen_orientation_dispatcher_host_ impl.h" 74 #include "content/browser/screen_orientation/screen_orientation_dispatcher_host_ impl.h"
75 #include "content/browser/site_instance_impl.h" 75 #include "content/browser/site_instance_impl.h"
76 #include "content/browser/web_contents/web_contents_view_child_frame.h" 76 #include "content/browser/web_contents/web_contents_view_child_frame.h"
77 #include "content/browser/web_contents/web_contents_view_guest.h" 77 #include "content/browser/web_contents/web_contents_view_guest.h"
78 #include "content/browser/webui/generic_handler.h" 78 #include "content/browser/webui/generic_handler.h"
79 #include "content/browser/webui/web_ui_controller_factory_registry.h" 79 #include "content/browser/webui/web_ui_controller_factory_registry.h"
80 #include "content/browser/webui/web_ui_impl.h" 80 #include "content/browser/webui/web_ui_impl.h"
81 #include "content/common/browser_plugin/browser_plugin_constants.h" 81 #include "content/common/browser_plugin/browser_plugin_constants.h"
82 #include "content/common/browser_plugin/browser_plugin_messages.h" 82 #include "content/common/browser_plugin/browser_plugin_messages.h"
83 #include "content/common/drag_messages.h"
83 #include "content/common/frame_messages.h" 84 #include "content/common/frame_messages.h"
84 #include "content/common/input_messages.h" 85 #include "content/common/input_messages.h"
85 #include "content/common/page_messages.h" 86 #include "content/common/page_messages.h"
86 #include "content/common/page_state_serialization.h" 87 #include "content/common/page_state_serialization.h"
87 #include "content/common/render_message_filter.mojom.h" 88 #include "content/common/render_message_filter.mojom.h"
88 #include "content/common/site_isolation_policy.h" 89 #include "content/common/site_isolation_policy.h"
89 #include "content/common/view_messages.h" 90 #include "content/common/view_messages.h"
90 #include "content/public/browser/ax_event_notification_details.h" 91 #include "content/public/browser/ax_event_notification_details.h"
91 #include "content/public/browser/browser_context.h" 92 #include "content/public/browser/browser_context.h"
92 #include "content/public/browser/browser_plugin_guest_manager.h" 93 #include "content/public/browser/browser_plugin_guest_manager.h"
(...skipping 2918 matching lines...) Expand 10 before | Expand all | Expand 10 after
3011 Source<WebContents>(this), 3012 Source<WebContents>(this),
3012 Details<const ResourceRedirectDetails>(&details)); 3013 Details<const ResourceRedirectDetails>(&details));
3013 } 3014 }
3014 3015
3015 void WebContentsImpl::NotifyWebContentsFocused() { 3016 void WebContentsImpl::NotifyWebContentsFocused() {
3016 for (auto& observer : observers_) 3017 for (auto& observer : observers_)
3017 observer.OnWebContentsFocused(); 3018 observer.OnWebContentsFocused();
3018 } 3019 }
3019 3020
3020 void WebContentsImpl::SystemDragEnded() { 3021 void WebContentsImpl::SystemDragEnded() {
3021 // TODO(paulmeyer): This will need to target the correct specific RWH to work 3022 // TODO(lukasza/paulmeyer): Rather then sending the IPC to all widgets in the
3022 // with OOPIF. 3023 // frame tree, it might be possible to send the IPC only to the widget where
3023 if (GetRenderViewHost()) 3024 // drag-start has fired.
3024 GetRenderViewHost()->GetWidget()->DragSourceSystemDragEnded(); 3025 for (RenderWidgetHostView* rwhv : GetRenderWidgetHostViewsInTree()) {
3026 RenderWidgetHostViewBase* rwhvb =
3027 static_cast<RenderWidgetHostViewBase*>(rwhv);
3028 RenderWidgetHost* rwh = rwhvb->GetRenderWidgetHost();
3029 rwh->Send(new DragMsg_SourceSystemDragEnded(rwh->GetRoutingID()));
dcheng 2016/11/17 17:44:19 We should definitely only be sending this to the d
3030 }
3031
3025 if (browser_plugin_embedder_.get()) 3032 if (browser_plugin_embedder_.get())
3026 browser_plugin_embedder_->SystemDragEnded(); 3033 browser_plugin_embedder_->SystemDragEnded();
3027 } 3034 }
3028 3035
3029 void WebContentsImpl::UserGestureDone() { 3036 void WebContentsImpl::UserGestureDone() {
3030 OnUserInteraction(GetRenderViewHost()->GetWidget(), 3037 OnUserInteraction(GetRenderViewHost()->GetWidget(),
3031 blink::WebInputEvent::Undefined); 3038 blink::WebInputEvent::Undefined);
3032 } 3039 }
3033 3040
3034 void WebContentsImpl::SetClosedByUserGesture(bool value) { 3041 void WebContentsImpl::SetClosedByUserGesture(bool value) {
(...skipping 2187 matching lines...) Expand 10 before | Expand all | Expand 10 after
5222 dialog_manager_ = dialog_manager; 5229 dialog_manager_ = dialog_manager;
5223 } 5230 }
5224 5231
5225 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) { 5232 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) {
5226 auto it = binding_sets_.find(interface_name); 5233 auto it = binding_sets_.find(interface_name);
5227 if (it != binding_sets_.end()) 5234 if (it != binding_sets_.end())
5228 binding_sets_.erase(it); 5235 binding_sets_.erase(it);
5229 } 5236 }
5230 5237
5231 } // namespace content 5238 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698