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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 342633003: [Android] Select text when stylus first button is pressed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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
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/renderer_host/render_widget_host_view_android.h" 5 #include "content/browser/renderer_host/render_widget_host_view_android.h"
6 6
7 #include <android/bitmap.h> 7 #include <android/bitmap.h>
8 8
9 #include "base/android/sys_utils.h" 9 #include "base/android/sys_utils.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 void RenderWidgetHostViewAndroid::OnSmartClipDataExtracted( 535 void RenderWidgetHostViewAndroid::OnSmartClipDataExtracted(
536 const base::string16& result) { 536 const base::string16& result) {
537 // Custom serialization over IPC isn't allowed normally for security reasons. 537 // Custom serialization over IPC isn't allowed normally for security reasons.
538 // Since this feature is only used in (single-process) WebView, there are no 538 // Since this feature is only used in (single-process) WebView, there are no
539 // security issues. Enforce that it's only called in single process mode. 539 // security issues. Enforce that it's only called in single process mode.
540 CHECK(RenderProcessHost::run_renderer_in_process()); 540 CHECK(RenderProcessHost::run_renderer_in_process());
541 if (content_view_core_) 541 if (content_view_core_)
542 content_view_core_->OnSmartClipDataExtracted(result); 542 content_view_core_->OnSmartClipDataExtracted(result);
543 } 543 }
544 544
545 bool RenderWidgetHostViewAndroid::ShouldConvertToMouseEvent(
546 const ui::MotionEvent& event) {
547 // TODO(changwan)
548 return true;
549 }
550
545 bool RenderWidgetHostViewAndroid::OnTouchEvent( 551 bool RenderWidgetHostViewAndroid::OnTouchEvent(
546 const ui::MotionEvent& event) { 552 const ui::MotionEvent& event) {
547 if (!host_) 553 if (!host_)
548 return false; 554 return false;
549 555
550 if (!gesture_provider_.OnTouchEvent(event)) 556 if (!gesture_provider_.OnTouchEvent(event))
551 return false; 557 return false;
552 558
559 if (ShouldConvertToMouseEvent(event)) {
jdduke (slow) 2014/06/19 15:10:11 Ah, yeah, so we would definitely need to move this
jdduke (slow) 2014/06/20 02:14:27 We'll probably want logic along the lines of: if
jdduke (slow) 2014/06/20 02:23:39 Actually this should probably be: if (event.GetAc
Changwan Ryu 2014/06/20 08:19:53 Done.
Changwan Ryu 2014/06/20 08:19:53 Done.
Changwan Ryu 2014/06/20 08:19:53 Moved it up and added a TODO.
560 SendMouseEvent(CreateWebMouseEventFromMotionEvent(event));
561 return true;
562 }
563
553 // Short-circuit touch forwarding if no touch handlers exist. 564 // Short-circuit touch forwarding if no touch handlers exist.
554 if (!host_->ShouldForwardTouchEvent()) { 565 if (!host_->ShouldForwardTouchEvent()) {
555 const bool event_consumed = false; 566 const bool event_consumed = false;
556 gesture_provider_.OnTouchEventAck(event_consumed); 567 gesture_provider_.OnTouchEventAck(event_consumed);
557 return true; 568 return true;
558 } 569 }
559 570
560 SendTouchEvent(CreateWebTouchEventFromMotionEvent(event)); 571 SendTouchEvent(CreateWebTouchEventFromMotionEvent(event));
561 return true; 572 return true;
562 } 573 }
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after
1272 1283
1273 void RenderWidgetHostViewAndroid::RunAckCallbacks() { 1284 void RenderWidgetHostViewAndroid::RunAckCallbacks() {
1274 while (!ack_callbacks_.empty()) { 1285 while (!ack_callbacks_.empty()) {
1275 ack_callbacks_.front().Run(); 1286 ack_callbacks_.front().Run();
1276 ack_callbacks_.pop(); 1287 ack_callbacks_.pop();
1277 } 1288 }
1278 } 1289 }
1279 1290
1280 void RenderWidgetHostViewAndroid::OnGestureEvent( 1291 void RenderWidgetHostViewAndroid::OnGestureEvent(
1281 const ui::GestureEventData& gesture) { 1292 const ui::GestureEventData& gesture) {
1282 SendGestureEvent(CreateWebGestureEventFromGestureEventData(gesture)); 1293 SendGestureEvent(CreateWebGestureEventFromGestureEventData(gesture));
jdduke (slow) 2014/06/20 02:14:27 Then you can add a check here to drop all gestures
Changwan Ryu 2014/06/20 08:19:53 I don't have access to gesture variable. Let me ha
1283 } 1294 }
1284 1295
1285 void RenderWidgetHostViewAndroid::OnCompositingDidCommit() { 1296 void RenderWidgetHostViewAndroid::OnCompositingDidCommit() {
1286 RunAckCallbacks(); 1297 RunAckCallbacks();
1287 } 1298 }
1288 1299
1289 void RenderWidgetHostViewAndroid::OnDetachCompositor() { 1300 void RenderWidgetHostViewAndroid::OnDetachCompositor() {
1290 DCHECK(content_view_core_); 1301 DCHECK(content_view_core_);
1291 DCHECK(!using_synchronous_compositor_); 1302 DCHECK(!using_synchronous_compositor_);
1292 RunAckCallbacks(); 1303 RunAckCallbacks();
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
1436 results->availableRect = display.work_area(); 1447 results->availableRect = display.work_area();
1437 results->deviceScaleFactor = display.device_scale_factor(); 1448 results->deviceScaleFactor = display.device_scale_factor();
1438 results->orientationAngle = display.RotationAsDegree(); 1449 results->orientationAngle = display.RotationAsDegree();
1439 gfx::DeviceDisplayInfo info; 1450 gfx::DeviceDisplayInfo info;
1440 results->depth = info.GetBitsPerPixel(); 1451 results->depth = info.GetBitsPerPixel();
1441 results->depthPerComponent = info.GetBitsPerComponent(); 1452 results->depthPerComponent = info.GetBitsPerComponent();
1442 results->isMonochrome = (results->depthPerComponent == 0); 1453 results->isMonochrome = (results->depthPerComponent == 0);
1443 } 1454 }
1444 1455
1445 } // namespace content 1456 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698