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 "components/html_viewer/html_document.h" | 5 #include "components/html_viewer/html_document.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 | 297 |
298 void HTMLDocument::initializeLayerTreeView() { | 298 void HTMLDocument::initializeLayerTreeView() { |
299 if (global_state_->is_headless()) { | 299 if (global_state_->is_headless()) { |
300 web_layer_tree_view_impl_.reset( | 300 web_layer_tree_view_impl_.reset( |
301 new WebLayerTreeViewImpl(global_state_->compositor_thread(), nullptr, | 301 new WebLayerTreeViewImpl(global_state_->compositor_thread(), nullptr, |
302 nullptr, nullptr, nullptr)); | 302 nullptr, nullptr, nullptr)); |
303 return; | 303 return; |
304 } | 304 } |
305 | 305 |
306 mojo::URLRequestPtr request(mojo::URLRequest::New()); | 306 mojo::URLRequestPtr request(mojo::URLRequest::New()); |
307 request->url = mojo::String::From("mojo:surfaces_service"); | 307 request->url = mojo::String::From("mojo:view_manager"); |
308 mojo::SurfacePtr surface; | 308 mojo::SurfacePtr surface; |
309 html_document_app_->ConnectToService(request.Pass(), &surface); | 309 html_document_app_->ConnectToService(request.Pass(), &surface); |
310 | 310 |
311 // TODO(jamesr): Should be mojo:gpu_service | 311 // TODO(jamesr): Should be mojo:gpu_service |
312 mojo::URLRequestPtr request2(mojo::URLRequest::New()); | 312 mojo::URLRequestPtr request2(mojo::URLRequest::New()); |
313 request2->url = mojo::String::From("mojo:view_manager"); | 313 request2->url = mojo::String::From("mojo:view_manager"); |
314 mojo::GpuPtr gpu_service; | 314 mojo::GpuPtr gpu_service; |
315 html_document_app_->ConnectToService(request2.Pass(), &gpu_service); | 315 html_document_app_->ConnectToService(request2.Pass(), &gpu_service); |
316 web_layer_tree_view_impl_.reset(new WebLayerTreeViewImpl( | 316 web_layer_tree_view_impl_.reset(new WebLayerTreeViewImpl( |
317 global_state_->compositor_thread(), | 317 global_state_->compositor_thread(), |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 | 490 |
491 void HTMLDocument::UpdateFocus() { | 491 void HTMLDocument::UpdateFocus() { |
492 if (!web_view_) | 492 if (!web_view_) |
493 return; | 493 return; |
494 bool is_focused = root_ && root_->HasFocus(); | 494 bool is_focused = root_ && root_->HasFocus(); |
495 web_view_->setFocus(is_focused); | 495 web_view_->setFocus(is_focused); |
496 web_view_->setIsActive(is_focused); | 496 web_view_->setIsActive(is_focused); |
497 } | 497 } |
498 | 498 |
499 } // namespace html_viewer | 499 } // namespace html_viewer |
OLD | NEW |