| 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/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "components/view_manager/public/cpp/view_manager.h" | 26 #include "components/view_manager/public/cpp/view_manager.h" |
| 27 #include "components/view_manager/public/cpp/view_property.h" | 27 #include "components/view_manager/public/cpp/view_property.h" |
| 28 #include "components/view_manager/public/interfaces/surfaces.mojom.h" | 28 #include "components/view_manager/public/interfaces/surfaces.mojom.h" |
| 29 #include "mojo/application/public/cpp/application_impl.h" | 29 #include "mojo/application/public/cpp/application_impl.h" |
| 30 #include "mojo/application/public/cpp/connect.h" | 30 #include "mojo/application/public/cpp/connect.h" |
| 31 #include "mojo/application/public/interfaces/shell.mojom.h" | 31 #include "mojo/application/public/interfaces/shell.mojom.h" |
| 32 #include "mojo/converters/geometry/geometry_type_converters.h" | 32 #include "mojo/converters/geometry/geometry_type_converters.h" |
| 33 #include "skia/ext/refptr.h" | 33 #include "skia/ext/refptr.h" |
| 34 #include "third_party/WebKit/public/platform/Platform.h" | 34 #include "third_party/WebKit/public/platform/Platform.h" |
| 35 #include "third_party/WebKit/public/platform/WebHTTPHeaderVisitor.h" | 35 #include "third_party/WebKit/public/platform/WebHTTPHeaderVisitor.h" |
| 36 #include "third_party/WebKit/public/platform/WebMediaPlayerClient.h" |
| 36 #include "third_party/WebKit/public/platform/WebSize.h" | 37 #include "third_party/WebKit/public/platform/WebSize.h" |
| 37 #include "third_party/WebKit/public/web/WebConsoleMessage.h" | 38 #include "third_party/WebKit/public/web/WebConsoleMessage.h" |
| 38 #include "third_party/WebKit/public/web/WebDocument.h" | 39 #include "third_party/WebKit/public/web/WebDocument.h" |
| 39 #include "third_party/WebKit/public/web/WebElement.h" | 40 #include "third_party/WebKit/public/web/WebElement.h" |
| 40 #include "third_party/WebKit/public/web/WebInputEvent.h" | 41 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 41 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 42 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
| 42 #include "third_party/WebKit/public/web/WebRemoteFrame.h" | 43 #include "third_party/WebKit/public/web/WebRemoteFrame.h" |
| 43 #include "third_party/WebKit/public/web/WebRemoteFrameClient.h" | 44 #include "third_party/WebKit/public/web/WebRemoteFrameClient.h" |
| 44 #include "third_party/WebKit/public/web/WebScriptSource.h" | 45 #include "third_party/WebKit/public/web/WebScriptSource.h" |
| 45 #include "third_party/WebKit/public/web/WebSettings.h" | 46 #include "third_party/WebKit/public/web/WebSettings.h" |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 | 319 |
| 319 blink::WebLayerTreeView* HTMLDocument::layerTreeView() { | 320 blink::WebLayerTreeView* HTMLDocument::layerTreeView() { |
| 320 return web_layer_tree_view_impl_.get(); | 321 return web_layer_tree_view_impl_.get(); |
| 321 } | 322 } |
| 322 | 323 |
| 323 blink::WebMediaPlayer* HTMLDocument::createMediaPlayer( | 324 blink::WebMediaPlayer* HTMLDocument::createMediaPlayer( |
| 324 blink::WebLocalFrame* frame, | 325 blink::WebLocalFrame* frame, |
| 325 const blink::WebURL& url, | 326 const blink::WebURL& url, |
| 326 blink::WebMediaPlayerClient* client, | 327 blink::WebMediaPlayerClient* client, |
| 327 blink::WebContentDecryptionModule* initial_cdm) { | 328 blink::WebContentDecryptionModule* initial_cdm) { |
| 329 return createMediaPlayer(frame, url, client, client, initial_cdm); |
| 330 } |
| 331 |
| 332 blink::WebMediaPlayer* HTMLDocument::createMediaPlayer( |
| 333 blink::WebLocalFrame* frame, |
| 334 const blink::WebURL& url, |
| 335 blink::WebMediaPlayerClient* client, |
| 336 blink::WebMediaPlayerEncryptedMediaClient* encrypted_client, |
| 337 blink::WebContentDecryptionModule* initial_cdm) { |
| 328 return global_state_->media_factory()->CreateMediaPlayer( | 338 return global_state_->media_factory()->CreateMediaPlayer( |
| 329 frame, url, client, initial_cdm, html_document_app_->shell()); | 339 frame, url, client, encrypted_client, initial_cdm, |
| 340 html_document_app_->shell()); |
| 330 } | 341 } |
| 331 | 342 |
| 332 blink::WebFrame* HTMLDocument::createChildFrame( | 343 blink::WebFrame* HTMLDocument::createChildFrame( |
| 333 blink::WebLocalFrame* parent, | 344 blink::WebLocalFrame* parent, |
| 334 blink::WebTreeScopeType scope, | 345 blink::WebTreeScopeType scope, |
| 335 const blink::WebString& frameName, | 346 const blink::WebString& frameName, |
| 336 blink::WebSandboxFlags sandboxFlags) { | 347 blink::WebSandboxFlags sandboxFlags) { |
| 337 blink::WebLocalFrame* child_frame = blink::WebLocalFrame::create(scope, this); | 348 blink::WebLocalFrame* child_frame = blink::WebLocalFrame::create(scope, this); |
| 338 parent->appendChild(child_frame); | 349 parent->appendChild(child_frame); |
| 339 return child_frame; | 350 return child_frame; |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 | 477 |
| 467 void HTMLDocument::UpdateFocus() { | 478 void HTMLDocument::UpdateFocus() { |
| 468 if (!web_view_) | 479 if (!web_view_) |
| 469 return; | 480 return; |
| 470 bool is_focused = root_ && root_->HasFocus(); | 481 bool is_focused = root_ && root_->HasFocus(); |
| 471 web_view_->setFocus(is_focused); | 482 web_view_->setFocus(is_focused); |
| 472 web_view_->setIsActive(is_focused); | 483 web_view_->setIsActive(is_focused); |
| 473 } | 484 } |
| 474 | 485 |
| 475 } // namespace html_viewer | 486 } // namespace html_viewer |
| OLD | NEW |