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 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 return gfx::Rect(content_view_core_->GetViewSize()); | 538 return gfx::Rect(content_view_core_->GetViewSize()); |
539 } | 539 } |
540 | 540 |
541 gfx::Size RenderWidgetHostViewAndroid::GetPhysicalBackingSize() const { | 541 gfx::Size RenderWidgetHostViewAndroid::GetPhysicalBackingSize() const { |
542 if (!content_view_core_) | 542 if (!content_view_core_) |
543 return gfx::Size(); | 543 return gfx::Size(); |
544 | 544 |
545 return content_view_core_->GetPhysicalBackingSize(); | 545 return content_view_core_->GetPhysicalBackingSize(); |
546 } | 546 } |
547 | 547 |
548 float RenderWidgetHostViewAndroid::GetTopControlsLayoutHeight() const { | 548 bool RenderWidgetHostViewAndroid::GetTopControlsShrinkBlinkSize() const { |
| 549 if (!content_view_core_) |
| 550 return false; |
| 551 |
| 552 // Whether or not Blink's viewport size should be shrunk by the height of the |
| 553 // URL-bar. |
| 554 return content_view_core_->GetTopControlsShrinkBlinkSize(); |
| 555 } |
| 556 |
| 557 float RenderWidgetHostViewAndroid::GetTopControlsHeight() const { |
549 if (!content_view_core_) | 558 if (!content_view_core_) |
550 return 0.f; | 559 return 0.f; |
551 | 560 |
552 // The amount that the viewport size given to Blink is shrunk by the URL-bar. | 561 // The height of the top controls. |
553 return content_view_core_->GetTopControlsLayoutHeightDip(); | 562 return content_view_core_->GetTopControlsHeightDip(); |
554 } | 563 } |
555 | 564 |
556 void RenderWidgetHostViewAndroid::UpdateCursor(const WebCursor& cursor) { | 565 void RenderWidgetHostViewAndroid::UpdateCursor(const WebCursor& cursor) { |
557 // There are no cursors on Android. | 566 // There are no cursors on Android. |
558 } | 567 } |
559 | 568 |
560 void RenderWidgetHostViewAndroid::SetIsLoading(bool is_loading) { | 569 void RenderWidgetHostViewAndroid::SetIsLoading(bool is_loading) { |
561 // Do nothing. The UI notification is handled through ContentViewClient which | 570 // Do nothing. The UI notification is handled through ContentViewClient which |
562 // is TabContentsDelegate. | 571 // is TabContentsDelegate. |
563 } | 572 } |
(...skipping 1184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1748 results->orientationAngle = display.RotationAsDegree(); | 1757 results->orientationAngle = display.RotationAsDegree(); |
1749 results->orientationType = | 1758 results->orientationType = |
1750 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 1759 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
1751 gfx::DeviceDisplayInfo info; | 1760 gfx::DeviceDisplayInfo info; |
1752 results->depth = info.GetBitsPerPixel(); | 1761 results->depth = info.GetBitsPerPixel(); |
1753 results->depthPerComponent = info.GetBitsPerComponent(); | 1762 results->depthPerComponent = info.GetBitsPerComponent(); |
1754 results->isMonochrome = (results->depthPerComponent == 0); | 1763 results->isMonochrome = (results->depthPerComponent == 0); |
1755 } | 1764 } |
1756 | 1765 |
1757 } // namespace content | 1766 } // namespace content |
OLD | NEW |