| 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/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| (...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 938 | 938 |
| 939 WebContents* DevToolsWindow::OpenURLFromTab( | 939 WebContents* DevToolsWindow::OpenURLFromTab( |
| 940 WebContents* source, | 940 WebContents* source, |
| 941 const content::OpenURLParams& params) { | 941 const content::OpenURLParams& params) { |
| 942 DCHECK(source == main_web_contents_); | 942 DCHECK(source == main_web_contents_); |
| 943 if (!params.url.SchemeIs(content::kChromeDevToolsScheme)) { | 943 if (!params.url.SchemeIs(content::kChromeDevToolsScheme)) { |
| 944 WebContents* inspected_web_contents = GetInspectedWebContents(); | 944 WebContents* inspected_web_contents = GetInspectedWebContents(); |
| 945 return inspected_web_contents ? | 945 return inspected_web_contents ? |
| 946 inspected_web_contents->OpenURL(params) : NULL; | 946 inspected_web_contents->OpenURL(params) : NULL; |
| 947 } | 947 } |
| 948 | 948 bindings_->Reload(); |
| 949 bindings_->Reattach(); | |
| 950 | |
| 951 content::NavigationController::LoadURLParams load_url_params(params.url); | |
| 952 main_web_contents_->GetController().LoadURLWithParams(load_url_params); | |
| 953 return main_web_contents_; | 949 return main_web_contents_; |
| 954 } | 950 } |
| 955 | 951 |
| 956 void DevToolsWindow::ShowCertificateViewer( | 952 void DevToolsWindow::ShowCertificateViewer( |
| 957 scoped_refptr<net::X509Certificate> certificate) { | 953 scoped_refptr<net::X509Certificate> certificate) { |
| 958 WebContents* inspected_contents = is_docked_ ? | 954 WebContents* inspected_contents = is_docked_ ? |
| 959 GetInspectedWebContents() : main_web_contents_; | 955 GetInspectedWebContents() : main_web_contents_; |
| 960 Browser* browser = NULL; | 956 Browser* browser = NULL; |
| 961 int tab = 0; | 957 int tab = 0; |
| 962 if (!FindInspectedBrowserAndTabIndex(inspected_contents, &browser, &tab)) | 958 if (!FindInspectedBrowserAndTabIndex(inspected_contents, &browser, &tab)) |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1376 bool DevToolsWindow::ReloadInspectedWebContents(bool bypass_cache) { | 1372 bool DevToolsWindow::ReloadInspectedWebContents(bool bypass_cache) { |
| 1377 // Only route reload via front-end if the agent is attached. | 1373 // Only route reload via front-end if the agent is attached. |
| 1378 WebContents* wc = GetInspectedWebContents(); | 1374 WebContents* wc = GetInspectedWebContents(); |
| 1379 if (!wc || wc->GetCrashedStatus() != base::TERMINATION_STATUS_STILL_RUNNING) | 1375 if (!wc || wc->GetCrashedStatus() != base::TERMINATION_STATUS_STILL_RUNNING) |
| 1380 return false; | 1376 return false; |
| 1381 base::FundamentalValue bypass_cache_value(bypass_cache); | 1377 base::FundamentalValue bypass_cache_value(bypass_cache); |
| 1382 bindings_->CallClientFunction("DevToolsAPI.reloadInspectedPage", | 1378 bindings_->CallClientFunction("DevToolsAPI.reloadInspectedPage", |
| 1383 &bypass_cache_value, nullptr, nullptr); | 1379 &bypass_cache_value, nullptr, nullptr); |
| 1384 return true; | 1380 return true; |
| 1385 } | 1381 } |
| OLD | NEW |