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 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 | 669 |
670 gfx::Size RenderWidgetHostViewAndroid::GetPhysicalBackingSize() const { | 670 gfx::Size RenderWidgetHostViewAndroid::GetPhysicalBackingSize() const { |
671 if (!content_view_core_) { | 671 if (!content_view_core_) { |
672 if (default_bounds_.IsEmpty()) return gfx::Size(); | 672 if (default_bounds_.IsEmpty()) return gfx::Size(); |
673 | 673 |
674 float scale_factor = view_.GetDipScale(); | 674 float scale_factor = view_.GetDipScale(); |
675 return gfx::Size(default_bounds_.right() * scale_factor, | 675 return gfx::Size(default_bounds_.right() * scale_factor, |
676 default_bounds_.bottom() * scale_factor); | 676 default_bounds_.bottom() * scale_factor); |
677 } | 677 } |
678 | 678 |
679 return content_view_core_->GetPhysicalBackingSize(); | 679 return view_.GetPhysicalBackingSize(); |
680 } | 680 } |
681 | 681 |
682 bool RenderWidgetHostViewAndroid::DoBrowserControlsShrinkBlinkSize() const { | 682 bool RenderWidgetHostViewAndroid::DoBrowserControlsShrinkBlinkSize() const { |
683 // Whether or not Blink's viewport size should be shrunk by the height of the | 683 // Whether or not Blink's viewport size should be shrunk by the height of the |
684 // URL-bar. | 684 // URL-bar. |
685 return content_view_core_ && | 685 return content_view_core_ && |
686 content_view_core_->DoBrowserControlsShrinkBlinkSize(); | 686 content_view_core_->DoBrowserControlsShrinkBlinkSize(); |
687 } | 687 } |
688 | 688 |
689 float RenderWidgetHostViewAndroid::GetTopControlsHeight() const { | 689 float RenderWidgetHostViewAndroid::GetTopControlsHeight() const { |
(...skipping 1281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1971 // stop providing shift meta values to synthetic MotionEvents. This prevents | 1971 // stop providing shift meta values to synthetic MotionEvents. This prevents |
1972 // unintended shift+click interpretation of all accessibility clicks. | 1972 // unintended shift+click interpretation of all accessibility clicks. |
1973 // See crbug.com/443247. | 1973 // See crbug.com/443247. |
1974 if (web_gesture.GetType() == blink::WebInputEvent::kGestureTap && | 1974 if (web_gesture.GetType() == blink::WebInputEvent::kGestureTap && |
1975 web_gesture.GetModifiers() == blink::WebInputEvent::kShiftKey) { | 1975 web_gesture.GetModifiers() == blink::WebInputEvent::kShiftKey) { |
1976 web_gesture.SetModifiers(blink::WebInputEvent::kNoModifiers); | 1976 web_gesture.SetModifiers(blink::WebInputEvent::kNoModifiers); |
1977 } | 1977 } |
1978 SendGestureEvent(web_gesture); | 1978 SendGestureEvent(web_gesture); |
1979 } | 1979 } |
1980 | 1980 |
| 1981 void RenderWidgetHostViewAndroid::OnPhysicalBackingSizeChanged() { |
| 1982 WasResized(); |
| 1983 } |
| 1984 |
1981 void RenderWidgetHostViewAndroid::OnContentViewCoreDestroyed() { | 1985 void RenderWidgetHostViewAndroid::OnContentViewCoreDestroyed() { |
1982 SetContentViewCore(NULL); | 1986 SetContentViewCore(NULL); |
1983 overscroll_controller_.reset(); | 1987 overscroll_controller_.reset(); |
1984 } | 1988 } |
1985 | 1989 |
1986 void RenderWidgetHostViewAndroid::OnRootWindowVisibilityChanged(bool visible) { | 1990 void RenderWidgetHostViewAndroid::OnRootWindowVisibilityChanged(bool visible) { |
1987 TRACE_EVENT1("browser", | 1991 TRACE_EVENT1("browser", |
1988 "RenderWidgetHostViewAndroid::OnRootWindowVisibilityChanged", | 1992 "RenderWidgetHostViewAndroid::OnRootWindowVisibilityChanged", |
1989 "visible", visible); | 1993 "visible", visible); |
1990 DCHECK(observing_root_window_); | 1994 DCHECK(observing_root_window_); |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2191 | 2195 |
2192 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor(); | 2196 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor(); |
2193 if (!compositor) | 2197 if (!compositor) |
2194 return; | 2198 return; |
2195 | 2199 |
2196 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( | 2200 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( |
2197 overscroll_refresh_handler, compositor, view_.GetDipScale()); | 2201 overscroll_refresh_handler, compositor, view_.GetDipScale()); |
2198 } | 2202 } |
2199 | 2203 |
2200 } // namespace content | 2204 } // namespace content |
OLD | NEW |