Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: components/html_viewer/html_frame.cc

Issue 1281663002: Mandoline: Allow submitting CompositorFrames directly to mojo::Views (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Rob's comments + Lots of cleanup Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_frame.h" 5 #include "components/html_viewer/html_frame.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 15 matching lines...) Expand all
26 #include "components/html_viewer/stats_collection_controller.h" 26 #include "components/html_viewer/stats_collection_controller.h"
27 #include "components/html_viewer/touch_handler.h" 27 #include "components/html_viewer/touch_handler.h"
28 #include "components/html_viewer/web_layer_impl.h" 28 #include "components/html_viewer/web_layer_impl.h"
29 #include "components/html_viewer/web_layer_tree_view_impl.h" 29 #include "components/html_viewer/web_layer_tree_view_impl.h"
30 #include "components/html_viewer/web_storage_namespace_impl.h" 30 #include "components/html_viewer/web_storage_namespace_impl.h"
31 #include "components/html_viewer/web_url_loader_impl.h" 31 #include "components/html_viewer/web_url_loader_impl.h"
32 #include "components/view_manager/ids.h" 32 #include "components/view_manager/ids.h"
33 #include "components/view_manager/public/cpp/scoped_view_ptr.h" 33 #include "components/view_manager/public/cpp/scoped_view_ptr.h"
34 #include "components/view_manager/public/cpp/view.h" 34 #include "components/view_manager/public/cpp/view.h"
35 #include "components/view_manager/public/cpp/view_manager.h" 35 #include "components/view_manager/public/cpp/view_manager.h"
36 #include "components/view_manager/public/interfaces/surfaces.mojom.h"
37 #include "mandoline/services/navigation/public/interfaces/navigation.mojom.h" 36 #include "mandoline/services/navigation/public/interfaces/navigation.mojom.h"
38 #include "mojo/application/public/cpp/application_impl.h" 37 #include "mojo/application/public/cpp/application_impl.h"
39 #include "mojo/application/public/cpp/connect.h" 38 #include "mojo/application/public/cpp/connect.h"
40 #include "mojo/application/public/interfaces/shell.mojom.h" 39 #include "mojo/application/public/interfaces/shell.mojom.h"
41 #include "mojo/converters/geometry/geometry_type_converters.h" 40 #include "mojo/converters/geometry/geometry_type_converters.h"
42 #include "skia/ext/refptr.h" 41 #include "skia/ext/refptr.h"
43 #include "third_party/WebKit/public/platform/Platform.h" 42 #include "third_party/WebKit/public/platform/Platform.h"
44 #include "third_party/WebKit/public/platform/WebHTTPHeaderVisitor.h" 43 #include "third_party/WebKit/public/platform/WebHTTPHeaderVisitor.h"
45 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" 44 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h"
46 #include "third_party/WebKit/public/platform/WebSize.h" 45 #include "third_party/WebKit/public/platform/WebSize.h"
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 591
593 void HTMLFrame::didCancelCompositionOnSelectionChange() { 592 void HTMLFrame::didCancelCompositionOnSelectionChange() {
594 // TODO(penghuang): Update text input state. 593 // TODO(penghuang): Update text input state.
595 } 594 }
596 595
597 void HTMLFrame::didChangeContents() { 596 void HTMLFrame::didChangeContents() {
598 // TODO(penghuang): Update text input state. 597 // TODO(penghuang): Update text input state.
599 } 598 }
600 599
601 void HTMLFrame::initializeLayerTreeView() { 600 void HTMLFrame::initializeLayerTreeView() {
602 mojo::URLRequestPtr request(mojo::URLRequest::New()); 601 DCHECK(view());
603 request->url = mojo::String::From("mojo:view_manager"); 602
604 mojo::SurfacePtr surface; 603 mojo::CompositorFrameReceiverPtr receiver;
605 GetLocalRootApp()->ConnectToService(request.Pass(), &surface); 604 view()->RequestCompositorFrameReceiver(GetProxy(&receiver));
606 605
607 mojo::URLRequestPtr request2(mojo::URLRequest::New()); 606 mojo::URLRequestPtr request2(mojo::URLRequest::New());
608 request2->url = mojo::String::From("mojo:view_manager"); 607 request2->url = mojo::String::From("mojo:view_manager");
609 mojo::GpuPtr gpu_service; 608 mojo::GpuPtr gpu_service;
610 GetLocalRootApp()->ConnectToService(request2.Pass(), &gpu_service); 609 GetLocalRootApp()->ConnectToService(request2.Pass(), &gpu_service);
611 web_layer_tree_view_impl_.reset(new WebLayerTreeViewImpl( 610 web_layer_tree_view_impl_.reset(new WebLayerTreeViewImpl(
612 global_state()->compositor_thread(), 611 global_state()->compositor_thread(),
613 global_state()->gpu_memory_buffer_manager(), 612 global_state()->gpu_memory_buffer_manager(),
614 global_state()->raster_thread_helper()->task_graph_runner(), 613 global_state()->raster_thread_helper()->task_graph_runner(),
615 surface.Pass(), gpu_service.Pass())); 614 receiver.Pass(), gpu_service.Pass()));
616 } 615 }
617 616
618 blink::WebLayerTreeView* HTMLFrame::layerTreeView() { 617 blink::WebLayerTreeView* HTMLFrame::layerTreeView() {
619 return web_layer_tree_view_impl_.get(); 618 return web_layer_tree_view_impl_.get();
620 } 619 }
621 620
622 void HTMLFrame::resetInputMethod() { 621 void HTMLFrame::resetInputMethod() {
623 // When this method gets called, WebWidgetClient implementation should 622 // When this method gets called, WebWidgetClient implementation should
624 // reset the input method by cancelling any ongoing composition. 623 // reset the input method by cancelling any ongoing composition.
625 // TODO(penghuang): Reset IME. 624 // TODO(penghuang): Reset IME.
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
902 901
903 void HTMLFrame::reload(bool ignore_cache, bool is_client_redirect) { 902 void HTMLFrame::reload(bool ignore_cache, bool is_client_redirect) {
904 NOTIMPLEMENTED(); 903 NOTIMPLEMENTED();
905 } 904 }
906 905
907 void HTMLFrame::forwardInputEvent(const blink::WebInputEvent* event) { 906 void HTMLFrame::forwardInputEvent(const blink::WebInputEvent* event) {
908 NOTIMPLEMENTED(); 907 NOTIMPLEMENTED();
909 } 908 }
910 909
911 } // namespace mojo 910 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698