Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(416)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 2502763003: Introduce ViewRoot to forward input/view events to native (Closed)
Patch Set: no overloaded GetEventHandler Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 ContentViewCoreImpl* content_view_core) 439 ContentViewCoreImpl* content_view_core)
440 : host_(widget_host), 440 : host_(widget_host),
441 outstanding_vsync_requests_(0), 441 outstanding_vsync_requests_(0),
442 is_showing_(!widget_host->is_hidden()), 442 is_showing_(!widget_host->is_hidden()),
443 is_window_visible_(true), 443 is_window_visible_(true),
444 is_window_activity_started_(true), 444 is_window_activity_started_(true),
445 is_showing_overscroll_glow_(true), 445 is_showing_overscroll_glow_(true),
446 content_view_core_(nullptr), 446 content_view_core_(nullptr),
447 ime_adapter_android_(this), 447 ime_adapter_android_(this),
448 cached_background_color_(SK_ColorWHITE), 448 cached_background_color_(SK_ColorWHITE),
449 view_(this),
449 last_compositor_frame_sink_id_(kUndefinedCompositorFrameSinkId), 450 last_compositor_frame_sink_id_(kUndefinedCompositorFrameSinkId),
450 gesture_provider_(ui::GetGestureProviderConfig( 451 gesture_provider_(ui::GetGestureProviderConfig(
451 ui::GestureProviderConfigType::CURRENT_PLATFORM), 452 ui::GestureProviderConfigType::CURRENT_PLATFORM),
452 this), 453 this),
453 stylus_text_selector_(this), 454 stylus_text_selector_(this),
454 using_browser_compositor_(CompositorImpl::IsInitialized()), 455 using_browser_compositor_(CompositorImpl::IsInitialized()),
455 synchronous_compositor_client_(nullptr), 456 synchronous_compositor_client_(nullptr),
456 frame_evictor_(new DelegatedFrameEvictor(this)), 457 frame_evictor_(new DelegatedFrameEvictor(this)),
457 locks_on_frame_count_(0), 458 locks_on_frame_count_(0),
458 observing_root_window_(false), 459 observing_root_window_(false),
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 gfx::Size RenderWidgetHostViewAndroid::GetPhysicalBackingSize() const { 716 gfx::Size RenderWidgetHostViewAndroid::GetPhysicalBackingSize() const {
716 if (!content_view_core_) { 717 if (!content_view_core_) {
717 if (default_bounds_.IsEmpty()) return gfx::Size(); 718 if (default_bounds_.IsEmpty()) return gfx::Size();
718 719
719 return gfx::Size(default_bounds_.right() 720 return gfx::Size(default_bounds_.right()
720 * ui::GetScaleFactorForNativeView(GetNativeView()), 721 * ui::GetScaleFactorForNativeView(GetNativeView()),
721 default_bounds_.bottom() 722 default_bounds_.bottom()
722 * ui::GetScaleFactorForNativeView(GetNativeView())); 723 * ui::GetScaleFactorForNativeView(GetNativeView()));
723 } 724 }
724 725
725 return content_view_core_->GetPhysicalBackingSize(); 726 return view_.GetPhysicalBackingSize();
726 } 727 }
727 728
728 bool RenderWidgetHostViewAndroid::DoBrowserControlsShrinkBlinkSize() const { 729 bool RenderWidgetHostViewAndroid::DoBrowserControlsShrinkBlinkSize() const {
729 // 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
730 // URL-bar. 731 // URL-bar.
731 return content_view_core_ && 732 return content_view_core_ &&
732 content_view_core_->DoBrowserControlsShrinkBlinkSize(); 733 content_view_core_->DoBrowserControlsShrinkBlinkSize();
733 } 734 }
734 735
735 float RenderWidgetHostViewAndroid::GetTopControlsHeight() const { 736 float RenderWidgetHostViewAndroid::GetTopControlsHeight() const {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 801
801 void RenderWidgetHostViewAndroid::SetNeedsBeginFrames(bool needs_begin_frames) { 802 void RenderWidgetHostViewAndroid::SetNeedsBeginFrames(bool needs_begin_frames) {
802 TRACE_EVENT1("cc", "RenderWidgetHostViewAndroid::SetNeedsBeginFrames", 803 TRACE_EVENT1("cc", "RenderWidgetHostViewAndroid::SetNeedsBeginFrames",
803 "needs_begin_frames", needs_begin_frames); 804 "needs_begin_frames", needs_begin_frames);
804 if (needs_begin_frames) 805 if (needs_begin_frames)
805 RequestVSyncUpdate(PERSISTENT_BEGIN_FRAME); 806 RequestVSyncUpdate(PERSISTENT_BEGIN_FRAME);
806 else 807 else
807 outstanding_vsync_requests_ &= ~PERSISTENT_BEGIN_FRAME; 808 outstanding_vsync_requests_ &= ~PERSISTENT_BEGIN_FRAME;
808 } 809 }
809 810
811 void RenderWidgetHostViewAndroid::OnPhysicalBackingSizeChanged(int width,
812 int height) {
813 WasResized();
814 }
815
810 void RenderWidgetHostViewAndroid::OnStartContentIntent( 816 void RenderWidgetHostViewAndroid::OnStartContentIntent(
811 const GURL& content_url, bool is_main_frame) { 817 const GURL& content_url, bool is_main_frame) {
812 if (content_view_core_) 818 if (content_view_core_)
813 content_view_core_->StartContentIntent(content_url, is_main_frame); 819 content_view_core_->StartContentIntent(content_url, is_main_frame);
814 } 820 }
815 821
816 void RenderWidgetHostViewAndroid::OnSmartClipDataExtracted( 822 void RenderWidgetHostViewAndroid::OnSmartClipDataExtracted(
817 const base::string16& text, 823 const base::string16& text,
818 const base::string16& html, 824 const base::string16& html,
819 const gfx::Rect rect) { 825 const gfx::Rect rect) {
(...skipping 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after
1995 case ui::MotionEvent::ACTION_UP: 2001 case ui::MotionEvent::ACTION_UP:
1996 case ui::MotionEvent::ACTION_POINTER_UP: 2002 case ui::MotionEvent::ACTION_POINTER_UP:
1997 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", 2003 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED",
1998 delta.InMicroseconds(), 1, 1000000, 50); 2004 delta.InMicroseconds(), 1, 1000000, 50);
1999 default: 2005 default:
2000 return; 2006 return;
2001 } 2007 }
2002 } 2008 }
2003 2009
2004 } // namespace content 2010 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698