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" |
11 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
12 #include "base/thread_task_runner_handle.h" | 12 #include "base/thread_task_runner_handle.h" |
13 #include "mojo/converters/geometry/geometry_type_converters.h" | 13 #include "mojo/converters/geometry/geometry_type_converters.h" |
14 #include "mojo/public/cpp/application/connect.h" | 14 #include "mojo/public/cpp/application/connect.h" |
15 #include "mojo/public/cpp/system/data_pipe.h" | 15 #include "mojo/public/cpp/system/data_pipe.h" |
16 #include "mojo/public/interfaces/application/shell.mojom.h" | 16 #include "mojo/public/interfaces/application/shell.mojom.h" |
17 #include "mojo/services/surfaces/public/interfaces/surfaces_service.mojom.h" | 17 #include "mojo/services/surfaces/public/interfaces/surfaces_service.mojom.h" |
18 #include "mojo/services/view_manager/public/cpp/view.h" | 18 #include "mojo/services/view_manager/public/cpp/view.h" |
| 19 #include "mojo/services/view_manager/public/cpp/view_manager.h" |
19 #include "skia/ext/refptr.h" | 20 #include "skia/ext/refptr.h" |
20 #include "sky/compositor/layer.h" | 21 #include "sky/compositor/layer.h" |
21 #include "sky/compositor/layer_host.h" | 22 #include "sky/compositor/layer_host.h" |
22 #include "sky/engine/public/platform/Platform.h" | 23 #include "sky/engine/public/platform/Platform.h" |
23 #include "sky/engine/public/platform/WebHTTPHeaderVisitor.h" | 24 #include "sky/engine/public/platform/WebHTTPHeaderVisitor.h" |
24 #include "sky/engine/public/web/Sky.h" | 25 #include "sky/engine/public/web/Sky.h" |
25 #include "sky/engine/public/web/WebConsoleMessage.h" | 26 #include "sky/engine/public/web/WebConsoleMessage.h" |
26 #include "sky/engine/public/web/WebDocument.h" | 27 #include "sky/engine/public/web/WebDocument.h" |
27 #include "sky/engine/public/web/WebElement.h" | 28 #include "sky/engine/public/web/WebElement.h" |
28 #include "sky/engine/public/web/WebInputEvent.h" | 29 #include "sky/engine/public/web/WebInputEvent.h" |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 | 166 |
166 void DocumentView::scheduleAnimation() { | 167 void DocumentView::scheduleAnimation() { |
167 DCHECK(web_view_); | 168 DCHECK(web_view_); |
168 layer_host_->SetNeedsAnimate(); | 169 layer_host_->SetNeedsAnimate(); |
169 } | 170 } |
170 | 171 |
171 mojo::View* DocumentView::createChildFrame(const blink::WebURL& url) { | 172 mojo::View* DocumentView::createChildFrame(const blink::WebURL& url) { |
172 if (!root_) | 173 if (!root_) |
173 return nullptr; | 174 return nullptr; |
174 | 175 |
175 mojo::View* child = mojo::View::Create(root_->view_manager()); | 176 mojo::View* child = root_->view_manager()->CreateView(); |
176 child->SetVisible(true); | 177 child->SetVisible(true); |
177 root_->AddChild(child); | 178 root_->AddChild(child); |
178 child->Embed(mojo::String::From(url.string().utf8())); | 179 child->Embed(mojo::String::From(url.string().utf8())); |
179 | 180 |
180 return child; | 181 return child; |
181 } | 182 } |
182 | 183 |
183 void DocumentView::frameDetached(blink::WebFrame* frame) { | 184 void DocumentView::frameDetached(blink::WebFrame* frame) { |
184 // |frame| is invalid after here. | 185 // |frame| is invalid after here. |
185 frame->close(); | 186 frame->close(); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 void DocumentView::StartDebuggerInspectorBackend() { | 277 void DocumentView::StartDebuggerInspectorBackend() { |
277 if (!inspector_backend_) { | 278 if (!inspector_backend_) { |
278 inspector_host_.reset(new InspectorHostImpl(web_view_, shell_)); | 279 inspector_host_.reset(new InspectorHostImpl(web_view_, shell_)); |
279 inspector_backend_.reset( | 280 inspector_backend_.reset( |
280 new inspector::InspectorBackendMojo(inspector_host_.get())); | 281 new inspector::InspectorBackendMojo(inspector_host_.get())); |
281 } | 282 } |
282 inspector_backend_->Connect(); | 283 inspector_backend_->Connect(); |
283 } | 284 } |
284 | 285 |
285 } // namespace sky | 286 } // namespace sky |
OLD | NEW |