OLD | NEW |
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 #include "components/html_viewer/html_document.h" | 5 #include "components/html_viewer/html_document.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 // TODO(jam): pass referrer and other HTTP data to NavigatorHost so we can | 102 // TODO(jam): pass referrer and other HTTP data to NavigatorHost so we can |
103 // use a new process in this case. | 103 // use a new process in this case. |
104 if (!request.httpHeaderField(blink::WebString::fromUTF8("Referer")).isEmpty()) | 104 if (!request.httpHeaderField(blink::WebString::fromUTF8("Referer")).isEmpty()) |
105 return true; | 105 return true; |
106 | 106 |
107 // Otherwise we don't know if we're the right app to handle this request. Ask | 107 // Otherwise we don't know if we're the right app to handle this request. Ask |
108 // host to do the navigation for us. | 108 // host to do the navigation for us. |
109 return false; | 109 return false; |
110 } | 110 } |
111 | 111 |
112 bool AreSecureCodecsSupported() { | |
113 // Hardware-secure codecs are not currently supported by HTML Viewer on any | |
114 // platform. | |
115 return false; | |
116 } | |
117 | |
118 } // namespace | 112 } // namespace |
119 | 113 |
120 HTMLDocument::HTMLDocument( | 114 HTMLDocument::HTMLDocument( |
121 mojo::InterfaceRequest<mojo::ServiceProvider> services, | 115 mojo::InterfaceRequest<mojo::ServiceProvider> services, |
122 URLResponsePtr response, | 116 URLResponsePtr response, |
123 mojo::Shell* shell, | 117 mojo::Shell* shell, |
124 scoped_refptr<base::MessageLoopProxy> compositor_thread, | 118 scoped_refptr<base::MessageLoopProxy> compositor_thread, |
125 WebMediaPlayerFactory* web_media_player_factory, | 119 WebMediaPlayerFactory* web_media_player_factory, |
126 bool is_headless) | 120 bool is_headless) |
127 : response_(response.Pass()), | 121 : response_(response.Pass()), |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 blink::WebLocalFrame* frame, | 321 blink::WebLocalFrame* frame, |
328 const blink::WebHistoryItem& history_item, | 322 const blink::WebHistoryItem& history_item, |
329 blink::WebHistoryCommitType commit_type) { | 323 blink::WebHistoryCommitType commit_type) { |
330 if (navigator_host_.get()) | 324 if (navigator_host_.get()) |
331 navigator_host_->DidNavigateLocally(history_item.urlString().utf8()); | 325 navigator_host_->DidNavigateLocally(history_item.urlString().utf8()); |
332 } | 326 } |
333 | 327 |
334 blink::WebEncryptedMediaClient* HTMLDocument::encryptedMediaClient() { | 328 blink::WebEncryptedMediaClient* HTMLDocument::encryptedMediaClient() { |
335 if (!web_encrypted_media_client_) { | 329 if (!web_encrypted_media_client_) { |
336 web_encrypted_media_client_.reset(new media::WebEncryptedMediaClientImpl( | 330 web_encrypted_media_client_.reset(new media::WebEncryptedMediaClientImpl( |
337 base::Bind(&AreSecureCodecsSupported), GetCdmFactory(), | 331 GetCdmFactory(), GetMediaPermission())); |
338 GetMediaPermission())); | |
339 } | 332 } |
340 return web_encrypted_media_client_.get(); | 333 return web_encrypted_media_client_.get(); |
341 } | 334 } |
342 | 335 |
343 void HTMLDocument::OnViewBoundsChanged(View* view, | 336 void HTMLDocument::OnViewBoundsChanged(View* view, |
344 const Rect& old_bounds, | 337 const Rect& old_bounds, |
345 const Rect& new_bounds) { | 338 const Rect& new_bounds) { |
346 DCHECK_EQ(view, root_); | 339 DCHECK_EQ(view, root_); |
347 UpdateWebviewSizeFromViewSize(); | 340 UpdateWebviewSizeFromViewSize(); |
348 } | 341 } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 return media_permission_.get(); | 376 return media_permission_.get(); |
384 } | 377 } |
385 | 378 |
386 media::CdmFactory* HTMLDocument::GetCdmFactory() { | 379 media::CdmFactory* HTMLDocument::GetCdmFactory() { |
387 if (!cdm_factory_) | 380 if (!cdm_factory_) |
388 cdm_factory_.reset(new media::DefaultCdmFactory()); | 381 cdm_factory_.reset(new media::DefaultCdmFactory()); |
389 return cdm_factory_.get(); | 382 return cdm_factory_.get(); |
390 } | 383 } |
391 | 384 |
392 } // namespace html_viewer | 385 } // namespace html_viewer |
OLD | NEW |