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/frame_connection.h" | 5 #include "components/web_view/frame_connection.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "components/clipboard/public/interfaces/clipboard.mojom.h" | 9 #include "components/clipboard/public/interfaces/clipboard.mojom.h" |
10 #include "components/mus/public/interfaces/gpu.mojom.h" | 10 #include "components/mus/public/interfaces/gpu.mojom.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 const uint32_t existing_content_handler_id, | 32 const uint32_t existing_content_handler_id, |
33 const FrameTreeDelegate::CanNavigateFrameCallback& callback, | 33 const FrameTreeDelegate::CanNavigateFrameCallback& callback, |
34 scoped_ptr<FrameConnection> connection) { | 34 scoped_ptr<FrameConnection> connection) { |
35 mojo::ViewTreeClientPtr view_tree_client; | 35 mojo::ViewTreeClientPtr view_tree_client; |
36 if (!AreAppIdsEqual(existing_content_handler_id, | 36 if (!AreAppIdsEqual(existing_content_handler_id, |
37 connection->GetContentHandlerID())) { | 37 connection->GetContentHandlerID())) { |
38 view_tree_client = connection->GetViewTreeClient(); | 38 view_tree_client = connection->GetViewTreeClient(); |
39 } | 39 } |
40 FrameConnection* connection_ptr = connection.get(); | 40 FrameConnection* connection_ptr = connection.get(); |
41 callback.Run(connection_ptr->GetContentHandlerID(), | 41 callback.Run(connection_ptr->GetContentHandlerID(), |
42 connection_ptr->frame_tree_client(), connection.Pass(), | 42 connection_ptr->frame_client(), connection.Pass(), |
43 view_tree_client.Pass()); | 43 view_tree_client.Pass()); |
44 } | 44 } |
45 | 45 |
46 } // namespace | 46 } // namespace |
47 | 47 |
48 FrameConnection::FrameConnection() : application_connection_(nullptr) { | 48 FrameConnection::FrameConnection() : application_connection_(nullptr) { |
49 } | 49 } |
50 | 50 |
51 FrameConnection::~FrameConnection() { | 51 FrameConnection::~FrameConnection() { |
52 } | 52 } |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 test_runner_interfaces.Pass()); | 102 test_runner_interfaces.Pass()); |
103 | 103 |
104 #if defined(OS_LINUX) && !defined(OS_ANDROID) | 104 #if defined(OS_LINUX) && !defined(OS_ANDROID) |
105 mojo::Array<mojo::String> font_service_interfaces; | 105 mojo::Array<mojo::String> font_service_interfaces; |
106 font_service_interfaces.push_back(font_service::FontService::Name_); | 106 font_service_interfaces.push_back(font_service::FontService::Name_); |
107 filter->filter.insert("mojo:font_service", font_service_interfaces.Pass()); | 107 filter->filter.insert("mojo:font_service", font_service_interfaces.Pass()); |
108 #endif | 108 #endif |
109 | 109 |
110 application_connection_ = app->ConnectToApplicationWithCapabilityFilter( | 110 application_connection_ = app->ConnectToApplicationWithCapabilityFilter( |
111 request.Pass(), filter.Pass()); | 111 request.Pass(), filter.Pass()); |
112 application_connection_->ConnectToService(&frame_tree_client_); | 112 application_connection_->ConnectToService(&frame_client_); |
113 application_connection_->AddContentHandlerIDCallback(on_got_id_callback); | 113 application_connection_->AddContentHandlerIDCallback(on_got_id_callback); |
114 } | 114 } |
115 | 115 |
116 mojo::ViewTreeClientPtr FrameConnection::GetViewTreeClient() { | 116 mojo::ViewTreeClientPtr FrameConnection::GetViewTreeClient() { |
117 DCHECK(application_connection_); | 117 DCHECK(application_connection_); |
118 mojo::ViewTreeClientPtr view_tree_client; | 118 mojo::ViewTreeClientPtr view_tree_client; |
119 application_connection_->ConnectToService(&view_tree_client); | 119 application_connection_->ConnectToService(&view_tree_client); |
120 return view_tree_client.Pass(); | 120 return view_tree_client.Pass(); |
121 } | 121 } |
122 | 122 |
123 uint32_t FrameConnection::GetContentHandlerID() const { | 123 uint32_t FrameConnection::GetContentHandlerID() const { |
124 uint32_t content_handler_id = mojo::Shell::kInvalidContentHandlerID; | 124 uint32_t content_handler_id = mojo::Shell::kInvalidContentHandlerID; |
125 if (!application_connection_->GetContentHandlerID(&content_handler_id)) | 125 if (!application_connection_->GetContentHandlerID(&content_handler_id)) |
126 NOTREACHED(); | 126 NOTREACHED(); |
127 return content_handler_id; | 127 return content_handler_id; |
128 } | 128 } |
129 | 129 |
130 } // namespace web_view | 130 } // namespace web_view |
OLD | NEW |