| 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 void DocumentView::OnSurfaceIdAvailable(mojo::SurfaceIdPtr surface_id) { | 184 void DocumentView::OnSurfaceIdAvailable(mojo::SurfaceIdPtr surface_id) { |
| 185 if (root_) | 185 if (root_) |
| 186 root_->SetSurfaceId(surface_id.Pass()); | 186 root_->SetSurfaceId(surface_id.Pass()); |
| 187 } | 187 } |
| 188 | 188 |
| 189 void DocumentView::PaintContents(SkCanvas* canvas, const gfx::Rect& clip) { | 189 void DocumentView::PaintContents(SkCanvas* canvas, const gfx::Rect& clip) { |
| 190 blink::WebRect rect(clip.x(), clip.y(), clip.width(), clip.height()); | 190 blink::WebRect rect(clip.x(), clip.y(), clip.width(), clip.height()); |
| 191 web_view_->paint(canvas, rect); | 191 web_view_->paint(canvas, rect); |
| 192 } | 192 } |
| 193 | 193 |
| 194 void DocumentView::scheduleAnimation() { | 194 void DocumentView::scheduleVisualUpdate() { |
| 195 DCHECK(web_view_); | 195 DCHECK(web_view_); |
| 196 layer_host_->SetNeedsAnimate(); | 196 layer_host_->SetNeedsAnimate(); |
| 197 } | 197 } |
| 198 | 198 |
| 199 blink::WebScreenInfo DocumentView::screenInfo() { | 199 blink::WebScreenInfo DocumentView::screenInfo() { |
| 200 DCHECK(root_); | 200 DCHECK(root_); |
| 201 auto& metrics = root_->viewport_metrics(); | 201 auto& metrics = root_->viewport_metrics(); |
| 202 blink::WebScreenInfo screen; | 202 blink::WebScreenInfo screen; |
| 203 screen.rect = blink::WebRect(0, 0, metrics.size->width, metrics.size->height); | 203 screen.rect = blink::WebRect(0, 0, metrics.size->width, metrics.size->height); |
| 204 screen.availableRect = screen.rect; | 204 screen.availableRect = screen.rect; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 void DocumentView::StartDebuggerInspectorBackend() { | 319 void DocumentView::StartDebuggerInspectorBackend() { |
| 320 if (!inspector_backend_) { | 320 if (!inspector_backend_) { |
| 321 inspector_host_.reset(new InspectorHostImpl(web_view_, shell_)); | 321 inspector_host_.reset(new InspectorHostImpl(web_view_, shell_)); |
| 322 inspector_backend_.reset( | 322 inspector_backend_.reset( |
| 323 new inspector::InspectorBackendMojo(inspector_host_.get())); | 323 new inspector::InspectorBackendMojo(inspector_host_.get())); |
| 324 } | 324 } |
| 325 inspector_backend_->Connect(); | 325 inspector_backend_->Connect(); |
| 326 } | 326 } |
| 327 | 327 |
| 328 } // namespace sky | 328 } // namespace sky |
| OLD | NEW |