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

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

Issue 759433002: Reland: Move TouchSelectionController from content to ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Excluded ui/touch_selection from Windows GN build Created 6 years 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 #include "content/browser/android/popup_touch_handle_drawable.h" 5 #include "content/browser/android/popup_touch_handle_drawable.h"
6 6
7 #include "jni/PopupTouchHandleDrawable_jni.h" 7 #include "jni/PopupTouchHandleDrawable_jni.h"
8 8
9 namespace content { 9 namespace content {
10 10
(...skipping 12 matching lines...) Expand all
23 23
24 void PopupTouchHandleDrawable::SetEnabled(bool enabled) { 24 void PopupTouchHandleDrawable::SetEnabled(bool enabled) {
25 JNIEnv* env = base::android::AttachCurrentThread(); 25 JNIEnv* env = base::android::AttachCurrentThread();
26 if (enabled) 26 if (enabled)
27 Java_PopupTouchHandleDrawable_show(env, drawable_.obj()); 27 Java_PopupTouchHandleDrawable_show(env, drawable_.obj());
28 else 28 else
29 Java_PopupTouchHandleDrawable_hide(env, drawable_.obj()); 29 Java_PopupTouchHandleDrawable_hide(env, drawable_.obj());
30 } 30 }
31 31
32 void PopupTouchHandleDrawable::SetOrientation( 32 void PopupTouchHandleDrawable::SetOrientation(
33 TouchHandleOrientation orientation) { 33 ui::TouchHandleOrientation orientation) {
34 JNIEnv* env = base::android::AttachCurrentThread(); 34 JNIEnv* env = base::android::AttachCurrentThread();
35 jobject obj = drawable_.obj(); 35 jobject obj = drawable_.obj();
36 switch (orientation) { 36 switch (orientation) {
37 case TOUCH_HANDLE_LEFT: 37 case ui::TOUCH_HANDLE_LEFT:
38 Java_PopupTouchHandleDrawable_setLeftOrientation(env, obj); 38 Java_PopupTouchHandleDrawable_setLeftOrientation(env, obj);
39 break; 39 break;
40 40
41 case TOUCH_HANDLE_RIGHT: 41 case ui::TOUCH_HANDLE_RIGHT:
42 Java_PopupTouchHandleDrawable_setRightOrientation(env, obj); 42 Java_PopupTouchHandleDrawable_setRightOrientation(env, obj);
43 break; 43 break;
44 44
45 case TOUCH_HANDLE_CENTER: 45 case ui::TOUCH_HANDLE_CENTER:
46 Java_PopupTouchHandleDrawable_setCenterOrientation(env, obj); 46 Java_PopupTouchHandleDrawable_setCenterOrientation(env, obj);
47 break; 47 break;
48 48
49 case TOUCH_HANDLE_ORIENTATION_UNDEFINED: 49 case ui::TOUCH_HANDLE_ORIENTATION_UNDEFINED:
50 NOTREACHED() << "Invalid touch handle orientation."; 50 NOTREACHED() << "Invalid touch handle orientation.";
51 }; 51 };
52 } 52 }
53 53
54 void PopupTouchHandleDrawable::SetAlpha(float alpha) { 54 void PopupTouchHandleDrawable::SetAlpha(float alpha) {
55 JNIEnv* env = base::android::AttachCurrentThread(); 55 JNIEnv* env = base::android::AttachCurrentThread();
56 bool visible = alpha > 0; 56 bool visible = alpha > 0;
57 Java_PopupTouchHandleDrawable_setVisible(env, drawable_.obj(), visible); 57 Java_PopupTouchHandleDrawable_setVisible(env, drawable_.obj(), visible);
58 } 58 }
59 59
(...skipping 14 matching lines...) Expand all
74 rect_pix.width(), 74 rect_pix.width(),
75 rect_pix.height()); 75 rect_pix.height());
76 } 76 }
77 77
78 // static 78 // static
79 bool PopupTouchHandleDrawable::RegisterPopupTouchHandleDrawable(JNIEnv* env) { 79 bool PopupTouchHandleDrawable::RegisterPopupTouchHandleDrawable(JNIEnv* env) {
80 return RegisterNativesImpl(env); 80 return RegisterNativesImpl(env);
81 } 81 }
82 82
83 } // namespace content 83 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/android/popup_touch_handle_drawable.h ('k') | content/browser/renderer_host/input/selection_event_type.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698