| 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/build_info.h" | 9 #include "base/android/build_info.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1208 // web design, so text will be legible without zooming). Also disable | 1208 // web design, so text will be legible without zooming). Also disable |
| 1209 // double tap and pinch for pages that prevent zooming in or out. | 1209 // double tap and pinch for pages that prevent zooming in or out. |
| 1210 bool has_mobile_viewport = HasMobileViewport(frame_metadata); | 1210 bool has_mobile_viewport = HasMobileViewport(frame_metadata); |
| 1211 bool has_fixed_page_scale = HasFixedPageScale(frame_metadata); | 1211 bool has_fixed_page_scale = HasFixedPageScale(frame_metadata); |
| 1212 gesture_provider_.SetDoubleTapSupportForPageEnabled( | 1212 gesture_provider_.SetDoubleTapSupportForPageEnabled( |
| 1213 !has_fixed_page_scale && !has_mobile_viewport); | 1213 !has_fixed_page_scale && !has_mobile_viewport); |
| 1214 | 1214 |
| 1215 if (!content_view_core_) | 1215 if (!content_view_core_) |
| 1216 return; | 1216 return; |
| 1217 | 1217 |
| 1218 DCHECK(selection_controller_); | 1218 if (selection_controller_) { |
| 1219 selection_controller_->OnSelectionBoundsChanged( | 1219 selection_controller_->OnSelectionBoundsChanged( |
| 1220 frame_metadata.selection_start, frame_metadata.selection_end); | 1220 frame_metadata.selection_start, frame_metadata.selection_end); |
| 1221 } |
| 1221 | 1222 |
| 1222 // All offsets and sizes are in CSS pixels. | 1223 // All offsets and sizes are in CSS pixels. |
| 1223 content_view_core_->UpdateFrameInfo( | 1224 content_view_core_->UpdateFrameInfo( |
| 1224 frame_metadata.root_scroll_offset, | 1225 frame_metadata.root_scroll_offset, |
| 1225 frame_metadata.page_scale_factor, | 1226 frame_metadata.page_scale_factor, |
| 1226 gfx::Vector2dF(frame_metadata.min_page_scale_factor, | 1227 gfx::Vector2dF(frame_metadata.min_page_scale_factor, |
| 1227 frame_metadata.max_page_scale_factor), | 1228 frame_metadata.max_page_scale_factor), |
| 1228 frame_metadata.root_layer_size, | 1229 frame_metadata.root_layer_size, |
| 1229 frame_metadata.scrollable_viewport_size, | 1230 frame_metadata.scrollable_viewport_size, |
| 1230 frame_metadata.location_bar_offset, | 1231 frame_metadata.location_bar_offset, |
| (...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1781 results->orientationAngle = display.RotationAsDegree(); | 1782 results->orientationAngle = display.RotationAsDegree(); |
| 1782 results->orientationType = | 1783 results->orientationType = |
| 1783 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 1784 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
| 1784 gfx::DeviceDisplayInfo info; | 1785 gfx::DeviceDisplayInfo info; |
| 1785 results->depth = info.GetBitsPerPixel(); | 1786 results->depth = info.GetBitsPerPixel(); |
| 1786 results->depthPerComponent = info.GetBitsPerComponent(); | 1787 results->depthPerComponent = info.GetBitsPerComponent(); |
| 1787 results->isMonochrome = (results->depthPerComponent == 0); | 1788 results->isMonochrome = (results->depthPerComponent == 0); |
| 1788 } | 1789 } |
| 1789 | 1790 |
| 1790 } // namespace content | 1791 } // namespace content |
| OLD | NEW |