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

Side by Side Diff: content/browser/accessibility/web_contents_accessibility_android.cc

Issue 2934953004: De-templatize ui::AXPosition
Patch Set: Fix Android? Created 3 years, 6 months 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/web_contents_accessibility_android.h" 5 #include "content/browser/accessibility/web_contents_accessibility_android.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/feature_list.h" 9 #include "base/feature_list.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 *node, base::android::ConvertJavaStringToUTF16(env, value)); 811 *node, base::android::ConvertJavaStringToUTF16(env, value));
812 } 812 }
813 } 813 }
814 814
815 void WebContentsAccessibilityAndroid::SetSelection( 815 void WebContentsAccessibilityAndroid::SetSelection(
816 JNIEnv* env, 816 JNIEnv* env,
817 const JavaParamRef<jobject>& obj, 817 const JavaParamRef<jobject>& obj,
818 jint unique_id, 818 jint unique_id,
819 jint start, 819 jint start,
820 jint end) { 820 jint end) {
821 using AXPlatformPositionInstance = AXPlatformPosition::AXPositionInstance; 821 using AXPlatformPositionInstance = AXPlatformPosition::ConcreteInstance;
822 using AXPlatformRange = ui::AXRange<AXPlatformPositionInstance::element_type>; 822 using AXPlatformRange = ui::AXRange<AXPlatformPositionInstance::element_type>;
823 823
824 BrowserAccessibilityAndroid* node = GetAXFromUniqueID(unique_id); 824 BrowserAccessibilityAndroid* node = GetAXFromUniqueID(unique_id);
825 if (node) { 825 if (node) {
826 node->manager()->SetSelection(AXPlatformRange(node->CreatePositionAt(start), 826 node->manager()->SetSelection(AXPlatformRange(node->CreatePositionAt(start),
827 node->CreatePositionAt(end))); 827 node->CreatePositionAt(end)));
828 } 828 }
829 } 829 }
830 830
831 jboolean WebContentsAccessibilityAndroid::AdjustSlider( 831 jboolean WebContentsAccessibilityAndroid::AdjustSlider(
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
1157 const JavaParamRef<jobject>& jweb_contents, 1157 const JavaParamRef<jobject>& jweb_contents,
1158 jboolean should_focus_on_page_load) { 1158 jboolean should_focus_on_page_load) {
1159 WebContents* web_contents = WebContents::FromJavaWebContents(jweb_contents); 1159 WebContents* web_contents = WebContents::FromJavaWebContents(jweb_contents);
1160 DCHECK(web_contents); 1160 DCHECK(web_contents);
1161 1161
1162 return reinterpret_cast<intptr_t>(new WebContentsAccessibilityAndroid( 1162 return reinterpret_cast<intptr_t>(new WebContentsAccessibilityAndroid(
1163 env, obj, web_contents, should_focus_on_page_load)); 1163 env, obj, web_contents, should_focus_on_page_load));
1164 } 1164 }
1165 1165
1166 } // namespace content 1166 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698