| 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 "sky/viewer/document_view.h" | 5 #include "sky/viewer/document_view.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/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 | 266 |
| 267 void DocumentView::OnViewDestroyed(mojo::View* view) { | 267 void DocumentView::OnViewDestroyed(mojo::View* view) { |
| 268 DCHECK_EQ(view, root_); | 268 DCHECK_EQ(view, root_); |
| 269 | 269 |
| 270 root_ = nullptr; | 270 root_ = nullptr; |
| 271 } | 271 } |
| 272 | 272 |
| 273 void DocumentView::OnViewInputEvent( | 273 void DocumentView::OnViewInputEvent( |
| 274 mojo::View* view, const mojo::EventPtr& event) { | 274 mojo::View* view, const mojo::EventPtr& event) { |
| 275 scoped_ptr<blink::WebInputEvent> web_event = | 275 scoped_ptr<blink::WebInputEvent> web_event = |
| 276 event.To<scoped_ptr<blink::WebInputEvent> >(); | 276 ConvertEvent(event, GetDevicePixelRatio()); |
| 277 if (web_event) | 277 if (web_event) |
| 278 web_view_->handleInputEvent(*web_event); | 278 web_view_->handleInputEvent(*web_event); |
| 279 } | 279 } |
| 280 | 280 |
| 281 class InspectorHostImpl : public inspector::InspectorHost { | 281 class InspectorHostImpl : public inspector::InspectorHost { |
| 282 public: | 282 public: |
| 283 InspectorHostImpl(blink::WebView* web_view, mojo::Shell* shell) | 283 InspectorHostImpl(blink::WebView* web_view, mojo::Shell* shell) |
| 284 : web_view_(web_view), shell_(shell) {} | 284 : web_view_(web_view), shell_(shell) {} |
| 285 | 285 |
| 286 virtual ~InspectorHostImpl() {} | 286 virtual ~InspectorHostImpl() {} |
| (...skipping 12 matching lines...) Expand all Loading... |
| 299 void DocumentView::StartDebuggerInspectorBackend() { | 299 void DocumentView::StartDebuggerInspectorBackend() { |
| 300 if (!inspector_backend_) { | 300 if (!inspector_backend_) { |
| 301 inspector_host_.reset(new InspectorHostImpl(web_view_, shell_)); | 301 inspector_host_.reset(new InspectorHostImpl(web_view_, shell_)); |
| 302 inspector_backend_.reset( | 302 inspector_backend_.reset( |
| 303 new inspector::InspectorBackendMojo(inspector_host_.get())); | 303 new inspector::InspectorBackendMojo(inspector_host_.get())); |
| 304 } | 304 } |
| 305 inspector_backend_->Connect(); | 305 inspector_backend_->Connect(); |
| 306 } | 306 } |
| 307 | 307 |
| 308 } // namespace sky | 308 } // namespace sky |
| OLD | NEW |