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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 return AX_PLATFORM_NODE_AURALINUX(atk_object); | 357 return AX_PLATFORM_NODE_AURALINUX(atk_object); |
358 } | 358 } |
359 | 359 |
360 void ax_platform_node_auralinux_detach( | 360 void ax_platform_node_auralinux_detach( |
361 AXPlatformNodeAuraLinuxObject* atk_object) { | 361 AXPlatformNodeAuraLinuxObject* atk_object) { |
362 atk_object->m_object = nullptr; | 362 atk_object->m_object = nullptr; |
363 } | 363 } |
364 | 364 |
365 G_END_DECLS | 365 G_END_DECLS |
366 | 366 |
367 // | |
368 // AXPlatformNodeAuraLinux implementation. | |
369 // | |
370 | |
371 namespace ui { | 367 namespace ui { |
372 | 368 |
373 // static | 369 // static |
374 AXPlatformNode* AXPlatformNode::Create(AXPlatformNodeDelegate* delegate) { | 370 AXPlatformNode* AXPlatformNode::Create(AXPlatformNodeDelegate* delegate) { |
375 AXPlatformNodeAuraLinux* node = new AXPlatformNodeAuraLinux(); | 371 AXPlatformNodeAuraLinux* node = new AXPlatformNodeAuraLinux(); |
376 node->Init(delegate); | 372 node->Init(delegate); |
377 return node; | 373 return node; |
378 } | 374 } |
379 | 375 |
380 // static | 376 // static |
| 377 AX_EXPORT AXPlatformNode* AXPlatformNode::FromNativeViewAccessible( |
| 378 gfx::NativeViewAccessible accessible) { |
| 379 return AtkObjectToAXPlatformNodeAuraLinux(accessible); |
| 380 } |
| 381 |
| 382 // |
| 383 // AXPlatformNodeAuraLinux implementation. |
| 384 // |
| 385 |
| 386 // static |
381 AXPlatformNode* AXPlatformNodeAuraLinux::application_ = nullptr; | 387 AXPlatformNode* AXPlatformNodeAuraLinux::application_ = nullptr; |
382 | 388 |
383 // static | 389 // static |
384 void AXPlatformNodeAuraLinux::SetApplication(AXPlatformNode* application) { | 390 void AXPlatformNodeAuraLinux::SetApplication(AXPlatformNode* application) { |
385 application_ = application; | 391 application_ = application; |
386 } | 392 } |
387 | 393 |
388 // static | 394 // static |
389 void AXPlatformNodeAuraLinux::StaticInitialize( | 395 void AXPlatformNodeAuraLinux::StaticInitialize( |
390 scoped_refptr<base::TaskRunner> init_task_runner) { | 396 scoped_refptr<base::TaskRunner> init_task_runner) { |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 | 556 |
551 void AXPlatformNodeAuraLinux::GetSize(gint* width, gint* height) { | 557 void AXPlatformNodeAuraLinux::GetSize(gint* width, gint* height) { |
552 gfx::Rect rect_size = gfx::ToEnclosingRect(GetData().location); | 558 gfx::Rect rect_size = gfx::ToEnclosingRect(GetData().location); |
553 if (width) | 559 if (width) |
554 *width = rect_size.width(); | 560 *width = rect_size.width(); |
555 if (height) | 561 if (height) |
556 *height = rect_size.height(); | 562 *height = rect_size.height(); |
557 } | 563 } |
558 | 564 |
559 } // namespace ui | 565 } // namespace ui |
OLD | NEW |