Skip to content

Commit

Permalink
Allow Linux builds using Ozone to rely on default Create() methods.
Browse files Browse the repository at this point in the history
Linux builds using Aura and Ozone (i.e. Chromecast) must be able to use
the non-x11 implementations of ui::AXPlatformNode::Create() and
ui::NativeViewAccessibility::Create(). Modify the gaurds around the
default implementations of these to account for this type of build.

BUG=

Review URL: https://codereview.chromium.org/1465453002

Cr-Commit-Position: refs/heads/master@{#360870}
  • Loading branch information
slan authored and Commit bot committed Nov 20, 2015
1 parent 53bf8ec commit 43c4ea7
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ui/accessibility/platform/ax_platform_node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

namespace ui {

#if !defined(OS_MACOSX) && !defined(OS_WIN) && !(defined(OS_LINUX) && !defined(OS_CHROMEOS))
#if !defined(PLATFORM_HAS_AX_PLATFORM_NODE_IMPL)
// static
AXPlatformNode* AXPlatformNode::Create(AXPlatformNodeDelegate* delegate) {
return nullptr;
}
#endif
#endif // !defined(PLATFORM_HAS_AX_PLATFORM_NODE_IMPL)

#if !defined(OS_WIN)
// This is the default implementation for platforms where native views
Expand Down
16 changes: 16 additions & 0 deletions ui/accessibility/platform/ax_platform_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,22 @@
#include "ui/accessibility/ax_export.h"
#include "ui/gfx/native_widget_types.h"

// Set PLATFORM_HAS_AX_PLATFORM_NODE_IMPL if this platform has a specific
// implementation of AxPlatfromNode::Create().
#undef PLATFORM_HAS_AX_PLATFORM_NODE_IMPL

#if defined(OS_WIN)
#define PLATFORM_HAS_AX_PLATFORM_NODE_IMPL 1
#endif

#if defined(OS_MACOSX)
#define PLATFORM_HAS_AX_PLATFORM_NODE_IMPL 1
#endif

#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(USE_X11)
#define PLATFORM_HAS_AX_PLATFORM_NODE_IMPL 1
#endif

namespace ui {

class AXPlatformNodeDelegate;
Expand Down
4 changes: 2 additions & 2 deletions ui/views/accessibility/native_view_accessibility.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@

namespace views {

#if !defined(OS_WIN) && !(defined(OS_LINUX) && !defined(OS_CHROMEOS))
#if !defined(PLATFORM_HAS_NATIVE_VIEW_ACCESSIBILITY_IMPL)
// static
NativeViewAccessibility* NativeViewAccessibility::Create(View* view) {
return new NativeViewAccessibility(view);
}
#endif
#endif // !defined(PLATFORM_HAS_NATIVE_VIEW_ACCESSIBILITY_IMPL)

NativeViewAccessibility::NativeViewAccessibility(View* view)
: view_(view),
Expand Down
12 changes: 12 additions & 0 deletions ui/views/accessibility/native_view_accessibility.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@
#include "ui/views/views_export.h"
#include "ui/views/widget/widget_observer.h"

// Set PLATFORM_HAS_NATIVE_VIEW_ACCESSIBILITY_IMPL if this platform has a
// specific implementation of NativeViewAccessibility::Create().
#undef PLATFORM_HAS_NATIVE_VIEW_ACCESSIBILITY_IMPL

#if defined(OS_WIN)
#define PLATFORM_HAS_NATIVE_VIEW_ACCESSIBILITY_IMPL 1
#endif

#if defined(OS_LINUX) && defined(USE_X11) && !defined(OS_CHROMEOS)
#define PLATFORM_HAS_NATIVE_VIEW_ACCESSIBILITY_IMPL 1
#endif

namespace views {

class View;
Expand Down

0 comments on commit 43c4ea7

Please sign in to comment.