1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_HTML_VIEWER_AX_PROVIDER_IMPL_H_
6 #define COMPONENTS_HTML_VIEWER_AX_PROVIDER_IMPL_H_
8 #include "base/basictypes.h"
9 #include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h"
10 #include "third_party/mojo_services/src/accessibility/public/interfaces/accessibility.mojom.h"
17 namespace html_viewer
{
19 // Caller must ensure that |web_view| outlives AxProviderImpl.
20 class AxProviderImpl
: public mojo::AxProvider
{
22 AxProviderImpl(blink::WebView
* web_view
,
23 mojo::InterfaceRequest
<mojo::AxProvider
> request
);
24 ~AxProviderImpl() override
;
25 void GetTree(const mojo::Callback
<void(mojo::Array
<mojo::AxNodePtr
> nodes
)>&
29 int Populate(const blink::WebAXObject
& ax_object
,
32 mojo::Array
<mojo::AxNodePtr
>* result
);
33 mojo::AxNodePtr
ConvertAxNode(const blink::WebAXObject
& ax_object
,
37 blink::WebView
* web_view_
;
38 mojo::Binding
<mojo::AxProvider
> binding_
;
40 DISALLOW_COPY_AND_ASSIGN(AxProviderImpl
);
43 } // namespace html_viewer
45 #endif // COMPONENTS_HTML_VIEWER_AX_PROVIDER_IMPL_H_