OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/test/chromedriver/chrome/chrome_impl.h" | 5 #include "chrome/test/chromedriver/chrome/chrome_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "chrome/test/chromedriver/chrome/devtools_client.h" | 10 #include "chrome/test/chromedriver/chrome/devtools_client.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 for (ScopedVector<DevToolsEventListener>::const_iterator listener = | 103 for (ScopedVector<DevToolsEventListener>::const_iterator listener = |
104 devtools_event_listeners_.begin(); | 104 devtools_event_listeners_.begin(); |
105 listener != devtools_event_listeners_.end(); ++listener) { | 105 listener != devtools_event_listeners_.end(); ++listener) { |
106 client->AddListener(*listener); | 106 client->AddListener(*listener); |
107 // OnConnected will fire when DevToolsClient connects later. | 107 // OnConnected will fire when DevToolsClient connects later. |
108 } | 108 } |
109 CHECK(!page_load_strategy_.empty()); | 109 CHECK(!page_load_strategy_.empty()); |
110 web_views_.push_back(make_linked_ptr(new WebViewImpl( | 110 web_views_.push_back(make_linked_ptr(new WebViewImpl( |
111 view.id, w3c_compliant, devtools_http_client_->browser_info(), | 111 view.id, w3c_compliant, devtools_http_client_->browser_info(), |
112 std::move(client), devtools_http_client_->device_metrics(), | 112 std::move(client), devtools_http_client_->device_metrics(), |
113 page_load_strategy_))); | 113 page_load_strategy_, devtools_http_client_->user_agent()))); |
114 } | 114 } |
115 } | 115 } |
116 } | 116 } |
117 } | 117 } |
118 | 118 |
119 Status ChromeImpl::GetWebViewById(const std::string& id, WebView** web_view) { | 119 Status ChromeImpl::GetWebViewById(const std::string& id, WebView** web_view) { |
120 for (WebViewList::iterator it = web_views_.begin(); | 120 for (WebViewList::iterator it = web_views_.begin(); |
121 it != web_views_.end(); ++it) { | 121 it != web_views_.end(); ++it) { |
122 if ((*it)->GetId() == id) { | 122 if ((*it)->GetId() == id) { |
123 *web_view = (*it).get(); | 123 *web_view = (*it).get(); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 ScopedVector<DevToolsEventListener>& devtools_event_listeners, | 171 ScopedVector<DevToolsEventListener>& devtools_event_listeners, |
172 std::unique_ptr<PortReservation> port_reservation, | 172 std::unique_ptr<PortReservation> port_reservation, |
173 std::string page_load_strategy) | 173 std::string page_load_strategy) |
174 : quit_(false), | 174 : quit_(false), |
175 devtools_http_client_(std::move(http_client)), | 175 devtools_http_client_(std::move(http_client)), |
176 devtools_websocket_client_(std::move(websocket_client)), | 176 devtools_websocket_client_(std::move(websocket_client)), |
177 port_reservation_(std::move(port_reservation)), | 177 port_reservation_(std::move(port_reservation)), |
178 page_load_strategy_(page_load_strategy) { | 178 page_load_strategy_(page_load_strategy) { |
179 devtools_event_listeners_.swap(devtools_event_listeners); | 179 devtools_event_listeners_.swap(devtools_event_listeners); |
180 } | 180 } |
OLD | NEW |