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 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 | 625 |
626 bool RenderWidgetHostViewAndroid::IsShowing() { | 626 bool RenderWidgetHostViewAndroid::IsShowing() { |
627 // ContentViewCoreImpl represents the native side of the Java | 627 // ContentViewCoreImpl represents the native side of the Java |
628 // ContentViewCore. It being NULL means that it is not attached | 628 // ContentViewCore. It being NULL means that it is not attached |
629 // to the View system yet, so we treat this RWHVA as hidden. | 629 // to the View system yet, so we treat this RWHVA as hidden. |
630 return is_showing_ && content_view_core_; | 630 return is_showing_ && content_view_core_; |
631 } | 631 } |
632 | 632 |
633 void RenderWidgetHostViewAndroid::OnShowUnhandledTapUIIfNeeded(int x_dip, | 633 void RenderWidgetHostViewAndroid::OnShowUnhandledTapUIIfNeeded(int x_dip, |
634 int y_dip) { | 634 int y_dip) { |
| 635 VLOG(0) << "ctxs OnShowUnhandledTapUIIfNeeded x " << x_dip << ", y " << y_dip; |
635 if (!content_view_core_) | 636 if (!content_view_core_) |
636 return; | 637 return; |
637 // Validate the coordinates are within the viewport. | 638 // Validate the coordinates are within the viewport. |
638 gfx::Size viewport_size = content_view_core_->GetViewportSizeDip(); | 639 gfx::Size viewport_size = content_view_core_->GetViewportSizeDip(); |
639 if (x_dip < 0 || x_dip > viewport_size.width() || | 640 if (x_dip < 0 || x_dip > viewport_size.width() || |
640 y_dip < 0 || y_dip > viewport_size.height()) | 641 y_dip < 0 || y_dip > viewport_size.height()) |
641 return; | 642 return; |
| 643 VLOG(0) << "ctxs calling CVC x " << x_dip << ", y " << y_dip; |
642 content_view_core_->OnShowUnhandledTapUIIfNeeded(x_dip, y_dip); | 644 content_view_core_->OnShowUnhandledTapUIIfNeeded(x_dip, y_dip); |
643 } | 645 } |
644 | 646 |
645 gfx::Rect RenderWidgetHostViewAndroid::GetViewBounds() const { | 647 gfx::Rect RenderWidgetHostViewAndroid::GetViewBounds() const { |
646 if (!content_view_core_) | 648 if (!content_view_core_) |
647 return default_bounds_; | 649 return default_bounds_; |
648 | 650 |
649 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 651 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
650 switches::kEnableOSKOverscroll)) | 652 switches::kEnableOSKOverscroll)) |
651 return gfx::Rect(content_view_core_->GetViewSizeWithOSKHidden()); | 653 return gfx::Rect(content_view_core_->GetViewSizeWithOSKHidden()); |
(...skipping 1527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2179 | 2181 |
2180 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor(); | 2182 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor(); |
2181 if (!compositor) | 2183 if (!compositor) |
2182 return; | 2184 return; |
2183 | 2185 |
2184 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( | 2186 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( |
2185 overscroll_refresh_handler, compositor, view_.GetDipScale()); | 2187 overscroll_refresh_handler, compositor, view_.GetDipScale()); |
2186 } | 2188 } |
2187 | 2189 |
2188 } // namespace content | 2190 } // namespace content |
OLD | NEW |