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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js

Issue 2645723002: [DevTools] use command line API during selection evaluation in console (Closed)
Patch Set: addressed comments Created 3 years, 11 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
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/sdk/ConsoleModel.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2011 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after
950 * @param {!SDK.RemoteObject} global 950 * @param {!SDK.RemoteObject} global
951 * @param {?SDK.RemoteObject} result 951 * @param {?SDK.RemoteObject} result
952 * @param {boolean=} wasThrown 952 * @param {boolean=} wasThrown
953 */ 953 */
954 function didSave(global, result, wasThrown) { 954 function didSave(global, result, wasThrown) {
955 global.release(); 955 global.release();
956 if (wasThrown || !result || result.type !== 'string') { 956 if (wasThrown || !result || result.type !== 'string') {
957 failedToSave(result); 957 failedToSave(result);
958 } else { 958 } else {
959 SDK.ConsoleModel.evaluateCommandInConsole( 959 SDK.ConsoleModel.evaluateCommandInConsole(
960 /** @type {!SDK.ExecutionContext} */ (currentExecutionContext), resu lt.value); 960 /** @type {!SDK.ExecutionContext} */ (currentExecutionContext), resu lt.value,
961 /* useCommandLineAPI */ false);
961 } 962 }
962 } 963 }
963 964
964 /** 965 /**
965 * @param {?SDK.RemoteObject} result 966 * @param {?SDK.RemoteObject} result
966 */ 967 */
967 function failedToSave(result) { 968 function failedToSave(result) {
968 var message = Common.UIString('Failed to save to temp variable.'); 969 var message = Common.UIString('Failed to save to temp variable.');
969 if (result) { 970 if (result) {
970 message += ' ' + result.description; 971 message += ' ' + result.description;
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
1260 return true; 1261 return true;
1261 case 'debugger.toggle-breakpoints-active': 1262 case 'debugger.toggle-breakpoints-active':
1262 panel._toggleBreakpointsActive(); 1263 panel._toggleBreakpointsActive();
1263 return true; 1264 return true;
1264 case 'debugger.evaluate-selection': 1265 case 'debugger.evaluate-selection':
1265 var frame = UI.context.flavor(SourceFrame.UISourceCodeFrame); 1266 var frame = UI.context.flavor(SourceFrame.UISourceCodeFrame);
1266 if (frame) { 1267 if (frame) {
1267 var text = frame.textEditor.text(frame.textEditor.selection()); 1268 var text = frame.textEditor.text(frame.textEditor.selection());
1268 var executionContext = UI.context.flavor(SDK.ExecutionContext); 1269 var executionContext = UI.context.flavor(SDK.ExecutionContext);
1269 if (executionContext) 1270 if (executionContext)
1270 SDK.ConsoleModel.evaluateCommandInConsole(executionContext, text); 1271 SDK.ConsoleModel.evaluateCommandInConsole(executionContext, text, /* useCommandLineAPI */ true);
1271 } 1272 }
1272 return true; 1273 return true;
1273 } 1274 }
1274 return false; 1275 return false;
1275 } 1276 }
1276 }; 1277 };
1277 1278
1278 1279
1279 /** 1280 /**
1280 * @unrestricted 1281 * @unrestricted
(...skipping 29 matching lines...) Expand all
1310 */ 1311 */
1311 willHide() { 1312 willHide() {
1312 UI.inspectorView.setDrawerMinimized(false); 1313 UI.inspectorView.setDrawerMinimized(false);
1313 setImmediate(() => Sources.SourcesPanel.updateResizerAndSidebarButtons(Sourc es.SourcesPanel.instance())); 1314 setImmediate(() => Sources.SourcesPanel.updateResizerAndSidebarButtons(Sourc es.SourcesPanel.instance()));
1314 } 1315 }
1315 1316
1316 _showViewInWrapper() { 1317 _showViewInWrapper() {
1317 this._view.show(this.element); 1318 this._view.show(this.element);
1318 } 1319 }
1319 }; 1320 };
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/sdk/ConsoleModel.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698