| 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 // TODO(aa): Need to figure out how shutdown works. | 125 // TODO(aa): Need to figure out how shutdown works. |
| 126 } | 126 } |
| 127 | 127 |
| 128 void DocumentView::Load(mojo::URLResponsePtr response) { | 128 void DocumentView::Load(mojo::URLResponsePtr response) { |
| 129 web_view_ = blink::WebView::create(this); | 129 web_view_ = blink::WebView::create(this); |
| 130 ConfigureSettings(web_view_->settings()); | 130 ConfigureSettings(web_view_->settings()); |
| 131 web_view_->setMainFrame(blink::WebLocalFrame::create(this)); | 131 web_view_->setMainFrame(blink::WebLocalFrame::create(this)); |
| 132 web_view_->mainFrame()->load(GURL(response->url), response->body.Pass()); | 132 web_view_->mainFrame()->load(GURL(response->url), response->body.Pass()); |
| 133 } | 133 } |
| 134 | 134 |
| 135 blink::WebLayerTreeView* DocumentView::initializeLayerTreeView() { | 135 void DocumentView::initializeLayerTreeView() { |
| 136 layer_host_.reset(new LayerHost(this)); | 136 layer_host_.reset(new LayerHost(this)); |
| 137 root_layer_ = make_scoped_refptr(new Layer(this)); | 137 root_layer_ = make_scoped_refptr(new Layer(this)); |
| 138 layer_host_->SetRootLayer(root_layer_); | 138 layer_host_->SetRootLayer(root_layer_); |
| 139 return nullptr; | |
| 140 } | 139 } |
| 141 | 140 |
| 142 mojo::Shell* DocumentView::GetShell() { | 141 mojo::Shell* DocumentView::GetShell() { |
| 143 return shell_; | 142 return shell_; |
| 144 } | 143 } |
| 145 | 144 |
| 146 void DocumentView::BeginFrame(base::TimeTicks frame_time) { | 145 void DocumentView::BeginFrame(base::TimeTicks frame_time) { |
| 147 double frame_time_sec = (frame_time - base::TimeTicks()).InSecondsF(); | 146 double frame_time_sec = (frame_time - base::TimeTicks()).InSecondsF(); |
| 148 double deadline_sec = frame_time_sec; | 147 double deadline_sec = frame_time_sec; |
| 149 double interval_sec = 1.0/60; | 148 double interval_sec = 1.0/60; |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 void DocumentView::StartDebuggerInspectorBackend() { | 278 void DocumentView::StartDebuggerInspectorBackend() { |
| 280 if (!inspector_backend_) { | 279 if (!inspector_backend_) { |
| 281 inspector_host_.reset(new InspectorHostImpl(web_view_, shell_)); | 280 inspector_host_.reset(new InspectorHostImpl(web_view_, shell_)); |
| 282 inspector_backend_.reset( | 281 inspector_backend_.reset( |
| 283 new inspector::InspectorBackendMojo(inspector_host_.get())); | 282 new inspector::InspectorBackendMojo(inspector_host_.get())); |
| 284 } | 283 } |
| 285 inspector_backend_->Connect(); | 284 inspector_backend_->Connect(); |
| 286 } | 285 } |
| 287 | 286 |
| 288 } // namespace sky | 287 } // namespace sky |
| OLD | NEW |