OLD | NEW |
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/web_view/web_view_impl.h" | 5 #include "components/web_view/web_view_impl.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "components/devtools_service/public/cpp/switches.h" | 8 #include "components/devtools_service/public/cpp/switches.h" |
9 #include "components/view_manager/public/cpp/scoped_view_ptr.h" | 9 #include "components/view_manager/public/cpp/scoped_view_ptr.h" |
10 #include "components/view_manager/public/cpp/view.h" | 10 #include "components/view_manager/public/cpp/view.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 Frame::ClientPropertyMap client_properties; | 62 Frame::ClientPropertyMap client_properties; |
63 if (devtools_agent_) { | 63 if (devtools_agent_) { |
64 devtools_service::DevToolsAgentPtr forward_agent; | 64 devtools_service::DevToolsAgentPtr forward_agent; |
65 frame_connection->application_connection()->ConnectToService( | 65 frame_connection->application_connection()->ConnectToService( |
66 &forward_agent); | 66 &forward_agent); |
67 devtools_agent_->AttachFrame(forward_agent.Pass(), &client_properties); | 67 devtools_agent_->AttachFrame(forward_agent.Pass(), &client_properties); |
68 } | 68 } |
69 | 69 |
70 FrameTreeClient* frame_tree_client = frame_connection->frame_tree_client(); | 70 FrameTreeClient* frame_tree_client = frame_connection->frame_tree_client(); |
71 const uint32_t content_handler_id = frame_connection->GetContentHandlerID(); | 71 const uint32_t content_handler_id = frame_connection->GetContentHandlerID(); |
72 frame_tree_.reset(new FrameTree(content_handler_id, content_, this, | 72 frame_tree_.reset(new FrameTree( |
73 frame_tree_client, frame_connection.Pass(), | 73 content_handler_id, content_, view_tree_client.Pass(), this, |
74 client_properties)); | 74 frame_tree_client, frame_connection.Pass(), client_properties)); |
75 content_->Embed(view_tree_client.Pass()); | |
76 } | 75 } |
77 | 76 |
78 //////////////////////////////////////////////////////////////////////////////// | 77 //////////////////////////////////////////////////////////////////////////////// |
79 // WebViewImpl, WebView implementation: | 78 // WebViewImpl, WebView implementation: |
80 | 79 |
81 void WebViewImpl::LoadRequest(mojo::URLRequestPtr request) { | 80 void WebViewImpl::LoadRequest(mojo::URLRequestPtr request) { |
82 pending_load_.reset(new PendingWebViewLoad(this)); | 81 pending_load_.reset(new PendingWebViewLoad(this)); |
83 pending_load_->Init(request.Pass()); | 82 pending_load_->Init(request.Pass()); |
84 } | 83 } |
85 | 84 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 //////////////////////////////////////////////////////////////////////////////// | 170 //////////////////////////////////////////////////////////////////////////////// |
172 // WebViewImpl, FrameDevToolsAgentDelegate implementation: | 171 // WebViewImpl, FrameDevToolsAgentDelegate implementation: |
173 | 172 |
174 void WebViewImpl::HandlePageNavigateRequest(const GURL& url) { | 173 void WebViewImpl::HandlePageNavigateRequest(const GURL& url) { |
175 mojo::URLRequestPtr request(mojo::URLRequest::New()); | 174 mojo::URLRequestPtr request(mojo::URLRequest::New()); |
176 request->url = url.spec(); | 175 request->url = url.spec(); |
177 client_->TopLevelNavigate(request.Pass()); | 176 client_->TopLevelNavigate(request.Pass()); |
178 } | 177 } |
179 | 178 |
180 } // namespace web_view | 179 } // namespace web_view |
OLD | NEW |