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

Unified Diff: content/browser/android/popup_touch_handle_drawable.cc

Issue 481683003: Support for Adaptive Handle Orientation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup Created 5 years, 8 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/android/popup_touch_handle_drawable.cc
diff --git a/content/browser/android/popup_touch_handle_drawable.cc b/content/browser/android/popup_touch_handle_drawable.cc
index aef23f8fb0f9696f94bcf038d5320cd64fa345c6..2c122f136cb943df22c2391810457680f0c5400d 100644
--- a/content/browser/android/popup_touch_handle_drawable.cc
+++ b/content/browser/android/popup_touch_handle_drawable.cc
@@ -29,12 +29,20 @@ void PopupTouchHandleDrawable::SetEnabled(bool enabled) {
Java_PopupTouchHandleDrawable_hide(env, drawable_.obj());
}
-void PopupTouchHandleDrawable::SetOrientation(
- ui::TouchHandleOrientation orientation) {
+void PopupTouchHandleDrawable::SetLayout(const gfx::PointF& position,
+ ui::TouchHandleOrientation orientation,
+ bool mirror_vertical,
+ bool mirror_horizontal) {
+ const gfx::PointF position_pix = gfx::ScalePoint(position, dpi_scale_);
JNIEnv* env = base::android::AttachCurrentThread();
jobject obj = drawable_.obj();
- Java_PopupTouchHandleDrawable_setOrientation(env, obj,
- static_cast<int>(orientation));
+
+ Java_PopupTouchHandleDrawable_setFocus(env, obj, position_pix.x(),
+ position_pix.y());
+
+ Java_PopupTouchHandleDrawable_setOrientation(
+ env, obj, static_cast<int>(orientation), mirror_vertical,
+ mirror_horizontal);
}
void PopupTouchHandleDrawable::SetAlpha(float alpha) {
@@ -43,13 +51,6 @@ void PopupTouchHandleDrawable::SetAlpha(float alpha) {
Java_PopupTouchHandleDrawable_setVisible(env, drawable_.obj(), visible);
}
-void PopupTouchHandleDrawable::SetFocus(const gfx::PointF& position) {
- const gfx::PointF position_pix = gfx::ScalePoint(position, dpi_scale_);
- JNIEnv* env = base::android::AttachCurrentThread();
- Java_PopupTouchHandleDrawable_setFocus(
- env, drawable_.obj(), position_pix.x(), position_pix.y());
-}
-
gfx::RectF PopupTouchHandleDrawable::GetVisibleBounds() const {
JNIEnv* env = base::android::AttachCurrentThread();
gfx::RectF unscaled_rect(

Powered by Google App Engine
This is Rietveld 408576698