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 "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" |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 271 blink::WebLocalFrame* frame, | 271 blink::WebLocalFrame* frame, |
| 272 const blink::WebHistoryItem& history_item, | 272 const blink::WebHistoryItem& history_item, |
| 273 blink::WebHistoryCommitType commit_type) { | 273 blink::WebHistoryCommitType commit_type) { |
| 274 if (navigator_host_.get()) | 274 if (navigator_host_.get()) |
| 275 navigator_host_->DidNavigateLocally(history_item.urlString().utf8()); | 275 navigator_host_->DidNavigateLocally(history_item.urlString().utf8()); |
| 276 } | 276 } |
| 277 | 277 |
| 278 blink::WebEncryptedMediaClient* HTMLDocument::encryptedMediaClient() { | 278 blink::WebEncryptedMediaClient* HTMLDocument::encryptedMediaClient() { |
| 279 if (!web_encrypted_media_client_) { | 279 if (!web_encrypted_media_client_) { |
| 280 web_encrypted_media_client_.reset(new media::WebEncryptedMediaClientImpl( | 280 web_encrypted_media_client_.reset(new media::WebEncryptedMediaClientImpl( |
| 281 make_scoped_ptr(new media::DefaultCdmFactory()))); | 281 make_scoped_ptr(new media::DefaultCdmFactory()), nullptr)); |
|
ddorwin
2015/01/26 23:33:46
TODO?
xhwang
2015/01/27 00:01:58
Done.
| |
| 282 } | 282 } |
| 283 return web_encrypted_media_client_.get(); | 283 return web_encrypted_media_client_.get(); |
| 284 } | 284 } |
| 285 | 285 |
| 286 void HTMLDocument::OnViewBoundsChanged(View* view, | 286 void HTMLDocument::OnViewBoundsChanged(View* view, |
| 287 const Rect& old_bounds, | 287 const Rect& old_bounds, |
| 288 const Rect& new_bounds) { | 288 const Rect& new_bounds) { |
| 289 DCHECK_EQ(view, root_); | 289 DCHECK_EQ(view, root_); |
| 290 web_view_->resize( | 290 web_view_->resize( |
| 291 blink::WebSize(view->bounds().width, view->bounds().height)); | 291 blink::WebSize(view->bounds().width, view->bounds().height)); |
| 292 } | 292 } |
| 293 | 293 |
| 294 void HTMLDocument::OnViewDestroyed(View* view) { | 294 void HTMLDocument::OnViewDestroyed(View* view) { |
| 295 DCHECK_EQ(view, root_); | 295 DCHECK_EQ(view, root_); |
| 296 root_ = nullptr; | 296 root_ = nullptr; |
| 297 } | 297 } |
| 298 | 298 |
| 299 void HTMLDocument::OnViewInputEvent(View* view, const mojo::EventPtr& event) { | 299 void HTMLDocument::OnViewInputEvent(View* view, const mojo::EventPtr& event) { |
| 300 scoped_ptr<blink::WebInputEvent> web_event = | 300 scoped_ptr<blink::WebInputEvent> web_event = |
| 301 event.To<scoped_ptr<blink::WebInputEvent>>(); | 301 event.To<scoped_ptr<blink::WebInputEvent>>(); |
| 302 if (web_event) | 302 if (web_event) |
| 303 web_view_->handleInputEvent(*web_event); | 303 web_view_->handleInputEvent(*web_event); |
| 304 } | 304 } |
| 305 | 305 |
| 306 } // namespace html_viewer | 306 } // namespace html_viewer |
| OLD | NEW |