| 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 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 needs_begin_frame_ = enabled; | 547 needs_begin_frame_ = enabled; |
| 548 } | 548 } |
| 549 | 549 |
| 550 void RenderWidgetHostViewAndroid::OnStartContentIntent( | 550 void RenderWidgetHostViewAndroid::OnStartContentIntent( |
| 551 const GURL& content_url) { | 551 const GURL& content_url) { |
| 552 if (content_view_core_) | 552 if (content_view_core_) |
| 553 content_view_core_->StartContentIntent(content_url); | 553 content_view_core_->StartContentIntent(content_url); |
| 554 } | 554 } |
| 555 | 555 |
| 556 void RenderWidgetHostViewAndroid::OnSmartClipDataExtracted( | 556 void RenderWidgetHostViewAndroid::OnSmartClipDataExtracted( |
| 557 const base::string16& result) { | 557 const base::string16 result, |
| 558 // Custom serialization over IPC isn't allowed normally for security reasons. | 558 const gfx::Rect rect) { |
| 559 // Since this feature is only used in (single-process) WebView, there are no | |
| 560 // security issues. Enforce that it's only called in single process mode. | |
| 561 CHECK(RenderProcessHost::run_renderer_in_process()); | |
| 562 if (content_view_core_) | 559 if (content_view_core_) |
| 563 content_view_core_->OnSmartClipDataExtracted(result); | 560 content_view_core_->OnSmartClipDataExtracted(rect, result); |
| 564 } | 561 } |
| 565 | 562 |
| 566 bool RenderWidgetHostViewAndroid::OnTouchEvent( | 563 bool RenderWidgetHostViewAndroid::OnTouchEvent( |
| 567 const ui::MotionEvent& event) { | 564 const ui::MotionEvent& event) { |
| 568 if (!host_) | 565 if (!host_) |
| 569 return false; | 566 return false; |
| 570 | 567 |
| 571 if (!gesture_provider_.OnTouchEvent(event)) | 568 if (!gesture_provider_.OnTouchEvent(event)) |
| 572 return false; | 569 return false; |
| 573 | 570 |
| (...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1456 results->availableRect = display.work_area(); | 1453 results->availableRect = display.work_area(); |
| 1457 results->deviceScaleFactor = display.device_scale_factor(); | 1454 results->deviceScaleFactor = display.device_scale_factor(); |
| 1458 results->orientationAngle = display.RotationAsDegree(); | 1455 results->orientationAngle = display.RotationAsDegree(); |
| 1459 gfx::DeviceDisplayInfo info; | 1456 gfx::DeviceDisplayInfo info; |
| 1460 results->depth = info.GetBitsPerPixel(); | 1457 results->depth = info.GetBitsPerPixel(); |
| 1461 results->depthPerComponent = info.GetBitsPerComponent(); | 1458 results->depthPerComponent = info.GetBitsPerComponent(); |
| 1462 results->isMonochrome = (results->depthPerComponent == 0); | 1459 results->isMonochrome = (results->depthPerComponent == 0); |
| 1463 } | 1460 } |
| 1464 | 1461 |
| 1465 } // namespace content | 1462 } // namespace content |
| OLD | NEW |