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

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: Addressed comments. 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 2863 matching lines...) Expand 10 before | Expand all | Expand 10 after
2956 } 2957 }
2957 2958
2958 void WebContentsImpl::Close() { 2959 void WebContentsImpl::Close() {
2959 Close(GetRenderViewHost()); 2960 Close(GetRenderViewHost());
2960 } 2961 }
2961 2962
2962 void WebContentsImpl::DragSourceEndedAt(int client_x, 2963 void WebContentsImpl::DragSourceEndedAt(int client_x,
2963 int client_y, 2964 int client_y,
2964 int screen_x, 2965 int screen_x,
2965 int screen_y, 2966 int screen_y,
2966 blink::WebDragOperation operation) { 2967 blink::WebDragOperation operation,
2968 RenderWidgetHost* source_rwh) {
2967 if (browser_plugin_embedder_.get()) 2969 if (browser_plugin_embedder_.get())
2968 browser_plugin_embedder_->DragSourceEndedAt( 2970 browser_plugin_embedder_->DragSourceEndedAt(
2969 client_x, client_y, screen_x, screen_y, operation); 2971 client_x, client_y, screen_x, screen_y, operation);
2972 if (GetRenderViewHost()) {
dcheng 2016/11/17 19:59:01 Should this check source_rwh instead? (My recolle
paulmeyer 2016/11/17 20:46:43 I thought about that. It was always GetRenderViewH
2973 source_rwh->DragSourceEndedAt(gfx::Point(client_x, client_y),
2974 gfx::Point(screen_x, screen_y),
2975 operation);
2976 }
2970 } 2977 }
2971 2978
2972 void WebContentsImpl::LoadStateChanged( 2979 void WebContentsImpl::LoadStateChanged(
2973 const GURL& url, 2980 const GURL& url,
2974 const net::LoadStateWithParam& load_state, 2981 const net::LoadStateWithParam& load_state,
2975 uint64_t upload_position, 2982 uint64_t upload_position,
2976 uint64_t upload_size) { 2983 uint64_t upload_size) {
2977 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466285 2984 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466285
2978 // is fixed. 2985 // is fixed.
2979 tracked_objects::ScopedTracker tracking_profile1( 2986 tracked_objects::ScopedTracker tracking_profile1(
(...skipping 30 matching lines...) Expand all
3010 NOTIFICATION_RESOURCE_RECEIVED_REDIRECT, 3017 NOTIFICATION_RESOURCE_RECEIVED_REDIRECT,
3011 Source<WebContents>(this), 3018 Source<WebContents>(this),
3012 Details<const ResourceRedirectDetails>(&details)); 3019 Details<const ResourceRedirectDetails>(&details));
3013 } 3020 }
3014 3021
3015 void WebContentsImpl::NotifyWebContentsFocused() { 3022 void WebContentsImpl::NotifyWebContentsFocused() {
3016 for (auto& observer : observers_) 3023 for (auto& observer : observers_)
3017 observer.OnWebContentsFocused(); 3024 observer.OnWebContentsFocused();
3018 } 3025 }
3019 3026
3020 void WebContentsImpl::SystemDragEnded() { 3027 void WebContentsImpl::SystemDragEnded(RenderWidgetHost* source_rwh) {
3021 // TODO(paulmeyer): This will need to target the correct specific RWH to work
3022 // with OOPIF.
3023 if (GetRenderViewHost()) 3028 if (GetRenderViewHost())
dcheng 2016/11/17 19:59:01 Ditto.
paulmeyer 2016/11/17 20:46:43 Ditto done.
3024 GetRenderViewHost()->GetWidget()->DragSourceSystemDragEnded(); 3029 source_rwh->DragSourceSystemDragEnded();
3025 if (browser_plugin_embedder_.get()) 3030 if (browser_plugin_embedder_.get())
3026 browser_plugin_embedder_->SystemDragEnded(); 3031 browser_plugin_embedder_->SystemDragEnded();
3027 } 3032 }
3028 3033
3029 void WebContentsImpl::UserGestureDone() { 3034 void WebContentsImpl::UserGestureDone() {
3030 OnUserInteraction(GetRenderViewHost()->GetWidget(), 3035 OnUserInteraction(GetRenderViewHost()->GetWidget(),
3031 blink::WebInputEvent::Undefined); 3036 blink::WebInputEvent::Undefined);
3032 } 3037 }
3033 3038
3034 void WebContentsImpl::SetClosedByUserGesture(bool value) { 3039 void WebContentsImpl::SetClosedByUserGesture(bool value) {
(...skipping 2187 matching lines...) Expand 10 before | Expand all | Expand 10 after
5222 dialog_manager_ = dialog_manager; 5227 dialog_manager_ = dialog_manager;
5223 } 5228 }
5224 5229
5225 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) { 5230 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) {
5226 auto it = binding_sets_.find(interface_name); 5231 auto it = binding_sets_.find(interface_name);
5227 if (it != binding_sets_.end()) 5232 if (it != binding_sets_.end())
5228 binding_sets_.erase(it); 5233 binding_sets_.erase(it);
5229 } 5234 }
5230 5235
5231 } // namespace content 5236 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698