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/browser/devtools/devtools_window.h" | 5 #include "chrome/browser/devtools/devtools_window.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 bool shared_worker_frontend, | 749 bool shared_worker_frontend, |
750 const std::string& remote_frontend, | 750 const std::string& remote_frontend, |
751 bool can_dock, | 751 bool can_dock, |
752 const std::string& settings) { | 752 const std::string& settings) { |
753 // Compatibility errors are encoded with data urls, pass them | 753 // Compatibility errors are encoded with data urls, pass them |
754 // through with no decoration. | 754 // through with no decoration. |
755 if (base_url.SchemeIs("data")) | 755 if (base_url.SchemeIs("data")) |
756 return base_url; | 756 return base_url; |
757 | 757 |
758 std::string frontend_url( | 758 std::string frontend_url( |
759 base_url.is_empty() ? chrome::kChromeUIDevToolsURL : base_url.spec()); | 759 !remote_frontend.empty() ? |
| 760 remote_frontend : |
| 761 base_url.is_empty() ? chrome::kChromeUIDevToolsURL : base_url.spec()); |
760 std::string url_string( | 762 std::string url_string( |
761 frontend_url + | 763 frontend_url + |
762 ((frontend_url.find("?") == std::string::npos) ? "?" : "&")); | 764 ((frontend_url.find("?") == std::string::npos) ? "?" : "&")); |
763 if (shared_worker_frontend) | 765 if (shared_worker_frontend) |
764 url_string += "&isSharedWorker=true"; | 766 url_string += "&isSharedWorker=true"; |
765 if (remote_frontend.size()) { | 767 if (remote_frontend.size()) { |
766 url_string += "&remoteFrontend=true"; | 768 url_string += "&remoteFrontend=true"; |
767 url_string += "&remoteFrontendUrl=" + net::EscapePath(remote_frontend); | |
768 } else { | 769 } else { |
769 url_string += "&remoteBase=" + DevToolsUI::GetRemoteBaseURL().spec(); | 770 url_string += "&remoteBase=" + DevToolsUI::GetRemoteBaseURL().spec(); |
770 } | 771 } |
771 if (can_dock) | 772 if (can_dock) |
772 url_string += "&can_dock=true"; | 773 url_string += "&can_dock=true"; |
773 if (settings.size()) | 774 if (settings.size()) |
774 url_string += "&settings=" + settings; | 775 url_string += "&settings=" + settings; |
775 return GURL(url_string); | 776 return GURL(url_string); |
776 } | 777 } |
777 | 778 |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1203 closure.Run(); | 1204 closure.Run(); |
1204 return; | 1205 return; |
1205 } | 1206 } |
1206 load_completed_callback_ = closure; | 1207 load_completed_callback_ = closure; |
1207 } | 1208 } |
1208 | 1209 |
1209 bool DevToolsWindow::ForwardKeyboardEvent( | 1210 bool DevToolsWindow::ForwardKeyboardEvent( |
1210 const content::NativeWebKeyboardEvent& event) { | 1211 const content::NativeWebKeyboardEvent& event) { |
1211 return event_forwarder_->ForwardEvent(event); | 1212 return event_forwarder_->ForwardEvent(event); |
1212 } | 1213 } |
OLD | NEW |