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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 ContentViewCoreImpl* content_view_core) | 433 ContentViewCoreImpl* content_view_core) |
434 : host_(widget_host), | 434 : host_(widget_host), |
435 outstanding_vsync_requests_(0), | 435 outstanding_vsync_requests_(0), |
436 is_showing_(!widget_host->is_hidden()), | 436 is_showing_(!widget_host->is_hidden()), |
437 is_window_visible_(true), | 437 is_window_visible_(true), |
438 is_window_activity_started_(true), | 438 is_window_activity_started_(true), |
439 is_showing_overscroll_glow_(true), | 439 is_showing_overscroll_glow_(true), |
440 content_view_core_(nullptr), | 440 content_view_core_(nullptr), |
441 ime_adapter_android_(this), | 441 ime_adapter_android_(this), |
442 cached_background_color_(SK_ColorWHITE), | 442 cached_background_color_(SK_ColorWHITE), |
| 443 view_(this), |
443 last_compositor_frame_sink_id_(kUndefinedCompositorFrameSinkId), | 444 last_compositor_frame_sink_id_(kUndefinedCompositorFrameSinkId), |
444 gesture_provider_(ui::GetGestureProviderConfig( | 445 gesture_provider_(ui::GetGestureProviderConfig( |
445 ui::GestureProviderConfigType::CURRENT_PLATFORM), | 446 ui::GestureProviderConfigType::CURRENT_PLATFORM), |
446 this), | 447 this), |
447 stylus_text_selector_(this), | 448 stylus_text_selector_(this), |
448 using_browser_compositor_(CompositorImpl::IsInitialized()), | 449 using_browser_compositor_(CompositorImpl::IsInitialized()), |
449 synchronous_compositor_client_(nullptr), | 450 synchronous_compositor_client_(nullptr), |
450 frame_evictor_(new DelegatedFrameEvictor(this)), | 451 frame_evictor_(new DelegatedFrameEvictor(this)), |
451 locks_on_frame_count_(0), | 452 locks_on_frame_count_(0), |
452 observing_root_window_(false), | 453 observing_root_window_(false), |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
711 gfx::Size RenderWidgetHostViewAndroid::GetPhysicalBackingSize() const { | 712 gfx::Size RenderWidgetHostViewAndroid::GetPhysicalBackingSize() const { |
712 if (!content_view_core_) { | 713 if (!content_view_core_) { |
713 if (default_bounds_.IsEmpty()) return gfx::Size(); | 714 if (default_bounds_.IsEmpty()) return gfx::Size(); |
714 | 715 |
715 return gfx::Size(default_bounds_.right() | 716 return gfx::Size(default_bounds_.right() |
716 * ui::GetScaleFactorForNativeView(GetNativeView()), | 717 * ui::GetScaleFactorForNativeView(GetNativeView()), |
717 default_bounds_.bottom() | 718 default_bounds_.bottom() |
718 * ui::GetScaleFactorForNativeView(GetNativeView())); | 719 * ui::GetScaleFactorForNativeView(GetNativeView())); |
719 } | 720 } |
720 | 721 |
721 return content_view_core_->GetPhysicalBackingSize(); | 722 return view_.GetPhysicalBackingSize(); |
722 } | 723 } |
723 | 724 |
724 bool RenderWidgetHostViewAndroid::DoBrowserControlsShrinkBlinkSize() const { | 725 bool RenderWidgetHostViewAndroid::DoBrowserControlsShrinkBlinkSize() const { |
725 // Whether or not Blink's viewport size should be shrunk by the height of the | 726 // Whether or not Blink's viewport size should be shrunk by the height of the |
726 // URL-bar. | 727 // URL-bar. |
727 return content_view_core_ && | 728 return content_view_core_ && |
728 content_view_core_->DoBrowserControlsShrinkBlinkSize(); | 729 content_view_core_->DoBrowserControlsShrinkBlinkSize(); |
729 } | 730 } |
730 | 731 |
731 float RenderWidgetHostViewAndroid::GetTopControlsHeight() const { | 732 float RenderWidgetHostViewAndroid::GetTopControlsHeight() const { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
796 | 797 |
797 void RenderWidgetHostViewAndroid::SetNeedsBeginFrames(bool needs_begin_frames) { | 798 void RenderWidgetHostViewAndroid::SetNeedsBeginFrames(bool needs_begin_frames) { |
798 TRACE_EVENT1("cc", "RenderWidgetHostViewAndroid::SetNeedsBeginFrames", | 799 TRACE_EVENT1("cc", "RenderWidgetHostViewAndroid::SetNeedsBeginFrames", |
799 "needs_begin_frames", needs_begin_frames); | 800 "needs_begin_frames", needs_begin_frames); |
800 if (needs_begin_frames) | 801 if (needs_begin_frames) |
801 RequestVSyncUpdate(PERSISTENT_BEGIN_FRAME); | 802 RequestVSyncUpdate(PERSISTENT_BEGIN_FRAME); |
802 else | 803 else |
803 outstanding_vsync_requests_ &= ~PERSISTENT_BEGIN_FRAME; | 804 outstanding_vsync_requests_ &= ~PERSISTENT_BEGIN_FRAME; |
804 } | 805 } |
805 | 806 |
| 807 void RenderWidgetHostViewAndroid::OnPhysicalBackingSizeChanged(int width, |
| 808 int height) { |
| 809 WasResized(); |
| 810 } |
| 811 |
806 void RenderWidgetHostViewAndroid::OnStartContentIntent( | 812 void RenderWidgetHostViewAndroid::OnStartContentIntent( |
807 const GURL& content_url, bool is_main_frame) { | 813 const GURL& content_url, bool is_main_frame) { |
808 if (content_view_core_) | 814 if (content_view_core_) |
809 content_view_core_->StartContentIntent(content_url, is_main_frame); | 815 content_view_core_->StartContentIntent(content_url, is_main_frame); |
810 } | 816 } |
811 | 817 |
812 void RenderWidgetHostViewAndroid::OnSmartClipDataExtracted( | 818 void RenderWidgetHostViewAndroid::OnSmartClipDataExtracted( |
813 const base::string16& text, | 819 const base::string16& text, |
814 const base::string16& html, | 820 const base::string16& html, |
815 const gfx::Rect rect) { | 821 const gfx::Rect rect) { |
(...skipping 1217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2033 if (!compositor) | 2039 if (!compositor) |
2034 return; | 2040 return; |
2035 | 2041 |
2036 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( | 2042 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( |
2037 overscroll_refresh_handler, compositor, | 2043 overscroll_refresh_handler, compositor, |
2038 ui::GetScaleFactorForNativeView(GetNativeView())); | 2044 ui::GetScaleFactorForNativeView(GetNativeView())); |
2039 is_showing_overscroll_glow_ = true; | 2045 is_showing_overscroll_glow_ = true; |
2040 } | 2046 } |
2041 | 2047 |
2042 } // namespace content | 2048 } // namespace content |
OLD | NEW |