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

Side by Side Diff: content/browser/android/popup_touch_handle_drawable.h

Issue 481683003: Support for Adaptive Handle Orientation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unittests Created 5 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef CONTENT_BROWSER_ANDROID_POPUP_TOUCH_HANDLE_DRAWABLE_H_ 5 #ifndef CONTENT_BROWSER_ANDROID_POPUP_TOUCH_HANDLE_DRAWABLE_H_
6 #define CONTENT_BROWSER_ANDROID_POPUP_TOUCH_HANDLE_DRAWABLE_H_ 6 #define CONTENT_BROWSER_ANDROID_POPUP_TOUCH_HANDLE_DRAWABLE_H_
7 7
8 #include "ui/touch_selection/touch_handle.h" 8 #include "ui/touch_selection/touch_handle.h"
9 9
10 #include "base/android/jni_android.h" 10 #include "base/android/jni_android.h"
11 11
12 namespace content { 12 namespace content {
13 13
14 // Touch handle drawable backed by an Android PopupWindow. 14 // Touch handle drawable backed by an Android PopupWindow.
15 class PopupTouchHandleDrawable : public ui::TouchHandleDrawable { 15 class PopupTouchHandleDrawable : public ui::TouchHandleDrawable {
16 public: 16 public:
17 PopupTouchHandleDrawable(base::android::ScopedJavaLocalRef<jobject> drawable, 17 PopupTouchHandleDrawable(base::android::ScopedJavaLocalRef<jobject> drawable,
18 float dpi_scale); 18 float dpi_scale);
19 ~PopupTouchHandleDrawable() override; 19 ~PopupTouchHandleDrawable() override;
20 20
21 // ui::TouchHandleDrawable implementation. 21 // ui::TouchHandleDrawable implementation.
22 void SetEnabled(bool enabled) override; 22 void SetEnabled(bool enabled) override;
23 void SetOrientation(ui::TouchHandleOrientation orientation) override; 23 void SetLayout(const gfx::PointF& position,
24 ui::TouchHandleOrientation orientation,
25 bool mirror_vertical,
26 bool mirror_horizontal) override;
24 void SetAlpha(float alpha) override; 27 void SetAlpha(float alpha) override;
25 void SetFocus(const gfx::PointF& position) override;
26 gfx::RectF GetVisibleBounds() const override; 28 gfx::RectF GetVisibleBounds() const override;
29 gfx::SizeF GetDrawablePadding() const override;
27 30
28 static bool RegisterPopupTouchHandleDrawable(JNIEnv* env); 31 static bool RegisterPopupTouchHandleDrawable(JNIEnv* env);
29 32
30 private: 33 private:
31 const float dpi_scale_; 34 const float dpi_scale_;
35 gfx::SizeF drawable_padding_;
32 base::android::ScopedJavaGlobalRef<jobject> drawable_; 36 base::android::ScopedJavaGlobalRef<jobject> drawable_;
33 37
38 gfx::SizeF GetPaddingSize();
39
34 DISALLOW_COPY_AND_ASSIGN(PopupTouchHandleDrawable); 40 DISALLOW_COPY_AND_ASSIGN(PopupTouchHandleDrawable);
35 }; 41 };
36 42
37 } // namespace content 43 } // namespace content
38 44
39 #endif // CONTENT_BROWSER_ANDROID_POPUP_TOUCH_HANDLE_DRAWABLE_H_ 45 #endif // CONTENT_BROWSER_ANDROID_POPUP_TOUCH_HANDLE_DRAWABLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698