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

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

Issue 2308103002: Disable WebView/Chrome's drag and drop feature on M and below. (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « no previous file | content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_view_android.h" 5 #include "content/browser/web_contents/web_contents_view_android.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "content/browser/android/content_view_core_impl.h" 10 #include "content/browser/android/content_view_core_impl.h"
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 if (!native_view) { 244 if (!native_view) {
245 // Need to clear drag and drop state in blink. 245 // Need to clear drag and drop state in blink.
246 OnDragEnded(); 246 OnDragEnded();
247 return; 247 return;
248 } 248 }
249 249
250 JNIEnv* env = AttachCurrentThread(); 250 JNIEnv* env = AttachCurrentThread();
251 ScopedJavaLocalRef<jstring> jtext = 251 ScopedJavaLocalRef<jstring> jtext =
252 ConvertUTF16ToJavaString(env, drop_data.text.string()); 252 ConvertUTF16ToJavaString(env, drop_data.text.string());
253 253
254 native_view->StartDragAndDrop(jtext, 254 if (!native_view->StartDragAndDrop(
255 gfx::ConvertToJavaBitmap(image.bitmap())); 255 jtext, gfx::ConvertToJavaBitmap(image.bitmap()))) {
256 // Need to clear drag and drop state in blink.
257 OnDragEnded();
258 return;
259 }
256 260
257 if (content_view_core_) 261 if (content_view_core_)
258 content_view_core_->HidePopupsAndPreserveSelection(); 262 content_view_core_->HidePopupsAndPreserveSelection();
259 } 263 }
260 264
261 void WebContentsViewAndroid::UpdateDragCursor(blink::WebDragOperation op) { 265 void WebContentsViewAndroid::UpdateDragCursor(blink::WebDragOperation op) {
262 // Intentional no-op because Android does not have cursor. 266 // Intentional no-op because Android does not have cursor.
263 } 267 }
264 268
265 void WebContentsViewAndroid::OnDragEntered( 269 void WebContentsViewAndroid::OnDragEntered(
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 // This is called when we the renderer asks us to take focus back (i.e., it has 310 // This is called when we the renderer asks us to take focus back (i.e., it has
307 // iterated past the last focusable element on the page). 311 // iterated past the last focusable element on the page).
308 void WebContentsViewAndroid::TakeFocus(bool reverse) { 312 void WebContentsViewAndroid::TakeFocus(bool reverse) {
309 if (web_contents_->GetDelegate() && 313 if (web_contents_->GetDelegate() &&
310 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse)) 314 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse))
311 return; 315 return;
312 web_contents_->GetRenderWidgetHostView()->Focus(); 316 web_contents_->GetRenderWidgetHostView()->Focus();
313 } 317 }
314 318
315 } // namespace content 319 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698