Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / content / browser / android / popup_touch_handle_drawable.h
blob9ce944d1a20a8885e0ee8bb2a405ba9509fddd3e
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 "content/browser/renderer_host/input/touch_handle.h"
10 #include "base/android/jni_android.h"
12 namespace content {
14 // Touch handle drawable backed by an Android PopupWindow.
15 class PopupTouchHandleDrawable : public TouchHandleDrawable {
16 public:
17 PopupTouchHandleDrawable(base::android::ScopedJavaLocalRef<jobject> drawable,
18 float dpi_scale);
19 virtual ~PopupTouchHandleDrawable();
21 // TouchHandleDrawable implementation.
22 virtual void SetEnabled(bool enabled) OVERRIDE;
23 virtual void SetOrientation(TouchHandleOrientation orientation) OVERRIDE;
24 virtual void SetAlpha(float alpha) OVERRIDE;
25 virtual void SetFocus(const gfx::PointF& position) OVERRIDE;
26 virtual void SetVisible(bool visible) OVERRIDE;
27 virtual bool IntersectsWith(const gfx::RectF& rect) const OVERRIDE;
29 static bool RegisterPopupTouchHandleDrawable(JNIEnv* env);
31 private:
32 const float dpi_scale_;
33 base::android::ScopedJavaGlobalRef<jobject> drawable_;
35 DISALLOW_COPY_AND_ASSIGN(PopupTouchHandleDrawable);
38 } // namespace content
40 #endif // CONTENT_BROWSER_ANDROID_POPUP_TOUCH_HANDLE_DRAWABLE_H_