| 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/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 | 590 |
| 591 void RenderWidgetHostViewAndroid::SetCachedPageScaleFactorLimits( | 591 void RenderWidgetHostViewAndroid::SetCachedPageScaleFactorLimits( |
| 592 float minimum_scale, | 592 float minimum_scale, |
| 593 float maximum_scale) { | 593 float maximum_scale) { |
| 594 if (content_view_core_) | 594 if (content_view_core_) |
| 595 content_view_core_->UpdatePageScaleLimits(minimum_scale, maximum_scale); | 595 content_view_core_->UpdatePageScaleLimits(minimum_scale, maximum_scale); |
| 596 } | 596 } |
| 597 | 597 |
| 598 void RenderWidgetHostViewAndroid::UpdateFrameInfo( | 598 void RenderWidgetHostViewAndroid::UpdateFrameInfo( |
| 599 const gfx::Vector2d& scroll_offset, | 599 const gfx::Vector2d& scroll_offset, |
| 600 const gfx::Vector2d& unused_scroll_delta, |
| 600 float page_scale_factor, | 601 float page_scale_factor, |
| 601 float min_page_scale_factor, | 602 float min_page_scale_factor, |
| 602 float max_page_scale_factor, | 603 float max_page_scale_factor, |
| 603 const gfx::Size& content_size, | 604 const gfx::Size& content_size, |
| 604 const gfx::Vector2dF& controls_offset, | 605 const gfx::Vector2dF& controls_offset, |
| 605 const gfx::Vector2dF& content_offset) { | 606 const gfx::Vector2dF& content_offset) { |
| 606 if (content_view_core_) { | 607 if (content_view_core_) { |
| 607 content_view_core_->UpdateContentSize(content_size.width(), | 608 content_view_core_->UpdateContentSize(content_size.width(), |
| 608 content_size.height()); | 609 content_size.height()); |
| 609 content_view_core_->UpdatePageScaleLimits(min_page_scale_factor, | 610 content_view_core_->UpdatePageScaleLimits(min_page_scale_factor, |
| 610 max_page_scale_factor); | 611 max_page_scale_factor); |
| 611 content_view_core_->UpdateScrollOffsetAndPageScaleFactor(scroll_offset.x(), | 612 content_view_core_->UpdateScrollOffsetAndPageScaleFactor(scroll_offset.x(), |
| 612 scroll_offset.y(), | 613 scroll_offset.y(), |
| 613 page_scale_factor); | 614 page_scale_factor); |
| 614 content_view_core_->UpdateOffsetsForFullscreen(controls_offset.y(), | 615 content_view_core_->UpdateOffsetsForFullscreen(controls_offset.y(), |
| 615 content_offset.y()); | 616 content_offset.y()); |
| 617 content_view_core_->UpdateUnusedScrollOffset(unused_scroll_delta.x(), |
| 618 unused_scroll_delta.y()); |
| 616 } | 619 } |
| 617 } | 620 } |
| 618 | 621 |
| 619 void RenderWidgetHostViewAndroid::SetContentViewCore( | 622 void RenderWidgetHostViewAndroid::SetContentViewCore( |
| 620 ContentViewCoreImpl* content_view_core) { | 623 ContentViewCoreImpl* content_view_core) { |
| 621 if (content_view_core_ && is_layer_attached_) | 624 if (content_view_core_ && is_layer_attached_) |
| 622 content_view_core_->RemoveLayer(layer_); | 625 content_view_core_->RemoveLayer(layer_); |
| 623 | 626 |
| 624 content_view_core_ = content_view_core; | 627 content_view_core_ = content_view_core; |
| 625 if (content_view_core_ && is_layer_attached_) | 628 if (content_view_core_ && is_layer_attached_) |
| (...skipping 25 matching lines...) Expand all Loading... |
| 651 // RenderWidgetHostView, public: | 654 // RenderWidgetHostView, public: |
| 652 | 655 |
| 653 // static | 656 // static |
| 654 RenderWidgetHostView* | 657 RenderWidgetHostView* |
| 655 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { | 658 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { |
| 656 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); | 659 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); |
| 657 return new RenderWidgetHostViewAndroid(rwhi, NULL); | 660 return new RenderWidgetHostViewAndroid(rwhi, NULL); |
| 658 } | 661 } |
| 659 | 662 |
| 660 } // namespace content | 663 } // namespace content |
| OLD | NEW |