Chromium Code Reviews| 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" |
| 11 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
| 12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
| 13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
| 14 #include "base/thread_task_runner_handle.h" | 14 #include "base/thread_task_runner_handle.h" |
| 15 #include "build/build_config.h" | |
| 15 #include "components/html_viewer/blink_input_events_type_converters.h" | 16 #include "components/html_viewer/blink_input_events_type_converters.h" |
| 16 #include "components/html_viewer/blink_url_request_type_converters.h" | 17 #include "components/html_viewer/blink_url_request_type_converters.h" |
| 17 #include "components/html_viewer/web_layer_tree_view_impl.h" | 18 #include "components/html_viewer/web_layer_tree_view_impl.h" |
| 18 #include "components/html_viewer/web_media_player_factory.h" | 19 #include "components/html_viewer/web_media_player_factory.h" |
| 19 #include "components/html_viewer/web_storage_namespace_impl.h" | 20 #include "components/html_viewer/web_storage_namespace_impl.h" |
| 20 #include "components/html_viewer/web_url_loader_impl.h" | 21 #include "components/html_viewer/web_url_loader_impl.h" |
| 21 #include "components/surfaces/public/interfaces/surfaces.mojom.h" | 22 #include "components/surfaces/public/interfaces/surfaces.mojom.h" |
| 22 #include "components/view_manager/public/cpp/view.h" | 23 #include "components/view_manager/public/cpp/view.h" |
| 23 #include "media/blink/webencryptedmediaclient_impl.h" | 24 #include "media/blink/webencryptedmediaclient_impl.h" |
| 24 #include "media/cdm/default_cdm_factory.h" | 25 #include "media/cdm/default_cdm_factory.h" |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 321 blink::WebLocalFrame* frame, | 322 blink::WebLocalFrame* frame, |
| 322 const blink::WebHistoryItem& history_item, | 323 const blink::WebHistoryItem& history_item, |
| 323 blink::WebHistoryCommitType commit_type) { | 324 blink::WebHistoryCommitType commit_type) { |
| 324 if (navigator_host_.get()) | 325 if (navigator_host_.get()) |
| 325 navigator_host_->DidNavigateLocally(history_item.urlString().utf8()); | 326 navigator_host_->DidNavigateLocally(history_item.urlString().utf8()); |
| 326 } | 327 } |
| 327 | 328 |
| 328 blink::WebEncryptedMediaClient* HTMLDocument::encryptedMediaClient() { | 329 blink::WebEncryptedMediaClient* HTMLDocument::encryptedMediaClient() { |
| 329 if (!web_encrypted_media_client_) { | 330 if (!web_encrypted_media_client_) { |
| 330 web_encrypted_media_client_.reset(new media::WebEncryptedMediaClientImpl( | 331 web_encrypted_media_client_.reset(new media::WebEncryptedMediaClientImpl( |
| 332 #if defined(OS_ANDROID) | |
| 333 base::Bind(&AllowSecureSurfaces), | |
| 334 #endif // defined(OS_ANDROID) | |
| 331 GetCdmFactory(), GetMediaPermission())); | 335 GetCdmFactory(), GetMediaPermission())); |
| 332 } | 336 } |
| 333 return web_encrypted_media_client_.get(); | 337 return web_encrypted_media_client_.get(); |
| 334 } | 338 } |
| 335 | 339 |
| 336 void HTMLDocument::OnViewBoundsChanged(View* view, | 340 void HTMLDocument::OnViewBoundsChanged(View* view, |
| 337 const Rect& old_bounds, | 341 const Rect& old_bounds, |
| 338 const Rect& new_bounds) { | 342 const Rect& new_bounds) { |
| 339 DCHECK_EQ(view, root_); | 343 DCHECK_EQ(view, root_); |
| 340 UpdateWebviewSizeFromViewSize(); | 344 UpdateWebviewSizeFromViewSize(); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 375 media_permission_.reset(new media::DefaultMediaPermission(true)); | 379 media_permission_.reset(new media::DefaultMediaPermission(true)); |
| 376 return media_permission_.get(); | 380 return media_permission_.get(); |
| 377 } | 381 } |
| 378 | 382 |
| 379 media::CdmFactory* HTMLDocument::GetCdmFactory() { | 383 media::CdmFactory* HTMLDocument::GetCdmFactory() { |
| 380 if (!cdm_factory_) | 384 if (!cdm_factory_) |
| 381 cdm_factory_.reset(new media::DefaultCdmFactory()); | 385 cdm_factory_.reset(new media::DefaultCdmFactory()); |
| 382 return cdm_factory_.get(); | 386 return cdm_factory_.get(); |
| 383 } | 387 } |
| 384 | 388 |
| 389 #if defined(OS_ANDROID) | |
| 390 bool AllowSecureSurfaces() { | |
|
ddorwin
2015/05/06 02:17:11
This could be interrupted as doing something. Use
sandersd (OOO until July 31)
2015/05/08 00:37:42
Done.
| |
| 391 return false; | |
|
ddorwin
2015/05/06 02:17:11
Add some sort of comment. i.e. not currently suppo
sandersd (OOO until July 31)
2015/05/08 00:37:42
Done.
| |
| 392 } | |
| 393 #endif // defined(OS_ANDROID) | |
| 394 | |
| 385 } // namespace html_viewer | 395 } // namespace html_viewer |
| OLD | NEW |