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

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

Issue 2751173003: [DevTools] Turn ConsoleModel into a singleton (Closed)
Patch Set: rebased Created 3 years, 9 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
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 938 matching lines...) Expand 10 before | Expand all | Expand 10 after
949 /** 949 /**
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 /* useCommandLineAPI */ false);
962 } 962 }
963 } 963 }
964 964
965 /** 965 /**
966 * @param {?SDK.RemoteObject} result 966 * @param {?SDK.RemoteObject} result
967 */ 967 */
968 function failedToSave(result) { 968 function failedToSave(result) {
969 var message = Common.UIString('Failed to save to temp variable.'); 969 var message = Common.UIString('Failed to save to temp variable.');
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
1261 return true; 1261 return true;
1262 case 'debugger.toggle-breakpoints-active': 1262 case 'debugger.toggle-breakpoints-active':
1263 panel._toggleBreakpointsActive(); 1263 panel._toggleBreakpointsActive();
1264 return true; 1264 return true;
1265 case 'debugger.evaluate-selection': 1265 case 'debugger.evaluate-selection':
1266 var frame = UI.context.flavor(SourceFrame.UISourceCodeFrame); 1266 var frame = UI.context.flavor(SourceFrame.UISourceCodeFrame);
1267 if (frame) { 1267 if (frame) {
1268 var text = frame.textEditor.text(frame.textEditor.selection()); 1268 var text = frame.textEditor.text(frame.textEditor.selection());
1269 var executionContext = UI.context.flavor(SDK.ExecutionContext); 1269 var executionContext = UI.context.flavor(SDK.ExecutionContext);
1270 if (executionContext) 1270 if (executionContext)
1271 SDK.ConsoleModel.evaluateCommandInConsole(executionContext, text, /* useCommandLineAPI */ true); 1271 SDK.consoleModel.evaluateCommandInConsole(executionContext, text, /* useCommandLineAPI */ true);
1272 } 1272 }
1273 return true; 1273 return true;
1274 } 1274 }
1275 return false; 1275 return false;
1276 } 1276 }
1277 }; 1277 };
1278 1278
1279 1279
1280 /** 1280 /**
1281 * @unrestricted 1281 * @unrestricted
(...skipping 29 matching lines...) Expand all
1311 */ 1311 */
1312 willHide() { 1312 willHide() {
1313 UI.inspectorView.setDrawerMinimized(false); 1313 UI.inspectorView.setDrawerMinimized(false);
1314 setImmediate(() => Sources.SourcesPanel.updateResizerAndSidebarButtons(Sourc es.SourcesPanel.instance())); 1314 setImmediate(() => Sources.SourcesPanel.updateResizerAndSidebarButtons(Sourc es.SourcesPanel.instance()));
1315 } 1315 }
1316 1316
1317 _showViewInWrapper() { 1317 _showViewInWrapper() {
1318 this._view.show(this.element); 1318 this._view.show(this.element);
1319 } 1319 }
1320 }; 1320 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698