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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 #include "content/public/browser/devtools_agent_host.h" | 70 #include "content/public/browser/devtools_agent_host.h" |
71 #include "content/public/browser/render_view_host.h" | 71 #include "content/public/browser/render_view_host.h" |
72 #include "content/public/browser/render_widget_host_iterator.h" | 72 #include "content/public/browser/render_widget_host_iterator.h" |
73 #include "content/public/common/content_switches.h" | 73 #include "content/public/common/content_switches.h" |
74 #include "gpu/command_buffer/client/gles2_implementation.h" | 74 #include "gpu/command_buffer/client/gles2_implementation.h" |
75 #include "gpu/command_buffer/client/gles2_interface.h" | 75 #include "gpu/command_buffer/client/gles2_interface.h" |
76 #include "gpu/config/gpu_driver_bug_workaround_type.h" | 76 #include "gpu/config/gpu_driver_bug_workaround_type.h" |
77 #include "ipc/ipc_message_macros.h" | 77 #include "ipc/ipc_message_macros.h" |
78 #include "ipc/ipc_message_start.h" | 78 #include "ipc/ipc_message_start.h" |
79 #include "skia/ext/image_operations.h" | 79 #include "skia/ext/image_operations.h" |
| 80 #include "third_party/WebKit/public/platform/WebCursorInfo.h" |
80 #include "third_party/khronos/GLES2/gl2.h" | 81 #include "third_party/khronos/GLES2/gl2.h" |
81 #include "third_party/khronos/GLES2/gl2ext.h" | 82 #include "third_party/khronos/GLES2/gl2ext.h" |
82 #include "third_party/skia/include/core/SkCanvas.h" | 83 #include "third_party/skia/include/core/SkCanvas.h" |
83 #include "ui/android/window_android.h" | 84 #include "ui/android/window_android.h" |
84 #include "ui/android/window_android_compositor.h" | 85 #include "ui/android/window_android_compositor.h" |
85 #include "ui/base/layout.h" | 86 #include "ui/base/layout.h" |
86 #include "ui/events/android/motion_event_android.h" | 87 #include "ui/events/android/motion_event_android.h" |
87 #include "ui/events/base_event_utils.h" | 88 #include "ui/events/base_event_utils.h" |
88 #include "ui/events/blink/blink_event_util.h" | 89 #include "ui/events/blink/blink_event_util.h" |
89 #include "ui/events/blink/did_overscroll_params.h" | 90 #include "ui/events/blink/did_overscroll_params.h" |
(...skipping 26 matching lines...) Expand all Loading... |
116 friend class base::RefCounted<PendingReadbackLock>; | 117 friend class base::RefCounted<PendingReadbackLock>; |
117 | 118 |
118 ~PendingReadbackLock() { | 119 ~PendingReadbackLock() { |
119 DCHECK_EQ(g_pending_readback_lock, this); | 120 DCHECK_EQ(g_pending_readback_lock, this); |
120 g_pending_readback_lock = nullptr; | 121 g_pending_readback_lock = nullptr; |
121 } | 122 } |
122 }; | 123 }; |
123 | 124 |
124 using base::android::ApplicationState; | 125 using base::android::ApplicationState; |
125 using base::android::ApplicationStatusListener; | 126 using base::android::ApplicationStatusListener; |
| 127 using blink::WebCursorInfo; |
126 | 128 |
127 class GLHelperHolder { | 129 class GLHelperHolder { |
128 public: | 130 public: |
129 static GLHelperHolder* Create(); | 131 static GLHelperHolder* Create(); |
130 | 132 |
131 viz::GLHelper* gl_helper() { return gl_helper_.get(); } | 133 viz::GLHelper* gl_helper() { return gl_helper_.get(); } |
132 bool IsLost() { | 134 bool IsLost() { |
133 if (!gl_helper_) | 135 if (!gl_helper_) |
134 return true; | 136 return true; |
135 return provider_->ContextGL()->GetGraphicsResetStatusKHR() != GL_NO_ERROR; | 137 return provider_->ContextGL()->GetGraphicsResetStatusKHR() != GL_NO_ERROR; |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 | 702 |
701 float RenderWidgetHostViewAndroid::GetBottomControlsHeight() const { | 703 float RenderWidgetHostViewAndroid::GetBottomControlsHeight() const { |
702 if (!content_view_core_) | 704 if (!content_view_core_) |
703 return 0.f; | 705 return 0.f; |
704 | 706 |
705 // The height of the browser controls. | 707 // The height of the browser controls. |
706 return content_view_core_->GetBottomControlsHeightDip(); | 708 return content_view_core_->GetBottomControlsHeightDip(); |
707 } | 709 } |
708 | 710 |
709 void RenderWidgetHostViewAndroid::UpdateCursor(const WebCursor& cursor) { | 711 void RenderWidgetHostViewAndroid::UpdateCursor(const WebCursor& cursor) { |
710 // There are no cursors on Android. | 712 CursorInfo cursor_info; |
| 713 cursor.GetCursorInfo(&cursor_info); |
| 714 view_.OnCursorChanged(cursor_info.type == WebCursorInfo::kTypeCustom, |
| 715 cursor_info.type, cursor_info.custom_image, |
| 716 cursor_info.hotspot); |
711 } | 717 } |
712 | 718 |
713 void RenderWidgetHostViewAndroid::SetIsLoading(bool is_loading) { | 719 void RenderWidgetHostViewAndroid::SetIsLoading(bool is_loading) { |
714 // Do nothing. The UI notification is handled through ContentViewClient which | 720 // Do nothing. The UI notification is handled through ContentViewClient which |
715 // is TabContentsDelegate. | 721 // is TabContentsDelegate. |
716 } | 722 } |
717 | 723 |
718 // ----------------------------------------------------------------------------- | 724 // ----------------------------------------------------------------------------- |
719 // TextInputManager::Observer implementations. | 725 // TextInputManager::Observer implementations. |
720 void RenderWidgetHostViewAndroid::OnUpdateTextInputStateCalled( | 726 void RenderWidgetHostViewAndroid::OnUpdateTextInputStateCalled( |
(...skipping 1497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2218 | 2224 |
2219 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor(); | 2225 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor(); |
2220 if (!compositor) | 2226 if (!compositor) |
2221 return; | 2227 return; |
2222 | 2228 |
2223 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( | 2229 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( |
2224 overscroll_refresh_handler, compositor, view_.GetDipScale()); | 2230 overscroll_refresh_handler, compositor, view_.GetDipScale()); |
2225 } | 2231 } |
2226 | 2232 |
2227 } // namespace content | 2233 } // namespace content |
OLD | NEW |