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 <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 : host_(widget_host), | 440 : host_(widget_host), |
441 begin_frame_source_(nullptr), | 441 begin_frame_source_(nullptr), |
442 outstanding_begin_frame_requests_(0), | 442 outstanding_begin_frame_requests_(0), |
443 is_showing_(!widget_host->is_hidden()), | 443 is_showing_(!widget_host->is_hidden()), |
444 is_window_visible_(true), | 444 is_window_visible_(true), |
445 is_window_activity_started_(true), | 445 is_window_activity_started_(true), |
446 is_showing_overscroll_glow_(true), | 446 is_showing_overscroll_glow_(true), |
447 content_view_core_(nullptr), | 447 content_view_core_(nullptr), |
448 ime_adapter_android_(this), | 448 ime_adapter_android_(this), |
449 cached_background_color_(SK_ColorWHITE), | 449 cached_background_color_(SK_ColorWHITE), |
450 view_(this), | |
451 last_compositor_frame_sink_id_(kUndefinedCompositorFrameSinkId), | 450 last_compositor_frame_sink_id_(kUndefinedCompositorFrameSinkId), |
452 gesture_provider_(ui::GetGestureProviderConfig( | 451 gesture_provider_(ui::GetGestureProviderConfig( |
453 ui::GestureProviderConfigType::CURRENT_PLATFORM), | 452 ui::GestureProviderConfigType::CURRENT_PLATFORM), |
454 this), | 453 this), |
455 stylus_text_selector_(this), | 454 stylus_text_selector_(this), |
456 using_browser_compositor_(CompositorImpl::IsInitialized()), | 455 using_browser_compositor_(CompositorImpl::IsInitialized()), |
457 synchronous_compositor_client_(nullptr), | 456 synchronous_compositor_client_(nullptr), |
458 frame_evictor_(new DelegatedFrameEvictor(this)), | 457 frame_evictor_(new DelegatedFrameEvictor(this)), |
459 locks_on_frame_count_(0), | 458 locks_on_frame_count_(0), |
460 observing_root_window_(false), | 459 observing_root_window_(false), |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 gfx::Size RenderWidgetHostViewAndroid::GetPhysicalBackingSize() const { | 716 gfx::Size RenderWidgetHostViewAndroid::GetPhysicalBackingSize() const { |
718 if (!content_view_core_) { | 717 if (!content_view_core_) { |
719 if (default_bounds_.IsEmpty()) return gfx::Size(); | 718 if (default_bounds_.IsEmpty()) return gfx::Size(); |
720 | 719 |
721 return gfx::Size(default_bounds_.right() | 720 return gfx::Size(default_bounds_.right() |
722 * ui::GetScaleFactorForNativeView(GetNativeView()), | 721 * ui::GetScaleFactorForNativeView(GetNativeView()), |
723 default_bounds_.bottom() | 722 default_bounds_.bottom() |
724 * ui::GetScaleFactorForNativeView(GetNativeView())); | 723 * ui::GetScaleFactorForNativeView(GetNativeView())); |
725 } | 724 } |
726 | 725 |
727 return view_.GetPhysicalBackingSize(); | 726 return content_view_core_->GetPhysicalBackingSize(); |
728 } | 727 } |
729 | 728 |
730 bool RenderWidgetHostViewAndroid::DoBrowserControlsShrinkBlinkSize() const { | 729 bool RenderWidgetHostViewAndroid::DoBrowserControlsShrinkBlinkSize() const { |
731 // Whether or not Blink's viewport size should be shrunk by the height of the | 730 // Whether or not Blink's viewport size should be shrunk by the height of the |
732 // URL-bar. | 731 // URL-bar. |
733 return content_view_core_ && | 732 return content_view_core_ && |
734 content_view_core_->DoBrowserControlsShrinkBlinkSize(); | 733 content_view_core_->DoBrowserControlsShrinkBlinkSize(); |
735 } | 734 } |
736 | 735 |
737 float RenderWidgetHostViewAndroid::GetTopControlsHeight() const { | 736 float RenderWidgetHostViewAndroid::GetTopControlsHeight() const { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
802 | 801 |
803 void RenderWidgetHostViewAndroid::SetNeedsBeginFrames(bool needs_begin_frames) { | 802 void RenderWidgetHostViewAndroid::SetNeedsBeginFrames(bool needs_begin_frames) { |
804 TRACE_EVENT1("cc", "RenderWidgetHostViewAndroid::SetNeedsBeginFrames", | 803 TRACE_EVENT1("cc", "RenderWidgetHostViewAndroid::SetNeedsBeginFrames", |
805 "needs_begin_frames", needs_begin_frames); | 804 "needs_begin_frames", needs_begin_frames); |
806 if (needs_begin_frames) | 805 if (needs_begin_frames) |
807 AddBeginFrameRequest(PERSISTENT_BEGIN_FRAME); | 806 AddBeginFrameRequest(PERSISTENT_BEGIN_FRAME); |
808 else | 807 else |
809 ClearBeginFrameRequest(PERSISTENT_BEGIN_FRAME); | 808 ClearBeginFrameRequest(PERSISTENT_BEGIN_FRAME); |
810 } | 809 } |
811 | 810 |
812 void RenderWidgetHostViewAndroid::OnPhysicalBackingSizeChanged(int width, | |
813 int height) { | |
814 WasResized(); | |
815 } | |
816 | |
817 void RenderWidgetHostViewAndroid::OnStartContentIntent( | 811 void RenderWidgetHostViewAndroid::OnStartContentIntent( |
818 const GURL& content_url, bool is_main_frame) { | 812 const GURL& content_url, bool is_main_frame) { |
819 if (content_view_core_) | 813 if (content_view_core_) |
820 content_view_core_->StartContentIntent(content_url, is_main_frame); | 814 content_view_core_->StartContentIntent(content_url, is_main_frame); |
821 } | 815 } |
822 | 816 |
823 void RenderWidgetHostViewAndroid::OnSmartClipDataExtracted( | 817 void RenderWidgetHostViewAndroid::OnSmartClipDataExtracted( |
824 const base::string16& text, | 818 const base::string16& text, |
825 const base::string16& html, | 819 const base::string16& html, |
826 const gfx::Rect rect) { | 820 const gfx::Rect rect) { |
(...skipping 1255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2082 if (!compositor) | 2076 if (!compositor) |
2083 return; | 2077 return; |
2084 | 2078 |
2085 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( | 2079 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( |
2086 overscroll_refresh_handler, compositor, | 2080 overscroll_refresh_handler, compositor, |
2087 ui::GetScaleFactorForNativeView(GetNativeView())); | 2081 ui::GetScaleFactorForNativeView(GetNativeView())); |
2088 is_showing_overscroll_glow_ = true; | 2082 is_showing_overscroll_glow_ = true; |
2089 } | 2083 } |
2090 | 2084 |
2091 } // namespace content | 2085 } // namespace content |
OLD | NEW |