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

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

Issue 1049013004: Add some simple HTMLViewer apptests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Continue cleanup. Created 5 years, 8 months 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_H_ 5 #ifndef MOJO_SERVICES_HTML_VIEWER_HTML_DOCUMENT_H_
6 #define MOJO_SERVICES_HTML_VIEWER_HTML_DOCUMENT_H_ 6 #define MOJO_SERVICES_HTML_VIEWER_HTML_DOCUMENT_H_
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 // A view for a single HTML document. 48 // A view for a single HTML document.
49 class HTMLDocument : public blink::WebViewClient, 49 class HTMLDocument : public blink::WebViewClient,
50 public blink::WebFrameClient, 50 public blink::WebFrameClient,
51 public mojo::ViewManagerDelegate, 51 public mojo::ViewManagerDelegate,
52 public mojo::ViewObserver, 52 public mojo::ViewObserver,
53 public mojo::InterfaceFactory<mojo::AxProvider> { 53 public mojo::InterfaceFactory<mojo::AxProvider> {
54 public: 54 public:
55 // Load a new HTMLDocument with |response|. 55 // Load a new HTMLDocument with |response|.
56 // 56 //
57 // |services| should be used to implement a ServiceProvider which exposes 57 // Services are offered to the connecting application via |service_provider|.
58 // services to the connecting application.
59 // Commonly, the connecting application is the ViewManager and it will 58 // Commonly, the connecting application is the ViewManager and it will
60 // request ViewManagerClient. 59 // request ViewManagerClient.
61 // 60 //
62 // |shell| is the Shell connection for this mojo::Application. 61 // |shell| is the Shell connection for this mojo::Application.
63 HTMLDocument(mojo::InterfaceRequest<mojo::ServiceProvider> services, 62 HTMLDocument(mojo::ServiceProviderImpl* service_provider,
64 mojo::URLResponsePtr response, 63 mojo::URLResponsePtr response,
65 mojo::Shell* shell, 64 mojo::Shell* shell,
66 scoped_refptr<base::MessageLoopProxy> compositor_thread, 65 scoped_refptr<base::MessageLoopProxy> compositor_thread,
67 WebMediaPlayerFactory* web_media_player_factory, 66 WebMediaPlayerFactory* web_media_player_factory,
68 bool is_headless); 67 bool is_headless);
69 virtual ~HTMLDocument(); 68 virtual ~HTMLDocument();
70 69
71 private: 70 private:
72 // Updates the size and scale factor of the webview and related classes from 71 // Updates the size and scale factor of the webview and related classes from
73 // |root_|. 72 // |root_|.
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 void OnViewDestroyed(mojo::View* view) override; 124 void OnViewDestroyed(mojo::View* view) override;
126 void OnViewInputEvent(mojo::View* view, const mojo::EventPtr& event) override; 125 void OnViewInputEvent(mojo::View* view, const mojo::EventPtr& event) override;
127 126
128 // InterfaceFactory<AxProvider> 127 // InterfaceFactory<AxProvider>
129 void Create(mojo::ApplicationConnection* connection, 128 void Create(mojo::ApplicationConnection* connection,
130 mojo::InterfaceRequest<mojo::AxProvider> request) override; 129 mojo::InterfaceRequest<mojo::AxProvider> request) override;
131 130
132 void Load(mojo::URLResponsePtr response); 131 void Load(mojo::URLResponsePtr response);
133 132
134 mojo::URLResponsePtr response_; 133 mojo::URLResponsePtr response_;
135 mojo::ServiceProviderImpl exported_services_;
136 mojo::ServiceProviderPtr embedder_service_provider_; 134 mojo::ServiceProviderPtr embedder_service_provider_;
137 mojo::Shell* shell_; 135 mojo::Shell* shell_;
138 mojo::LazyInterfacePtr<mojo::NavigatorHost> navigator_host_; 136 mojo::LazyInterfacePtr<mojo::NavigatorHost> navigator_host_;
139 blink::WebView* web_view_; 137 blink::WebView* web_view_;
140 mojo::View* root_; 138 mojo::View* root_;
141 mojo::ViewManagerClientFactory view_manager_client_factory_; 139 mojo::ViewManagerClientFactory view_manager_client_factory_;
142 scoped_ptr<WebLayerTreeViewImpl> web_layer_tree_view_impl_; 140 scoped_ptr<WebLayerTreeViewImpl> web_layer_tree_view_impl_;
143 scoped_refptr<base::MessageLoopProxy> compositor_thread_; 141 scoped_refptr<base::MessageLoopProxy> compositor_thread_;
144 WebMediaPlayerFactory* web_media_player_factory_; 142 WebMediaPlayerFactory* web_media_player_factory_;
145 143
146 // EncryptedMediaClient attached to this frame; lazily initialized. 144 // EncryptedMediaClient attached to this frame; lazily initialized.
147 scoped_ptr<media::WebEncryptedMediaClientImpl> web_encrypted_media_client_; 145 scoped_ptr<media::WebEncryptedMediaClientImpl> web_encrypted_media_client_;
148 scoped_ptr<media::MediaPermission> media_permission_; 146 scoped_ptr<media::MediaPermission> media_permission_;
149 147
150 // HTMLDocument owns these pointers. 148 // HTMLDocument owns these pointers.
151 std::set<AxProviderImpl*> ax_provider_impls_; 149 std::set<AxProviderImpl*> ax_provider_impls_;
152 150
153 // Set if the content will never be displayed. 151 // Set if the content will never be displayed.
154 bool is_headless_; 152 bool is_headless_;
155 153
156 DISALLOW_COPY_AND_ASSIGN(HTMLDocument); 154 DISALLOW_COPY_AND_ASSIGN(HTMLDocument);
157 }; 155 };
158 156
159 } // namespace html_viewer 157 } // namespace html_viewer
160 158
161 #endif // MOJO_SERVICES_HTML_VIEWER_HTML_DOCUMENT_H_ 159 #endif // MOJO_SERVICES_HTML_VIEWER_HTML_DOCUMENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698