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

Side by Side Diff: mojo/services/html_viewer/html_document_view.h

Issue 710803002: Beginning of an accessibility implementation for html_viewer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup, rebase Created 6 years, 1 month 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 2014 The Chromium Authors. All rights reserved. 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 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 #ifndef MOJO_SERVICES_HTML_VIEWER_HTML_DOCUMENT_VIEW_H_ 5 #ifndef MOJO_SERVICES_HTML_VIEWER_HTML_DOCUMENT_VIEW_H_
6 #define MOJO_SERVICES_HTML_VIEWER_HTML_DOCUMENT_VIEW_H_ 6 #define MOJO_SERVICES_HTML_VIEWER_HTML_DOCUMENT_VIEW_H_
7 7
8 #include <set>
9
8 #include "base/macros.h" 10 #include "base/macros.h"
9 #include "base/memory/weak_ptr.h" 11 #include "mojo/public/cpp/application/interface_factory.h"
10 #include "mojo/public/cpp/application/lazy_interface_ptr.h" 12 #include "mojo/public/cpp/application/lazy_interface_ptr.h"
11 #include "mojo/public/cpp/application/service_provider_impl.h" 13 #include "mojo/public/cpp/application/service_provider_impl.h"
12 #include "mojo/public/cpp/bindings/interface_impl.h" 14 #include "mojo/public/cpp/bindings/interface_impl.h"
13 #include "mojo/public/interfaces/application/application.mojom.h" 15 #include "mojo/public/interfaces/application/application.mojom.h"
16 #include "mojo/services/html_viewer/ax_provider_impl.h"
14 #include "mojo/services/public/cpp/view_manager/view_manager_client_factory.h" 17 #include "mojo/services/public/cpp/view_manager/view_manager_client_factory.h"
15 #include "mojo/services/public/cpp/view_manager/view_manager_delegate.h" 18 #include "mojo/services/public/cpp/view_manager/view_manager_delegate.h"
16 #include "mojo/services/public/cpp/view_manager/view_observer.h" 19 #include "mojo/services/public/cpp/view_manager/view_observer.h"
17 #include "mojo/services/public/interfaces/content_handler/content_handler.mojom. h" 20 #include "mojo/services/public/interfaces/content_handler/content_handler.mojom. h"
18 #include "mojo/services/public/interfaces/navigation/navigation.mojom.h" 21 #include "mojo/services/public/interfaces/navigation/navigation.mojom.h"
19 #include "mojo/services/public/interfaces/network/url_loader.mojom.h" 22 #include "mojo/services/public/interfaces/network/url_loader.mojom.h"
20 #include "third_party/WebKit/public/web/WebFrameClient.h" 23 #include "third_party/WebKit/public/web/WebFrameClient.h"
21 #include "third_party/WebKit/public/web/WebViewClient.h" 24 #include "third_party/WebKit/public/web/WebViewClient.h"
22 25
23 namespace base { 26 namespace base {
24 class MessageLoopProxy; 27 class MessageLoopProxy;
25 } 28 }
26 29
27 namespace mojo { 30 namespace mojo {
28 31
32 class AxProviderImpl;
29 class WebMediaPlayerFactory; 33 class WebMediaPlayerFactory;
30 class ViewManager; 34 class ViewManager;
31 class View; 35 class View;
32 class WebLayerTreeViewImpl; 36 class WebLayerTreeViewImpl;
33 37
34 // A view for a single HTML document. 38 // A view for a single HTML document.
35 class HTMLDocumentView : public mojo::InterfaceImpl<mojo::Application>, 39 class HTMLDocumentView : public mojo::InterfaceImpl<mojo::Application>,
36 public blink::WebViewClient, 40 public blink::WebViewClient,
37 public blink::WebFrameClient, 41 public blink::WebFrameClient,
38 public ViewManagerDelegate, 42 public ViewManagerDelegate,
39 public ViewObserver { 43 public ViewObserver,
44 public InterfaceFactory<AxProvider> {
40 public: 45 public:
41 // Load a new HTMLDocument with |response|. 46 // Load a new HTMLDocument with |response|.
42 // 47 //
43 // |service_provider_request| should be used to implement a 48 // |service_provider_request| should be used to implement a
44 // ServiceProvider which exposes services to the connecting application. 49 // ServiceProvider which exposes services to the connecting application.
45 // Commonly, the connecting application is the ViewManager and it will 50 // Commonly, the connecting application is the ViewManager and it will
46 // request ViewManagerClient. 51 // request ViewManagerClient.
47 // 52 //
48 // |shell| is the Shell connection for this mojo::Application. 53 // |shell| is the Shell connection for this mojo::Application.
49 HTMLDocumentView(URLResponsePtr response, 54 HTMLDocumentView(URLResponsePtr response,
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 scoped_ptr<ServiceProvider> embedder_service_provider) override; 105 scoped_ptr<ServiceProvider> embedder_service_provider) override;
101 void OnViewManagerDisconnected(ViewManager* view_manager) override; 106 void OnViewManagerDisconnected(ViewManager* view_manager) override;
102 107
103 // ViewObserver methods: 108 // ViewObserver methods:
104 void OnViewBoundsChanged(View* view, 109 void OnViewBoundsChanged(View* view,
105 const Rect& old_bounds, 110 const Rect& old_bounds,
106 const Rect& new_bounds) override; 111 const Rect& new_bounds) override;
107 void OnViewDestroyed(View* view) override; 112 void OnViewDestroyed(View* view) override;
108 void OnViewInputEvent(View* view, const EventPtr& event) override; 113 void OnViewInputEvent(View* view, const EventPtr& event) override;
109 114
115 // InterfaceFactory<AxProvider>
116 void Create(ApplicationConnection* connection,
117 InterfaceRequest<AxProvider> request) override;
118
110 void Load(URLResponsePtr response); 119 void Load(URLResponsePtr response);
111 120
112 URLResponsePtr response_; 121 URLResponsePtr response_;
113 ServiceProviderImpl exported_services_; 122 ServiceProviderImpl exported_services_;
114 scoped_ptr<ServiceProvider> embedder_service_provider_; 123 scoped_ptr<ServiceProvider> embedder_service_provider_;
115 ShellPtr shell_; 124 ShellPtr shell_;
116 LazyInterfacePtr<NavigatorHost> navigator_host_; 125 LazyInterfacePtr<NavigatorHost> navigator_host_;
117 blink::WebView* web_view_; 126 blink::WebView* web_view_;
118 View* root_; 127 View* root_;
119 ViewManagerClientFactory view_manager_client_factory_; 128 ViewManagerClientFactory view_manager_client_factory_;
120 scoped_ptr<WebLayerTreeViewImpl> web_layer_tree_view_impl_; 129 scoped_ptr<WebLayerTreeViewImpl> web_layer_tree_view_impl_;
121 scoped_refptr<base::MessageLoopProxy> compositor_thread_; 130 scoped_refptr<base::MessageLoopProxy> compositor_thread_;
122 WebMediaPlayerFactory* web_media_player_factory_; 131 WebMediaPlayerFactory* web_media_player_factory_;
123 132
124 base::WeakPtrFactory<HTMLDocumentView> weak_factory_; 133 // HTMLDocumentView owns these pointers.
134 std::set<AxProviderImpl*> ax_provider_impls_;
abarth-chromium 2014/11/10 00:33:04 There's no set equivalent for ScopedVector in base
Aaron Boodman 2014/11/10 07:05:53 nope.
135
125 DISALLOW_COPY_AND_ASSIGN(HTMLDocumentView); 136 DISALLOW_COPY_AND_ASSIGN(HTMLDocumentView);
126 }; 137 };
127 138
128 } // namespace mojo 139 } // namespace mojo
129 140
130 #endif // MOJO_SERVICES_HTML_VIEWER_HTML_DOCUMENT_VIEW_H_ 141 #endif // MOJO_SERVICES_HTML_VIEWER_HTML_DOCUMENT_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698