Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: chrome/browser/devtools/devtools_window.cc

Issue 2421913003: DevTools: allow reattaching main target live. (Closed)
Patch Set: same Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 928 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
949 bindings_->Reattach(); 949 bindings_->Reload();
950
951 content::NavigationController::LoadURLParams load_url_params(params.url); 950 content::NavigationController::LoadURLParams load_url_params(params.url);
952 main_web_contents_->GetController().LoadURLWithParams(load_url_params); 951 main_web_contents_->GetController().LoadURLWithParams(load_url_params);
dgozman 2016/10/15 00:26:26 Remove.
953 return main_web_contents_; 952 return main_web_contents_;
954 } 953 }
955 954
956 void DevToolsWindow::ShowCertificateViewer( 955 void DevToolsWindow::ShowCertificateViewer(
957 scoped_refptr<net::X509Certificate> certificate) { 956 scoped_refptr<net::X509Certificate> certificate) {
958 WebContents* inspected_contents = is_docked_ ? 957 WebContents* inspected_contents = is_docked_ ?
959 GetInspectedWebContents() : main_web_contents_; 958 GetInspectedWebContents() : main_web_contents_;
960 Browser* browser = NULL; 959 Browser* browser = NULL;
961 int tab = 0; 960 int tab = 0;
962 if (!FindInspectedBrowserAndTabIndex(inspected_contents, &browser, &tab)) 961 if (!FindInspectedBrowserAndTabIndex(inspected_contents, &browser, &tab))
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
1376 bool DevToolsWindow::ReloadInspectedWebContents(bool bypass_cache) { 1375 bool DevToolsWindow::ReloadInspectedWebContents(bool bypass_cache) {
1377 // Only route reload via front-end if the agent is attached. 1376 // Only route reload via front-end if the agent is attached.
1378 WebContents* wc = GetInspectedWebContents(); 1377 WebContents* wc = GetInspectedWebContents();
1379 if (!wc || wc->GetCrashedStatus() != base::TERMINATION_STATUS_STILL_RUNNING) 1378 if (!wc || wc->GetCrashedStatus() != base::TERMINATION_STATUS_STILL_RUNNING)
1380 return false; 1379 return false;
1381 base::FundamentalValue bypass_cache_value(bypass_cache); 1380 base::FundamentalValue bypass_cache_value(bypass_cache);
1382 bindings_->CallClientFunction("DevToolsAPI.reloadInspectedPage", 1381 bindings_->CallClientFunction("DevToolsAPI.reloadInspectedPage",
1383 &bypass_cache_value, nullptr, nullptr); 1382 &bypass_cache_value, nullptr, nullptr);
1384 return true; 1383 return true;
1385 } 1384 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698