| 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 1286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1297 } | 1297 } |
| 1298 | 1298 |
| 1299 void DevToolsWindow::DoAction(const DevToolsToggleAction& action) { | 1299 void DevToolsWindow::DoAction(const DevToolsToggleAction& action) { |
| 1300 switch (action.type()) { | 1300 switch (action.type()) { |
| 1301 case DevToolsToggleAction::kShowConsole: { | 1301 case DevToolsToggleAction::kShowConsole: { |
| 1302 base::StringValue panel_name("console"); | 1302 base::StringValue panel_name("console"); |
| 1303 bindings_->CallClientFunction("DevToolsAPI.showPanel", &panel_name, NULL, | 1303 bindings_->CallClientFunction("DevToolsAPI.showPanel", &panel_name, NULL, |
| 1304 NULL); | 1304 NULL); |
| 1305 break; | 1305 break; |
| 1306 } | 1306 } |
| 1307 case DevToolsToggleAction::kShowSecurityPanel: { | |
| 1308 base::StringValue panel_name("security"); | |
| 1309 bindings_->CallClientFunction("DevToolsAPI.showPanel", &panel_name, NULL, | |
| 1310 NULL); | |
| 1311 break; | |
| 1312 } | |
| 1313 case DevToolsToggleAction::kInspect: | 1307 case DevToolsToggleAction::kInspect: |
| 1314 bindings_->CallClientFunction( | 1308 bindings_->CallClientFunction( |
| 1315 "DevToolsAPI.enterInspectElementMode", NULL, NULL, NULL); | 1309 "DevToolsAPI.enterInspectElementMode", NULL, NULL, NULL); |
| 1316 break; | 1310 break; |
| 1317 | 1311 |
| 1318 case DevToolsToggleAction::kShow: | 1312 case DevToolsToggleAction::kShow: |
| 1319 case DevToolsToggleAction::kToggle: | 1313 case DevToolsToggleAction::kToggle: |
| 1320 // Do nothing. | 1314 // Do nothing. |
| 1321 break; | 1315 break; |
| 1322 | 1316 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1382 bool DevToolsWindow::ReloadInspectedWebContents(bool bypass_cache) { | 1376 bool DevToolsWindow::ReloadInspectedWebContents(bool bypass_cache) { |
| 1383 // Only route reload via front-end if the agent is attached. | 1377 // Only route reload via front-end if the agent is attached. |
| 1384 WebContents* wc = GetInspectedWebContents(); | 1378 WebContents* wc = GetInspectedWebContents(); |
| 1385 if (!wc || wc->GetCrashedStatus() != base::TERMINATION_STATUS_STILL_RUNNING) | 1379 if (!wc || wc->GetCrashedStatus() != base::TERMINATION_STATUS_STILL_RUNNING) |
| 1386 return false; | 1380 return false; |
| 1387 base::FundamentalValue bypass_cache_value(bypass_cache); | 1381 base::FundamentalValue bypass_cache_value(bypass_cache); |
| 1388 bindings_->CallClientFunction("DevToolsAPI.reloadInspectedPage", | 1382 bindings_->CallClientFunction("DevToolsAPI.reloadInspectedPage", |
| 1389 &bypass_cache_value, nullptr, nullptr); | 1383 &bypass_cache_value, nullptr, nullptr); |
| 1390 return true; | 1384 return true; |
| 1391 } | 1385 } |
| OLD | NEW |