| OLD | NEW |
| 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 "cc/layers/layer.h" | 10 #include "cc/layers/layer.h" |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 void WebContentsViewAndroid::OnDragUpdated(const gfx::Point& location, | 358 void WebContentsViewAndroid::OnDragUpdated(const gfx::Point& location, |
| 359 const gfx::Point& screen_location) { | 359 const gfx::Point& screen_location) { |
| 360 blink::WebDragOperationsMask allowed_ops = | 360 blink::WebDragOperationsMask allowed_ops = |
| 361 static_cast<blink::WebDragOperationsMask>(blink::WebDragOperationCopy | | 361 static_cast<blink::WebDragOperationsMask>(blink::WebDragOperationCopy | |
| 362 blink::WebDragOperationMove); | 362 blink::WebDragOperationMove); |
| 363 web_contents_->GetRenderViewHost()->GetWidget()->DragTargetDragOver( | 363 web_contents_->GetRenderViewHost()->GetWidget()->DragTargetDragOver( |
| 364 location, screen_location, allowed_ops, 0); | 364 location, screen_location, allowed_ops, 0); |
| 365 } | 365 } |
| 366 | 366 |
| 367 void WebContentsViewAndroid::OnDragExited() { | 367 void WebContentsViewAndroid::OnDragExited() { |
| 368 web_contents_->GetRenderViewHost()->GetWidget()->DragTargetDragLeave(); | 368 web_contents_->GetRenderViewHost()->GetWidget()->DragTargetDragLeave( |
| 369 gfx::Point(), gfx::Point()); |
| 369 } | 370 } |
| 370 | 371 |
| 371 void WebContentsViewAndroid::OnPerformDrop(DropData* drop_data, | 372 void WebContentsViewAndroid::OnPerformDrop(DropData* drop_data, |
| 372 const gfx::Point& location, | 373 const gfx::Point& location, |
| 373 const gfx::Point& screen_location) { | 374 const gfx::Point& screen_location) { |
| 374 web_contents_->GetRenderViewHost()->GetWidget()->FilterDropData(drop_data); | 375 web_contents_->GetRenderViewHost()->GetWidget()->FilterDropData(drop_data); |
| 375 web_contents_->GetRenderViewHost()->GetWidget()->DragTargetDrop( | 376 web_contents_->GetRenderViewHost()->GetWidget()->DragTargetDrop( |
| 376 *drop_data, location, screen_location, 0); | 377 *drop_data, location, screen_location, 0); |
| 377 } | 378 } |
| 378 | 379 |
| 379 void WebContentsViewAndroid::OnDragEnded() { | 380 void WebContentsViewAndroid::OnDragEnded() { |
| 380 web_contents_->GetRenderViewHost()->GetWidget()->DragSourceSystemDragEnded(); | 381 web_contents_->GetRenderViewHost()->GetWidget()->DragSourceSystemDragEnded(); |
| 381 } | 382 } |
| 382 | 383 |
| 383 void WebContentsViewAndroid::GotFocus() { | 384 void WebContentsViewAndroid::GotFocus() { |
| 384 // This is only used in the views FocusManager stuff but it bleeds through | 385 // This is only used in the views FocusManager stuff but it bleeds through |
| 385 // all subclasses. http://crbug.com/21875 | 386 // all subclasses. http://crbug.com/21875 |
| 386 } | 387 } |
| 387 | 388 |
| 388 // This is called when we the renderer asks us to take focus back (i.e., it has | 389 // This is called when we the renderer asks us to take focus back (i.e., it has |
| 389 // iterated past the last focusable element on the page). | 390 // iterated past the last focusable element on the page). |
| 390 void WebContentsViewAndroid::TakeFocus(bool reverse) { | 391 void WebContentsViewAndroid::TakeFocus(bool reverse) { |
| 391 if (web_contents_->GetDelegate() && | 392 if (web_contents_->GetDelegate() && |
| 392 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse)) | 393 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse)) |
| 393 return; | 394 return; |
| 394 web_contents_->GetRenderWidgetHostView()->Focus(); | 395 web_contents_->GetRenderWidgetHostView()->Focus(); |
| 395 } | 396 } |
| 396 | 397 |
| 397 } // namespace content | 398 } // namespace content |
| OLD | NEW |