| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/accessibility/browser_accessibility_manager_android.h" | 5 #include "content/browser/accessibility/browser_accessibility_manager_android.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 | 10 |
| (...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 value += (increment ? delta : -delta); | 687 value += (increment ? delta : -delta); |
| 688 value = std::max(std::min(value, max), min); | 688 value = std::max(std::min(value, max), min); |
| 689 if (value != original_value) { | 689 if (value != original_value) { |
| 690 node->manager()->SetValue( | 690 node->manager()->SetValue( |
| 691 *node, base::UTF8ToUTF16(base::DoubleToString(value))); | 691 *node, base::UTF8ToUTF16(base::DoubleToString(value))); |
| 692 return true; | 692 return true; |
| 693 } | 693 } |
| 694 return false; | 694 return false; |
| 695 } | 695 } |
| 696 | 696 |
| 697 void BrowserAccessibilityManagerAndroid::ShowContextMenu( |
| 698 JNIEnv* env, |
| 699 const JavaParamRef<jobject>& obj, |
| 700 jint id) { |
| 701 BrowserAccessibilityAndroid* node = GetFromUniqueID(id); |
| 702 if (node && node->manager()->delegate()) |
| 703 node->manager()->delegate()->AccessibilityShowContextMenu(node->GetId()); |
| 704 } |
| 705 |
| 697 void BrowserAccessibilityManagerAndroid::HandleHoverEvent( | 706 void BrowserAccessibilityManagerAndroid::HandleHoverEvent( |
| 698 BrowserAccessibility* node) { | 707 BrowserAccessibility* node) { |
| 699 JNIEnv* env = AttachCurrentThread(); | 708 JNIEnv* env = AttachCurrentThread(); |
| 700 ScopedJavaLocalRef<jobject> obj = GetJavaRefFromRootManager(); | 709 ScopedJavaLocalRef<jobject> obj = GetJavaRefFromRootManager(); |
| 701 if (obj.is_null()) | 710 if (obj.is_null()) |
| 702 return; | 711 return; |
| 703 | 712 |
| 704 BrowserAccessibilityAndroid* ancestor = | 713 BrowserAccessibilityAndroid* ancestor = |
| 705 static_cast<BrowserAccessibilityAndroid*>(node->GetParent()); | 714 static_cast<BrowserAccessibilityAndroid*>(node->GetParent()); |
| 706 while (ancestor && ancestor != GetRoot()) { | 715 while (ancestor && ancestor != GetRoot()) { |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 968 | 977 |
| 969 JNIEnv* env = AttachCurrentThread(); | 978 JNIEnv* env = AttachCurrentThread(); |
| 970 return root_manager->java_ref().get(env); | 979 return root_manager->java_ref().get(env); |
| 971 } | 980 } |
| 972 | 981 |
| 973 bool RegisterBrowserAccessibilityManager(JNIEnv* env) { | 982 bool RegisterBrowserAccessibilityManager(JNIEnv* env) { |
| 974 return RegisterNativesImpl(env); | 983 return RegisterNativesImpl(env); |
| 975 } | 984 } |
| 976 | 985 |
| 977 } // namespace content | 986 } // namespace content |
| OLD | NEW |