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

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

Issue 2860883003: A11y: Add/refactor methods for manipulating bitfields on AXNodeData. (Closed)
Patch Set: Delete AXNodeData::Init() and clear bitfields in AXNodeData() instead. Created 3 years, 7 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 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 Java_BrowserAccessibilityManager_onNativeObjectDestroyed( 184 Java_BrowserAccessibilityManager_onNativeObjectDestroyed(
185 env, obj, reinterpret_cast<intptr_t>(this)); 185 env, obj, reinterpret_cast<intptr_t>(this));
186 } 186 }
187 187
188 // static 188 // static
189 ui::AXTreeUpdate 189 ui::AXTreeUpdate
190 BrowserAccessibilityManagerAndroid::GetEmptyDocument() { 190 BrowserAccessibilityManagerAndroid::GetEmptyDocument() {
191 ui::AXNodeData empty_document; 191 ui::AXNodeData empty_document;
192 empty_document.id = 0; 192 empty_document.id = 0;
193 empty_document.role = ui::AX_ROLE_ROOT_WEB_AREA; 193 empty_document.role = ui::AX_ROLE_ROOT_WEB_AREA;
194 empty_document.state = 1 << ui::AX_STATE_READ_ONLY; 194 empty_document.AddState(ui::AX_STATE_READ_ONLY);
195 195
196 ui::AXTreeUpdate update; 196 ui::AXTreeUpdate update;
197 update.root_id = empty_document.id; 197 update.root_id = empty_document.id;
198 update.nodes.push_back(empty_document); 198 update.nodes.push_back(empty_document);
199 return update; 199 return update;
200 } 200 }
201 201
202 void BrowserAccessibilityManagerAndroid::SetContentViewCore( 202 void BrowserAccessibilityManagerAndroid::SetContentViewCore(
203 ScopedJavaLocalRef<jobject> content_view_core) { 203 ScopedJavaLocalRef<jobject> content_view_core) {
204 if (content_view_core.is_null()) 204 if (content_view_core.is_null())
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after
984 return; 984 return;
985 } 985 }
986 986
987 DeleteAutofillPopupProxy(); 987 DeleteAutofillPopupProxy();
988 988
989 g_autofill_popup_proxy_node = BrowserAccessibility::Create(); 989 g_autofill_popup_proxy_node = BrowserAccessibility::Create();
990 g_autofill_popup_proxy_node_ax_node = new ui::AXNode(nullptr, -1, -1); 990 g_autofill_popup_proxy_node_ax_node = new ui::AXNode(nullptr, -1, -1);
991 ui::AXNodeData ax_node_data; 991 ui::AXNodeData ax_node_data;
992 ax_node_data.role = ui::AX_ROLE_MENU; 992 ax_node_data.role = ui::AX_ROLE_MENU;
993 ax_node_data.SetName("Autofill"); 993 ax_node_data.SetName("Autofill");
994 ax_node_data.state = 1 << ui::AX_STATE_READ_ONLY; 994 ax_node_data.AddState(ui::AX_STATE_READ_ONLY);
995 ax_node_data.state |= 1 << ui::AX_STATE_FOCUSABLE; 995 ax_node_data.AddState(ui::AX_STATE_FOCUSABLE);
996 ax_node_data.state |= 1 << ui::AX_STATE_SELECTABLE; 996 ax_node_data.AddState(ui::AX_STATE_SELECTABLE);
997 g_autofill_popup_proxy_node_ax_node->SetData(ax_node_data); 997 g_autofill_popup_proxy_node_ax_node->SetData(ax_node_data);
998 g_autofill_popup_proxy_node->Init(this, g_autofill_popup_proxy_node_ax_node); 998 g_autofill_popup_proxy_node->Init(this, g_autofill_popup_proxy_node_ax_node);
999 999
1000 g_element_hosting_autofill_popup_unique_id = current_focus->unique_id(); 1000 g_element_hosting_autofill_popup_unique_id = current_focus->unique_id();
1001 } 1001 }
1002 1002
1003 void BrowserAccessibilityManagerAndroid::OnAutofillPopupDismissed( 1003 void BrowserAccessibilityManagerAndroid::OnAutofillPopupDismissed(
1004 JNIEnv* env, 1004 JNIEnv* env,
1005 const JavaParamRef<jobject>& obj) { 1005 const JavaParamRef<jobject>& obj) {
1006 g_element_hosting_autofill_popup_unique_id = -1; 1006 g_element_hosting_autofill_popup_unique_id = -1;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
1080 1080
1081 JNIEnv* env = AttachCurrentThread(); 1081 JNIEnv* env = AttachCurrentThread();
1082 return root_manager->java_ref().get(env); 1082 return root_manager->java_ref().get(env);
1083 } 1083 }
1084 1084
1085 bool RegisterBrowserAccessibilityManager(JNIEnv* env) { 1085 bool RegisterBrowserAccessibilityManager(JNIEnv* env) {
1086 return RegisterNativesImpl(env); 1086 return RegisterNativesImpl(env);
1087 } 1087 }
1088 1088
1089 } // namespace content 1089 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698