OLD | NEW |
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 #include "content/browser/android/popup_touch_handle_drawable.h" | 5 #include "content/browser/android/popup_touch_handle_drawable.h" |
6 | 6 |
7 #include "content/public/browser/android/content_view_core.h" | 7 #include "content/public/browser/android/content_view_core.h" |
8 #include "jni/PopupTouchHandleDrawable_jni.h" | 8 #include "jni/PopupTouchHandleDrawable_jni.h" |
9 | 9 |
| 10 using base::android::ScopedJavaLocalRef; |
| 11 |
10 namespace content { | 12 namespace content { |
11 | 13 |
12 // static | 14 // static |
13 std::unique_ptr<PopupTouchHandleDrawable> PopupTouchHandleDrawable::Create( | 15 std::unique_ptr<PopupTouchHandleDrawable> PopupTouchHandleDrawable::Create( |
14 ContentViewCore* content_view_core, | 16 ContentViewCore* content_view_core, |
15 float dpi_scale) { | 17 float dpi_scale) { |
16 DCHECK(content_view_core); | 18 DCHECK(content_view_core); |
17 base::android::ScopedJavaLocalRef<jobject> content_view_core_obj = | 19 base::android::ScopedJavaLocalRef<jobject> content_view_core_obj = |
18 content_view_core->GetJavaObject(); | 20 content_view_core->GetJavaObject(); |
19 if (content_view_core_obj.is_null()) | 21 if (content_view_core_obj.is_null()) |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 Java_PopupTouchHandleDrawable_getVisibleWidth(env, obj.obj()), | 96 Java_PopupTouchHandleDrawable_getVisibleWidth(env, obj.obj()), |
95 Java_PopupTouchHandleDrawable_getVisibleHeight(env, obj.obj())); | 97 Java_PopupTouchHandleDrawable_getVisibleHeight(env, obj.obj())); |
96 return gfx::ScaleRect(unscaled_rect, 1.f / dpi_scale_); | 98 return gfx::ScaleRect(unscaled_rect, 1.f / dpi_scale_); |
97 } | 99 } |
98 | 100 |
99 float PopupTouchHandleDrawable::GetDrawableHorizontalPaddingRatio() const { | 101 float PopupTouchHandleDrawable::GetDrawableHorizontalPaddingRatio() const { |
100 return drawable_horizontal_padding_ratio_; | 102 return drawable_horizontal_padding_ratio_; |
101 } | 103 } |
102 | 104 |
103 } // namespace content | 105 } // namespace content |
OLD | NEW |