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 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
994 | 994 |
995 WebContents* inspected_web_contents = GetInspectedWebContents(); | 995 WebContents* inspected_web_contents = GetInspectedWebContents(); |
996 if (inspected_web_contents) { | 996 if (inspected_web_contents) { |
997 inspected_web_contents->GetDelegate()->AddNewContents( | 997 inspected_web_contents->GetDelegate()->AddNewContents( |
998 source, new_contents, disposition, initial_rect, user_gesture, | 998 source, new_contents, disposition, initial_rect, user_gesture, |
999 was_blocked); | 999 was_blocked); |
1000 } | 1000 } |
1001 } | 1001 } |
1002 | 1002 |
1003 void DevToolsWindow::WebContentsCreated(WebContents* source_contents, | 1003 void DevToolsWindow::WebContentsCreated(WebContents* source_contents, |
| 1004 int opener_render_process_id, |
1004 int opener_render_frame_id, | 1005 int opener_render_frame_id, |
1005 const std::string& frame_name, | 1006 const std::string& frame_name, |
1006 const GURL& target_url, | 1007 const GURL& target_url, |
1007 WebContents* new_contents) { | 1008 WebContents* new_contents) { |
1008 if (target_url.SchemeIs(content::kChromeDevToolsScheme) && | 1009 if (target_url.SchemeIs(content::kChromeDevToolsScheme) && |
1009 target_url.path().rfind("toolbox.html") != std::string::npos) { | 1010 target_url.path().rfind("toolbox.html") != std::string::npos) { |
1010 CHECK(can_dock_); | 1011 CHECK(can_dock_); |
1011 if (toolbox_web_contents_) | 1012 if (toolbox_web_contents_) |
1012 delete toolbox_web_contents_; | 1013 delete toolbox_web_contents_; |
1013 toolbox_web_contents_ = new_contents; | 1014 toolbox_web_contents_ = new_contents; |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1370 bool DevToolsWindow::ReloadInspectedWebContents(bool bypass_cache) { | 1371 bool DevToolsWindow::ReloadInspectedWebContents(bool bypass_cache) { |
1371 // Only route reload via front-end if the agent is attached. | 1372 // Only route reload via front-end if the agent is attached. |
1372 WebContents* wc = GetInspectedWebContents(); | 1373 WebContents* wc = GetInspectedWebContents(); |
1373 if (!wc || wc->GetCrashedStatus() != base::TERMINATION_STATUS_STILL_RUNNING) | 1374 if (!wc || wc->GetCrashedStatus() != base::TERMINATION_STATUS_STILL_RUNNING) |
1374 return false; | 1375 return false; |
1375 base::FundamentalValue bypass_cache_value(bypass_cache); | 1376 base::FundamentalValue bypass_cache_value(bypass_cache); |
1376 bindings_->CallClientFunction("DevToolsAPI.reloadInspectedPage", | 1377 bindings_->CallClientFunction("DevToolsAPI.reloadInspectedPage", |
1377 &bypass_cache_value, nullptr, nullptr); | 1378 &bypass_cache_value, nullptr, nullptr); |
1378 return true; | 1379 return true; |
1379 } | 1380 } |
OLD | NEW |