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

Side by Side Diff: chrome/browser/tab_contents/web_drop_target.cc

Issue 67297: Provide an override for Webview drop effect.... Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | webkit/glue/webview.h » ('j') | webkit/glue/webview_impl.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 <windows.h> 5 #include <windows.h>
6 #include <shlobj.h> 6 #include <shlobj.h>
7 7
8 #include "chrome/browser/tab_contents/web_drop_target.h" 8 #include "chrome/browser/tab_contents/web_drop_target.h"
9 9
10 #include "base/clipboard_util.h" 10 #include "base/clipboard_util.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 129
130 if (web_contents_->showing_interstitial_page()) 130 if (web_contents_->showing_interstitial_page())
131 return interstitial_drop_target_->OnDragOver(data_object, effect); 131 return interstitial_drop_target_->OnDragOver(data_object, effect);
132 132
133 POINT client_pt = cursor_position; 133 POINT client_pt = cursor_position;
134 ScreenToClient(GetHWND(), &client_pt); 134 ScreenToClient(GetHWND(), &client_pt);
135 web_contents_->render_view_host()->DragTargetDragOver( 135 web_contents_->render_view_host()->DragTargetDragOver(
136 gfx::Point(client_pt.x, client_pt.y), 136 gfx::Point(client_pt.x, client_pt.y),
137 gfx::Point(cursor_position.x, cursor_position.y)); 137 gfx::Point(cursor_position.x, cursor_position.y));
138 138
139 // Again we don't wait on the renderer to respond, but this can lead to
140 // a race condition. If the renderer does not want the drop data, then
141 // we won't know until the response from the renderer arrives. So if a
142 // drop happens before the response arrives, we drop on a renderer that
143 // doesn't want the data. TODO(noel): fix this.
144
145 if (!is_drop_target_) 139 if (!is_drop_target_)
146 return DROPEFFECT_NONE; 140 return DROPEFFECT_NONE;
147 141
148 return GetPreferredDropEffect(effect); 142 return GetPreferredDropEffect(effect);
149 } 143 }
150 144
151 void WebDropTarget::OnDragLeave(IDataObject* data_object) { 145 void WebDropTarget::OnDragLeave(IDataObject* data_object) {
152 DCHECK(current_rvh_); 146 DCHECK(current_rvh_);
153 if (current_rvh_ != web_contents_->render_view_host()) 147 if (current_rvh_ != web_contents_->render_view_host())
154 return; 148 return;
(...skipping 24 matching lines...) Expand all
179 web_contents_->render_view_host()->DragTargetDrop( 173 web_contents_->render_view_host()->DragTargetDrop(
180 gfx::Point(client_pt.x, client_pt.y), 174 gfx::Point(client_pt.x, client_pt.y),
181 gfx::Point(cursor_position.x, cursor_position.y)); 175 gfx::Point(cursor_position.x, cursor_position.y));
182 176
183 current_rvh_ = NULL; 177 current_rvh_ = NULL;
184 178
185 // We lie and always claim that the drop operation didn't happen because we 179 // We lie and always claim that the drop operation didn't happen because we
186 // don't want to wait for the renderer to respond. 180 // don't want to wait for the renderer to respond.
187 return DROPEFFECT_NONE; 181 return DROPEFFECT_NONE;
188 } 182 }
OLDNEW
« no previous file with comments | « no previous file | webkit/glue/webview.h » ('j') | webkit/glue/webview_impl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698