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

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

Issue 1023863002: Create an interface for KeySystems, migrate WebEncryptedMediaClientImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@robustness
Patch Set: Rebase. Created 5 years, 9 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 #include "mojo/services/html_viewer/html_document.h" 5 #include "mojo/services/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 "media/base/key_systems.h"
15 #include "media/blink/webencryptedmediaclient_impl.h" 16 #include "media/blink/webencryptedmediaclient_impl.h"
16 #include "media/cdm/default_cdm_factory.h" 17 #include "media/cdm/default_cdm_factory.h"
17 #include "media/filters/default_media_permission.h" 18 #include "media/filters/default_media_permission.h"
18 #include "mojo/services/html_viewer/blink_input_events_type_converters.h" 19 #include "mojo/services/html_viewer/blink_input_events_type_converters.h"
19 #include "mojo/services/html_viewer/blink_url_request_type_converters.h" 20 #include "mojo/services/html_viewer/blink_url_request_type_converters.h"
20 #include "mojo/services/html_viewer/weblayertreeview_impl.h" 21 #include "mojo/services/html_viewer/weblayertreeview_impl.h"
21 #include "mojo/services/html_viewer/webmediaplayer_factory.h" 22 #include "mojo/services/html_viewer/webmediaplayer_factory.h"
22 #include "mojo/services/html_viewer/webstoragenamespace_impl.h" 23 #include "mojo/services/html_viewer/webstoragenamespace_impl.h"
23 #include "mojo/services/html_viewer/weburlloader_impl.h" 24 #include "mojo/services/html_viewer/weburlloader_impl.h"
24 #include "skia/ext/refptr.h" 25 #include "skia/ext/refptr.h"
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 blink::WebHistoryCommitType commit_type) { 280 blink::WebHistoryCommitType commit_type) {
280 if (navigator_host_.get()) 281 if (navigator_host_.get())
281 navigator_host_->DidNavigateLocally(history_item.urlString().utf8()); 282 navigator_host_->DidNavigateLocally(history_item.urlString().utf8());
282 } 283 }
283 284
284 blink::WebEncryptedMediaClient* HTMLDocument::encryptedMediaClient() { 285 blink::WebEncryptedMediaClient* HTMLDocument::encryptedMediaClient() {
285 if (!web_encrypted_media_client_) { 286 if (!web_encrypted_media_client_) {
286 if (!media_permission_) 287 if (!media_permission_)
287 media_permission_.reset(new media::DefaultMediaPermission(true)); 288 media_permission_.reset(new media::DefaultMediaPermission(true));
288 web_encrypted_media_client_.reset(new media::WebEncryptedMediaClientImpl( 289 web_encrypted_media_client_.reset(new media::WebEncryptedMediaClientImpl(
290 media::KeySystems::GetInstance(),
289 make_scoped_ptr(new media::DefaultCdmFactory()), 291 make_scoped_ptr(new media::DefaultCdmFactory()),
290 media_permission_.get())); 292 media_permission_.get()));
291 } 293 }
292 return web_encrypted_media_client_.get(); 294 return web_encrypted_media_client_.get();
293 } 295 }
294 296
295 void HTMLDocument::OnViewBoundsChanged(View* view, 297 void HTMLDocument::OnViewBoundsChanged(View* view,
296 const Rect& old_bounds, 298 const Rect& old_bounds,
297 const Rect& new_bounds) { 299 const Rect& new_bounds) {
298 DCHECK_EQ(view, root_); 300 DCHECK_EQ(view, root_);
299 web_view_->resize( 301 web_view_->resize(
300 blink::WebSize(view->bounds().width, view->bounds().height)); 302 blink::WebSize(view->bounds().width, view->bounds().height));
301 } 303 }
302 304
303 void HTMLDocument::OnViewDestroyed(View* view) { 305 void HTMLDocument::OnViewDestroyed(View* view) {
304 DCHECK_EQ(view, root_); 306 DCHECK_EQ(view, root_);
305 root_ = nullptr; 307 root_ = nullptr;
306 } 308 }
307 309
308 void HTMLDocument::OnViewInputEvent(View* view, const mojo::EventPtr& event) { 310 void HTMLDocument::OnViewInputEvent(View* view, const mojo::EventPtr& event) {
309 scoped_ptr<blink::WebInputEvent> web_event = 311 scoped_ptr<blink::WebInputEvent> web_event =
310 event.To<scoped_ptr<blink::WebInputEvent>>(); 312 event.To<scoped_ptr<blink::WebInputEvent>>();
311 if (web_event) 313 if (web_event)
312 web_view_->handleInputEvent(*web_event); 314 web_view_->handleInputEvent(*web_event);
313 } 315 }
314 316
315 } // namespace html_viewer 317 } // namespace html_viewer
OLDNEW
« media/blink/webencryptedmediaclient_impl.cc ('K') | « media/blink/webencryptedmediaclient_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698