| 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 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1125 tab_strip_model->GetIndexOfWebContents(main_web_contents_)); | 1125 tab_strip_model->GetIndexOfWebContents(main_web_contents_)); |
| 1126 browser_ = NULL; | 1126 browser_ = NULL; |
| 1127 } else if (!dock_requested && was_docked) { | 1127 } else if (!dock_requested && was_docked) { |
| 1128 UpdateBrowserWindow(); | 1128 UpdateBrowserWindow(); |
| 1129 } | 1129 } |
| 1130 | 1130 |
| 1131 Show(DevToolsToggleAction::Show()); | 1131 Show(DevToolsToggleAction::Show()); |
| 1132 } | 1132 } |
| 1133 | 1133 |
| 1134 void DevToolsWindow::OpenInNewTab(const std::string& url) { | 1134 void DevToolsWindow::OpenInNewTab(const std::string& url) { |
| 1135 content::OpenURLParams params( | 1135 content::OpenURLParams params(GURL(url), content::Referrer(), |
| 1136 GURL(url), content::Referrer(), NEW_FOREGROUND_TAB, | 1136 WindowOpenDisposition::NEW_FOREGROUND_TAB, |
| 1137 ui::PAGE_TRANSITION_LINK, false); | 1137 ui::PAGE_TRANSITION_LINK, false); |
| 1138 WebContents* inspected_web_contents = GetInspectedWebContents(); | 1138 WebContents* inspected_web_contents = GetInspectedWebContents(); |
| 1139 if (!inspected_web_contents || !inspected_web_contents->OpenURL(params)) { | 1139 if (!inspected_web_contents || !inspected_web_contents->OpenURL(params)) { |
| 1140 chrome::ScopedTabbedBrowserDisplayer displayer(profile_); | 1140 chrome::ScopedTabbedBrowserDisplayer displayer(profile_); |
| 1141 chrome::AddSelectedTabWithURL(displayer.browser(), GURL(url), | 1141 chrome::AddSelectedTabWithURL(displayer.browser(), GURL(url), |
| 1142 ui::PAGE_TRANSITION_LINK); | 1142 ui::PAGE_TRANSITION_LINK); |
| 1143 } | 1143 } |
| 1144 } | 1144 } |
| 1145 | 1145 |
| 1146 void DevToolsWindow::SetWhitelistedShortcuts( | 1146 void DevToolsWindow::SetWhitelistedShortcuts( |
| 1147 const std::string& message) { | 1147 const std::string& message) { |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1321 bool DevToolsWindow::ReloadInspectedWebContents(bool bypass_cache) { | 1321 bool DevToolsWindow::ReloadInspectedWebContents(bool bypass_cache) { |
| 1322 // Only route reload via front-end if the agent is attached. | 1322 // Only route reload via front-end if the agent is attached. |
| 1323 WebContents* wc = GetInspectedWebContents(); | 1323 WebContents* wc = GetInspectedWebContents(); |
| 1324 if (!wc || wc->GetCrashedStatus() != base::TERMINATION_STATUS_STILL_RUNNING) | 1324 if (!wc || wc->GetCrashedStatus() != base::TERMINATION_STATUS_STILL_RUNNING) |
| 1325 return false; | 1325 return false; |
| 1326 base::FundamentalValue bypass_cache_value(bypass_cache); | 1326 base::FundamentalValue bypass_cache_value(bypass_cache); |
| 1327 bindings_->CallClientFunction("DevToolsAPI.reloadInspectedPage", | 1327 bindings_->CallClientFunction("DevToolsAPI.reloadInspectedPage", |
| 1328 &bypass_cache_value, nullptr, nullptr); | 1328 &bypass_cache_value, nullptr, nullptr); |
| 1329 return true; | 1329 return true; |
| 1330 } | 1330 } |
| OLD | NEW |