| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 shell_->ConnectToApplication("mojo:native_viewport_service", | 150 shell_->ConnectToApplication("mojo:native_viewport_service", |
| 151 mojo::GetProxy(&gpu_service_provider)); | 151 mojo::GetProxy(&gpu_service_provider)); |
| 152 mojo::InterfacePtr<mojo::Gpu> gpu_service; | 152 mojo::InterfacePtr<mojo::Gpu> gpu_service; |
| 153 mojo::ConnectToService(gpu_service_provider.get(), &gpu_service); | 153 mojo::ConnectToService(gpu_service_provider.get(), &gpu_service); |
| 154 web_layer_tree_view_impl_.reset(new WebLayerTreeViewImpl( | 154 web_layer_tree_view_impl_.reset(new WebLayerTreeViewImpl( |
| 155 compositor_thread_, surfaces_service.Pass(), gpu_service.Pass())); | 155 compositor_thread_, surfaces_service.Pass(), gpu_service.Pass())); |
| 156 | 156 |
| 157 return web_layer_tree_view_impl_.get(); | 157 return web_layer_tree_view_impl_.get(); |
| 158 } | 158 } |
| 159 | 159 |
| 160 void DocumentView::scheduleAnimation() { |
| 161 DCHECK(web_view_); |
| 162 |
| 163 if (!web_view_->settings()->compositorIsEnabled()) |
| 164 web_layer_tree_view_impl_->setNeedsAnimate(); |
| 165 } |
| 166 |
| 160 mojo::View* DocumentView::createChildFrame(const blink::WebURL& url) { | 167 mojo::View* DocumentView::createChildFrame(const blink::WebURL& url) { |
| 161 if (!root_) | 168 if (!root_) |
| 162 return nullptr; | 169 return nullptr; |
| 163 | 170 |
| 164 mojo::View* child = mojo::View::Create(root_->view_manager()); | 171 mojo::View* child = mojo::View::Create(root_->view_manager()); |
| 165 root_->AddChild(child); | 172 root_->AddChild(child); |
| 166 child->Embed(mojo::String::From(url.string().utf8())); | 173 child->Embed(mojo::String::From(url.string().utf8())); |
| 167 | 174 |
| 168 return child; | 175 return child; |
| 169 } | 176 } |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 | 247 |
| 241 void DocumentView::OnViewInputEvent( | 248 void DocumentView::OnViewInputEvent( |
| 242 mojo::View* view, const mojo::EventPtr& event) { | 249 mojo::View* view, const mojo::EventPtr& event) { |
| 243 scoped_ptr<blink::WebInputEvent> web_event = | 250 scoped_ptr<blink::WebInputEvent> web_event = |
| 244 event.To<scoped_ptr<blink::WebInputEvent> >(); | 251 event.To<scoped_ptr<blink::WebInputEvent> >(); |
| 245 if (web_event) | 252 if (web_event) |
| 246 web_view_->handleInputEvent(*web_event); | 253 web_view_->handleInputEvent(*web_event); |
| 247 } | 254 } |
| 248 | 255 |
| 249 } // namespace sky | 256 } // namespace sky |
| OLD | NEW |