| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/devtools_http_client.h" | 5 #include "chrome/test/chromedriver/chrome/devtools_http_client.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 return &browser_info_; | 153 return &browser_info_; |
| 154 } | 154 } |
| 155 | 155 |
| 156 const DeviceMetrics* DevToolsHttpClient::device_metrics() { | 156 const DeviceMetrics* DevToolsHttpClient::device_metrics() { |
| 157 return device_metrics_.get(); | 157 return device_metrics_.get(); |
| 158 } | 158 } |
| 159 | 159 |
| 160 bool DevToolsHttpClient::IsBrowserWindow(const WebViewInfo& view) const { | 160 bool DevToolsHttpClient::IsBrowserWindow(const WebViewInfo& view) const { |
| 161 return base::ContainsKey(*window_types_, view.type) || | 161 return base::ContainsKey(*window_types_, view.type) || |
| 162 (view.type == WebViewInfo::kOther && | 162 (view.type == WebViewInfo::kOther && |
| 163 (base::StartsWith(view.url, "chrome-extension://", | 163 (view.url == "chrome://print/" || |
| 164 base::CompareCase::SENSITIVE) || | |
| 165 view.url == "chrome://print/" || | |
| 166 view.url == "chrome://media-router/")); | 164 view.url == "chrome://media-router/")); |
| 167 } | 165 } |
| 168 | 166 |
| 169 Status DevToolsHttpClient::CloseFrontends(const std::string& for_client_id) { | 167 Status DevToolsHttpClient::CloseFrontends(const std::string& for_client_id) { |
| 170 WebViewsInfo views_info; | 168 WebViewsInfo views_info; |
| 171 Status status = GetWebViewsInfo(&views_info); | 169 Status status = GetWebViewsInfo(&views_info); |
| 172 if (status.IsError()) | 170 if (status.IsError()) |
| 173 return status; | 171 return status; |
| 174 | 172 |
| 175 // Close frontends. Usually frontends are docked in the same page, although | 173 // Close frontends. Usually frontends are docked in the same page, although |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 Status status = ParseType(type_as_string, &type); | 304 Status status = ParseType(type_as_string, &type); |
| 307 if (status.IsError()) | 305 if (status.IsError()) |
| 308 return status; | 306 return status; |
| 309 temp_views_info.push_back(WebViewInfo(id, debugger_url, url, type)); | 307 temp_views_info.push_back(WebViewInfo(id, debugger_url, url, type)); |
| 310 } | 308 } |
| 311 *views_info = WebViewsInfo(temp_views_info); | 309 *views_info = WebViewsInfo(temp_views_info); |
| 312 return Status(kOk); | 310 return Status(kOk); |
| 313 } | 311 } |
| 314 | 312 |
| 315 } // namespace internal | 313 } // namespace internal |
| OLD | NEW |