Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / content / browser / android / popup_touch_handle_drawable.h
blob84d2673d0bb0fbd607db7ce6b748b0fb45c0aa37
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_ANDROID_POPUP_TOUCH_HANDLE_DRAWABLE_H_
6 #define CONTENT_BROWSER_ANDROID_POPUP_TOUCH_HANDLE_DRAWABLE_H_
8 #include "ui/touch_selection/touch_handle.h"
10 #include "base/android/jni_android.h"
11 #include "base/android/jni_weak_ref.h"
13 namespace content {
15 class ContentViewCore;
17 // Touch handle drawable backed by an Android PopupWindow.
18 class PopupTouchHandleDrawable : public ui::TouchHandleDrawable {
19 public:
20 static scoped_ptr<PopupTouchHandleDrawable> Create(
21 ContentViewCore* content_view_core);
22 ~PopupTouchHandleDrawable() override;
24 // ui::TouchHandleDrawable implementation.
25 void SetEnabled(bool enabled) override;
26 void SetOrientation(ui::TouchHandleOrientation orientation) override;
27 void SetAlpha(float alpha) override;
28 void SetFocus(const gfx::PointF& position) override;
29 gfx::RectF GetVisibleBounds() const override;
31 static bool RegisterPopupTouchHandleDrawable(JNIEnv* env);
33 private:
34 PopupTouchHandleDrawable(JNIEnv* env, jobject obj, float dpi_scale);
36 JavaObjectWeakGlobalRef java_ref_;
38 const float dpi_scale_;
40 DISALLOW_COPY_AND_ASSIGN(PopupTouchHandleDrawable);
43 } // namespace content
45 #endif // CONTENT_BROWSER_ANDROID_POPUP_TOUCH_HANDLE_DRAWABLE_H_