| 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/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 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 needs_begin_frame_ = enabled; | 537 needs_begin_frame_ = enabled; |
| 538 } | 538 } |
| 539 | 539 |
| 540 void RenderWidgetHostViewAndroid::OnStartContentIntent( | 540 void RenderWidgetHostViewAndroid::OnStartContentIntent( |
| 541 const GURL& content_url) { | 541 const GURL& content_url) { |
| 542 if (content_view_core_) | 542 if (content_view_core_) |
| 543 content_view_core_->StartContentIntent(content_url); | 543 content_view_core_->StartContentIntent(content_url); |
| 544 } | 544 } |
| 545 | 545 |
| 546 void RenderWidgetHostViewAndroid::OnSmartClipDataExtracted( | 546 void RenderWidgetHostViewAndroid::OnSmartClipDataExtracted( |
| 547 const base::string16& result) { | 547 const base::string16& result, |
| 548 // Custom serialization over IPC isn't allowed normally for security reasons. | 548 const gfx::Rect rect) { |
| 549 // Since this feature is only used in (single-process) WebView, there are no | |
| 550 // security issues. Enforce that it's only called in single process mode. | |
| 551 CHECK(RenderProcessHost::run_renderer_in_process()); | |
| 552 if (content_view_core_) | 549 if (content_view_core_) |
| 553 content_view_core_->OnSmartClipDataExtracted(result); | 550 content_view_core_->OnSmartClipDataExtracted(rect, result); |
| 554 } | 551 } |
| 555 | 552 |
| 556 bool RenderWidgetHostViewAndroid::OnTouchEvent( | 553 bool RenderWidgetHostViewAndroid::OnTouchEvent( |
| 557 const ui::MotionEvent& event) { | 554 const ui::MotionEvent& event) { |
| 558 if (!host_) | 555 if (!host_) |
| 559 return false; | 556 return false; |
| 560 | 557 |
| 561 if (!gesture_provider_.OnTouchEvent(event)) | 558 if (!gesture_provider_.OnTouchEvent(event)) |
| 562 return false; | 559 return false; |
| 563 | 560 |
| (...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1447 results->availableRect = display.work_area(); | 1444 results->availableRect = display.work_area(); |
| 1448 results->deviceScaleFactor = display.device_scale_factor(); | 1445 results->deviceScaleFactor = display.device_scale_factor(); |
| 1449 results->orientationAngle = display.RotationAsDegree(); | 1446 results->orientationAngle = display.RotationAsDegree(); |
| 1450 gfx::DeviceDisplayInfo info; | 1447 gfx::DeviceDisplayInfo info; |
| 1451 results->depth = info.GetBitsPerPixel(); | 1448 results->depth = info.GetBitsPerPixel(); |
| 1452 results->depthPerComponent = info.GetBitsPerComponent(); | 1449 results->depthPerComponent = info.GetBitsPerComponent(); |
| 1453 results->isMonochrome = (results->depthPerComponent == 0); | 1450 results->isMonochrome = (results->depthPerComponent == 0); |
| 1454 } | 1451 } |
| 1455 | 1452 |
| 1456 } // namespace content | 1453 } // namespace content |
| OLD | NEW |