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

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

Issue 2501213002: Drag-and-drop: dragSourceEndedAt, dragSourceSystemDragEnded (Closed)
Patch Set: Rebased. Added check for !GetWebWidget(). 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 2941 matching lines...) Expand 10 before | Expand all | Expand 10 after
2952 } 2952 }
2953 2953
2954 RendererPreferences* WebContentsImpl::GetMutableRendererPrefs() { 2954 RendererPreferences* WebContentsImpl::GetMutableRendererPrefs() {
2955 return &renderer_preferences_; 2955 return &renderer_preferences_;
2956 } 2956 }
2957 2957
2958 void WebContentsImpl::Close() { 2958 void WebContentsImpl::Close() {
2959 Close(GetRenderViewHost()); 2959 Close(GetRenderViewHost());
2960 } 2960 }
2961 2961
2962 void WebContentsImpl::DragSourceEndedAt(int client_x, int client_y, 2962 void WebContentsImpl::DragSourceEndedAt(int client_x,
2963 int screen_x, int screen_y, blink::WebDragOperation operation) { 2963 int client_y,
2964 int screen_x,
2965 int screen_y,
2966 blink::WebDragOperation operation) {
2964 if (browser_plugin_embedder_.get()) 2967 if (browser_plugin_embedder_.get())
2965 browser_plugin_embedder_->DragSourceEndedAt(client_x, client_y, 2968 browser_plugin_embedder_->DragSourceEndedAt(
2966 screen_x, screen_y, operation); 2969 client_x, client_y, screen_x, screen_y, operation);
2970 // TODO(paulmeyer): This will need to target the correct specific RWH to work
2971 // with OOPIF.
2967 if (GetRenderViewHost()) 2972 if (GetRenderViewHost())
2968 GetRenderViewHost()->DragSourceEndedAt(client_x, client_y, screen_x, 2973 GetRenderViewHost()->GetWidget()->DragSourceEndedAt(
2969 screen_y, operation); 2974 client_x, client_y, screen_x, screen_y, operation);
2970 } 2975 }
2971 2976
2972 void WebContentsImpl::LoadStateChanged( 2977 void WebContentsImpl::LoadStateChanged(
2973 const GURL& url, 2978 const GURL& url,
2974 const net::LoadStateWithParam& load_state, 2979 const net::LoadStateWithParam& load_state,
2975 uint64_t upload_position, 2980 uint64_t upload_position,
2976 uint64_t upload_size) { 2981 uint64_t upload_size) {
2977 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466285 2982 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466285
2978 // is fixed. 2983 // is fixed.
2979 tracked_objects::ScopedTracker tracking_profile1( 2984 tracked_objects::ScopedTracker tracking_profile1(
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
3011 Source<WebContents>(this), 3016 Source<WebContents>(this),
3012 Details<const ResourceRedirectDetails>(&details)); 3017 Details<const ResourceRedirectDetails>(&details));
3013 } 3018 }
3014 3019
3015 void WebContentsImpl::NotifyWebContentsFocused() { 3020 void WebContentsImpl::NotifyWebContentsFocused() {
3016 for (auto& observer : observers_) 3021 for (auto& observer : observers_)
3017 observer.OnWebContentsFocused(); 3022 observer.OnWebContentsFocused();
3018 } 3023 }
3019 3024
3020 void WebContentsImpl::SystemDragEnded() { 3025 void WebContentsImpl::SystemDragEnded() {
3026 // TODO(paulmeyer): This will need to target the correct specific RWH to work
3027 // with OOPIF.
3021 if (GetRenderViewHost()) 3028 if (GetRenderViewHost())
3022 GetRenderViewHost()->DragSourceSystemDragEnded(); 3029 GetRenderViewHost()->GetWidget()->DragSourceSystemDragEnded();
3023 if (browser_plugin_embedder_.get()) 3030 if (browser_plugin_embedder_.get())
3024 browser_plugin_embedder_->SystemDragEnded(); 3031 browser_plugin_embedder_->SystemDragEnded();
3025 } 3032 }
3026 3033
3027 void WebContentsImpl::UserGestureDone() { 3034 void WebContentsImpl::UserGestureDone() {
3028 OnUserInteraction(GetRenderViewHost()->GetWidget(), 3035 OnUserInteraction(GetRenderViewHost()->GetWidget(),
3029 blink::WebInputEvent::Undefined); 3036 blink::WebInputEvent::Undefined);
3030 } 3037 }
3031 3038
3032 void WebContentsImpl::SetClosedByUserGesture(bool value) { 3039 void WebContentsImpl::SetClosedByUserGesture(bool value) {
(...skipping 2187 matching lines...) Expand 10 before | Expand all | Expand 10 after
5220 dialog_manager_ = dialog_manager; 5227 dialog_manager_ = dialog_manager;
5221 } 5228 }
5222 5229
5223 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) { 5230 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) {
5224 auto it = binding_sets_.find(interface_name); 5231 auto it = binding_sets_.find(interface_name);
5225 if (it != binding_sets_.end()) 5232 if (it != binding_sets_.end())
5226 binding_sets_.erase(it); 5233 binding_sets_.erase(it);
5227 } 5234 }
5228 5235
5229 } // namespace content 5236 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698