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

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

Issue 2217363002: Use relative bounding boxes throughout Chrome accessibility (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback from aboxhall Created 4 years, 4 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 (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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_auralinux.h" 5 #include "content/browser/accessibility/browser_accessibility_auralinux.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 gint y, 137 gint y,
138 AtkCoordType coord_type) { 138 AtkCoordType coord_type) {
139 g_return_val_if_fail(ATK_IS_COMPONENT(atk_component), 0); 139 g_return_val_if_fail(ATK_IS_COMPONENT(atk_component), 0);
140 140
141 BrowserAccessibilityAuraLinux* obj = 141 BrowserAccessibilityAuraLinux* obj =
142 ToBrowserAccessibilityAuraLinux(atk_component); 142 ToBrowserAccessibilityAuraLinux(atk_component);
143 if (!obj) 143 if (!obj)
144 return NULL; 144 return NULL;
145 145
146 gfx::Point point(x, y); 146 gfx::Point point(x, y);
147 if (!obj->GetGlobalBoundsRect().Contains(point)) 147 if (!obj->GetScreenBoundsRect().Contains(point))
148 return NULL; 148 return NULL;
149 149
150 BrowserAccessibility* result = obj->BrowserAccessibilityForPoint(point); 150 BrowserAccessibility* result = obj->BrowserAccessibilityForPoint(point);
151 if (!result) 151 if (!result)
152 return NULL; 152 return NULL;
153 153
154 AtkObject* atk_result = 154 AtkObject* atk_result =
155 ToBrowserAccessibilityAuraLinux(result)->GetAtkObject(); 155 ToBrowserAccessibilityAuraLinux(result)->GetAtkObject();
156 g_object_ref(atk_result); 156 g_object_ref(atk_result);
157 return atk_result; 157 return atk_result;
158 } 158 }
159 159
160 static void browser_accessibility_get_extents(AtkComponent* atk_component, 160 static void browser_accessibility_get_extents(AtkComponent* atk_component,
161 gint* x, 161 gint* x,
162 gint* y, 162 gint* y,
163 gint* width, 163 gint* width,
164 gint* height, 164 gint* height,
165 AtkCoordType coord_type) { 165 AtkCoordType coord_type) {
166 g_return_if_fail(ATK_IS_COMPONENT(atk_component)); 166 g_return_if_fail(ATK_IS_COMPONENT(atk_component));
167 167
168 BrowserAccessibilityAuraLinux* obj = 168 BrowserAccessibilityAuraLinux* obj =
169 ToBrowserAccessibilityAuraLinux(atk_component); 169 ToBrowserAccessibilityAuraLinux(atk_component);
170 if (!obj) 170 if (!obj)
171 return; 171 return;
172 172
173 gfx::Rect bounds = obj->GetGlobalBoundsRect(); 173 gfx::Rect bounds = obj->GetScreenBoundsRect();
174 if (x) 174 if (x)
175 *x = bounds.x(); 175 *x = bounds.x();
176 if (y) 176 if (y)
177 *y = bounds.y(); 177 *y = bounds.y();
178 if (width) 178 if (width)
179 *width = bounds.width(); 179 *width = bounds.width();
180 if (height) 180 if (height)
181 *height = bounds.height(); 181 *height = bounds.height();
182 } 182 }
183 183
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 return NULL; 293 return NULL;
294 294
295 return ToBrowserAccessibilityAuraLinux(BROWSER_ACCESSIBILITY(atk_img)); 295 return ToBrowserAccessibilityAuraLinux(BROWSER_ACCESSIBILITY(atk_img));
296 } 296 }
297 297
298 void GetImagePositionSize(BrowserAccessibilityAuraLinux* obj, 298 void GetImagePositionSize(BrowserAccessibilityAuraLinux* obj,
299 gint* x, 299 gint* x,
300 gint* y, 300 gint* y,
301 gint* width, 301 gint* width,
302 gint* height) { 302 gint* height) {
303 gfx::Rect img_pos_size = obj->GetGlobalBoundsRect(); 303 gfx::Rect img_pos_size = obj->GetScreenBoundsRect();
304 304
305 if (x) 305 if (x)
306 *x = img_pos_size.x(); 306 *x = img_pos_size.x();
307 if (y) 307 if (y)
308 *y = img_pos_size.y(); 308 *y = img_pos_size.y();
309 if (width) 309 if (width)
310 *width = img_pos_size.width(); 310 *width = img_pos_size.width();
311 if (height) 311 if (height)
312 *height = img_pos_size.height(); 312 *height = img_pos_size.height();
313 } 313 }
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
934 case ui::AX_ROLE_TREE_ITEM: 934 case ui::AX_ROLE_TREE_ITEM:
935 atk_role_ = ATK_ROLE_TREE_ITEM; 935 atk_role_ = ATK_ROLE_TREE_ITEM;
936 break; 936 break;
937 default: 937 default:
938 atk_role_ = ATK_ROLE_UNKNOWN; 938 atk_role_ = ATK_ROLE_UNKNOWN;
939 break; 939 break;
940 } 940 }
941 } 941 }
942 942
943 } // namespace content 943 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698