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

Unified Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 2263043002: android_webview: Let AwContents manage TouchHandleDrawable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_widget_host_view_android.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc
index 99330cd7b65b3e1d4efa14a6c42327114d361d54..ffd6fbedbe5112dd21a6dfcf07caa38901a0eea0 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -38,7 +38,6 @@
#include "content/browser/android/composited_touch_handle_drawable.h"
#include "content/browser/android/content_view_core_impl.h"
#include "content/browser/android/overscroll_controller_android.h"
-#include "content/browser/android/popup_touch_handle_drawable.h"
#include "content/browser/android/synchronous_compositor_host.h"
#include "content/browser/devtools/render_frame_devtools_agent_host.h"
#include "content/browser/gpu/browser_gpu_channel_host_factory.h"
@@ -58,6 +57,7 @@
#include "content/common/input_messages.h"
#include "content/common/view_messages.h"
#include "content/public/browser/android/compositor.h"
+#include "content/public/browser/android/popup_touch_handle_drawable.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/render_view_host.h"
@@ -1082,17 +1082,21 @@ void RenderWidgetHostViewAndroid::OnSelectionEvent(
std::unique_ptr<ui::TouchHandleDrawable>
RenderWidgetHostViewAndroid::CreateDrawable() {
DCHECK(content_view_core_);
- if (!using_browser_compositor_)
- return PopupTouchHandleDrawable::Create(
- content_view_core_, ui::GetScaleFactorForNativeView(GetNativeView()));
-
- return std::unique_ptr<
- ui::TouchHandleDrawable>(new CompositedTouchHandleDrawable(
- content_view_core_->GetViewAndroid()->GetLayer(),
- ui::GetScaleFactorForNativeView(GetNativeView()),
- // Use the activity context (instead of the application context) to ensure
- // proper handle theming.
- content_view_core_->GetContext().obj()));
+ std::unique_ptr<ui::TouchHandleDrawable> drawable = !using_browser_compositor_
+ ? PopupTouchHandleDrawable::Create(
+ content_view_core_,
+ ui::GetScaleFactorForNativeView(GetNativeView()))
+ : std::unique_ptr<
+ ui::TouchHandleDrawable>(new CompositedTouchHandleDrawable(
+ content_view_core_->GetViewAndroid()->GetLayer(),
+ ui::GetScaleFactorForNativeView(GetNativeView()),
+ // Use the activity context (instead of the application context)
+ // to ensure proper handle theming.
+ content_view_core_->GetContext().obj()));
+ WebContentsImpl* web_contents_impl =
+ static_cast<WebContentsImpl*>(content_view_core_->GetWebContents());
+ web_contents_impl->OnDidCreateTouchHandle(drawable.get());
+ return drawable;
}
void RenderWidgetHostViewAndroid::SynchronousCopyContents(

Powered by Google App Engine
This is Rietveld 408576698