Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "ui/accessibility/platform/ax_platform_node_auralinux.h" | 5 #include "ui/accessibility/platform/ax_platform_node_auralinux.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/strings/sys_string_conversions.h" | 8 #include "base/strings/sys_string_conversions.h" |
| 9 #include "base/task_runner.h" | 9 #include "base/task_runner.h" |
| 10 #include "ui/accessibility/ax_node_data.h" | 10 #include "ui/accessibility/ax_node_data.h" |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 183 return atk_state_set; | 183 return atk_state_set; |
| 184 } | 184 } |
| 185 | 185 |
| 186 // | 186 // |
| 187 // AtkComponent interface | 187 // AtkComponent interface |
| 188 // | 188 // |
| 189 | 189 |
| 190 static gfx::Point FindAtkObjectParentCoords(AtkObject* atk_object) { | 190 static gfx::Point FindAtkObjectParentCoords(AtkObject* atk_object) { |
| 191 if (atk_object_get_role(atk_object) == ATK_ROLE_WINDOW) { | 191 if (atk_object_get_role(atk_object) == ATK_ROLE_WINDOW) { |
| 192 int x, y; | 192 int x, y; |
| 193 #if ATK_CHECK_VERSION(2, 12, 0) | |
| 194 atk_component_get_extents(ATK_COMPONENT(atk_object), | |
|
Adam Goode
2015/05/05 01:28:18
Just use atk_component_get_extents. It is present
| |
| 195 &x, &y, nullptr, nullptr, ATK_XY_WINDOW); | |
| 196 #else | |
| 193 atk_component_get_position(ATK_COMPONENT(atk_object), | 197 atk_component_get_position(ATK_COMPONENT(atk_object), |
| 194 &x, &y, ATK_XY_WINDOW); | 198 &x, &y, ATK_XY_WINDOW); |
| 199 #endif | |
| 195 gfx::Point window_coords(x, y); | 200 gfx::Point window_coords(x, y); |
| 196 return window_coords; | 201 return window_coords; |
| 197 } | 202 } |
| 198 atk_object = atk_object_get_parent(atk_object); | 203 atk_object = atk_object_get_parent(atk_object); |
| 199 | 204 |
| 200 return FindAtkObjectParentCoords(atk_object); | 205 return FindAtkObjectParentCoords(atk_object); |
| 201 } | 206 } |
| 202 | 207 |
| 203 static void ax_platform_node_auralinux_get_extents(AtkComponent* atk_component, | 208 static void ax_platform_node_auralinux_get_extents(AtkComponent* atk_component, |
| 204 gint* x, gint* y, | 209 gint* x, gint* y, |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 498 } | 503 } |
| 499 } | 504 } |
| 500 | 505 |
| 501 void AXPlatformNodeAuraLinux::GetSize(gint* width, gint* height) { | 506 void AXPlatformNodeAuraLinux::GetSize(gint* width, gint* height) { |
| 502 gfx::Rect rect_size = GetData().location; | 507 gfx::Rect rect_size = GetData().location; |
| 503 *width = rect_size.width(); | 508 *width = rect_size.width(); |
| 504 *height = rect_size.height(); | 509 *height = rect_size.height(); |
| 505 } | 510 } |
| 506 | 511 |
| 507 } // namespace ui | 512 } // namespace ui |
| OLD | NEW |