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

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

Issue 1433953002: Implement a ShowSecurityPanel() call in the browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-implement showConsole using showPanel. Created 5 years, 1 month 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 1178 matching lines...) Expand 10 before | Expand all | Expand 10 after
1189 BrowserWindow* DevToolsWindow::GetInspectedBrowserWindow() { 1189 BrowserWindow* DevToolsWindow::GetInspectedBrowserWindow() {
1190 Browser* browser = NULL; 1190 Browser* browser = NULL;
1191 int tab; 1191 int tab;
1192 return FindInspectedBrowserAndTabIndex(GetInspectedWebContents(), 1192 return FindInspectedBrowserAndTabIndex(GetInspectedWebContents(),
1193 &browser, &tab) ? 1193 &browser, &tab) ?
1194 browser->window() : NULL; 1194 browser->window() : NULL;
1195 } 1195 }
1196 1196
1197 void DevToolsWindow::DoAction(const DevToolsToggleAction& action) { 1197 void DevToolsWindow::DoAction(const DevToolsToggleAction& action) {
1198 switch (action.type()) { 1198 switch (action.type()) {
1199 case DevToolsToggleAction::kShowConsole: 1199 case DevToolsToggleAction::kShowConsole: {
1200 bindings_->CallClientFunction( 1200 base::StringValue panel_name("console");
1201 "DevToolsAPI.showConsole", NULL, NULL, NULL); 1201 bindings_->CallClientFunction("DevToolsAPI.showPanel", &panel_name, NULL,
1202 NULL);
1202 break; 1203 break;
1203 1204 }
1205 case DevToolsToggleAction::kShowSecurityPanel: {
1206 base::StringValue panel_name("security");
1207 bindings_->CallClientFunction("DevToolsAPI.showPanel", &panel_name, NULL,
1208 NULL);
1209 break;
1210 }
1204 case DevToolsToggleAction::kInspect: 1211 case DevToolsToggleAction::kInspect:
1205 bindings_->CallClientFunction( 1212 bindings_->CallClientFunction(
1206 "DevToolsAPI.enterInspectElementMode", NULL, NULL, NULL); 1213 "DevToolsAPI.enterInspectElementMode", NULL, NULL, NULL);
1207 break; 1214 break;
1208 1215
1209 case DevToolsToggleAction::kShow: 1216 case DevToolsToggleAction::kShow:
1210 case DevToolsToggleAction::kToggle: 1217 case DevToolsToggleAction::kToggle:
1211 // Do nothing. 1218 // Do nothing.
1212 break; 1219 break;
1213 1220
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
1273 bool DevToolsWindow::ReloadInspectedWebContents(bool ignore_cache) { 1280 bool DevToolsWindow::ReloadInspectedWebContents(bool ignore_cache) {
1274 // Only route reload via front-end if the agent is attached. 1281 // Only route reload via front-end if the agent is attached.
1275 WebContents* wc = GetInspectedWebContents(); 1282 WebContents* wc = GetInspectedWebContents();
1276 if (!wc || wc->GetCrashedStatus() != base::TERMINATION_STATUS_STILL_RUNNING) 1283 if (!wc || wc->GetCrashedStatus() != base::TERMINATION_STATUS_STILL_RUNNING)
1277 return false; 1284 return false;
1278 base::FundamentalValue ignore_cache_value(ignore_cache); 1285 base::FundamentalValue ignore_cache_value(ignore_cache);
1279 bindings_->CallClientFunction("DevToolsAPI.reloadInspectedPage", 1286 bindings_->CallClientFunction("DevToolsAPI.reloadInspectedPage",
1280 &ignore_cache_value, nullptr, nullptr); 1287 &ignore_cache_value, nullptr, nullptr);
1281 return true; 1288 return true;
1282 } 1289 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698