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

Unified Diff: Source/devtools/front_end/console/ConsoleView.js

Issue 1273363002: Devtools UI: Show multiple shortcuts, show more shortcuts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/console/ConsoleView.js
diff --git a/Source/devtools/front_end/console/ConsoleView.js b/Source/devtools/front_end/console/ConsoleView.js
index bf465f50cec16026ef4359137da0581c744dafa5..31c69dff3c754f63e7683410ec17c21717b4d8a7 100644
--- a/Source/devtools/front_end/console/ConsoleView.js
+++ b/Source/devtools/front_end/console/ConsoleView.js
@@ -59,7 +59,7 @@ WebInspector.ConsoleView = function()
this._regexMatchRanges = [];
this._clearConsoleButton = new WebInspector.ToolbarButton(WebInspector.UIString("Clear console log"), "clear-toolbar-item");
- this._clearConsoleButton.addEventListener("click", this._requestClearMessages, this);
+ this._clearConsoleButton.setAction("console.clear");
pfeldman 2015/08/17 19:22:49 I think you should build it from the action and if
this._executionContextComboBox = new WebInspector.ToolbarComboBox(null, "console-context");
this._executionContextComboBox.setMaxWidth(200);
@@ -579,7 +579,7 @@ WebInspector.ConsoleView.prototype = {
unhideAll.setEnabled(hasFilters);
contextMenu.appendSeparator();
- contextMenu.appendItem(WebInspector.UIString.capitalize("Clear ^console"), this._requestClearMessages.bind(this));
+ contextMenu.appendAction(WebInspector.UIString("Clear console"), "console.clear");
pfeldman 2015/08/17 19:22:49 Like we do to context menus in here.
contextMenu.appendItem(WebInspector.UIString("Save as..."), this._saveConsole.bind(this));
var request = consoleMessage ? consoleMessage.request : null;
@@ -708,11 +708,9 @@ WebInspector.ConsoleView.prototype = {
var section = WebInspector.shortcutsScreen.section(WebInspector.UIString("Console"));
var shortcutL = shortcut.makeDescriptor("l", WebInspector.KeyboardShortcut.Modifiers.Ctrl);
- this._shortcuts[shortcutL.key] = this._requestClearMessages.bind(this);
var keys = [shortcutL];
if (WebInspector.isMac()) {
var shortcutK = shortcut.makeDescriptor("k", WebInspector.KeyboardShortcut.Modifiers.Meta);
- this._shortcuts[shortcutK.key] = this._requestClearMessages.bind(this);
keys.unshift(shortcutK);
}
section.addAlternateKeys(keys, WebInspector.UIString("Clear console"));
@@ -746,13 +744,6 @@ WebInspector.ConsoleView.prototype = {
this._prompt.setText("");
},
- _requestClearMessages: function()
- {
- var targets = WebInspector.targetManager.targets();
- for (var i = 0; i < targets.length; ++i)
- targets[i].consoleModel.requestClearMessages();
- },
-
_promptKeyDown: function(event)
{
if (isEnterKey(event)) {
@@ -1289,11 +1280,11 @@ WebInspector.ConsoleGroup.prototype = {
* @constructor
* @implements {WebInspector.ActionDelegate}
*/
-WebInspector.ConsoleView.ShowConsoleActionDelegate = function()
+WebInspector.ConsoleView.ActionDelegate = function()
{
}
-WebInspector.ConsoleView.ShowConsoleActionDelegate.prototype = {
+WebInspector.ConsoleView.ActionDelegate.prototype = {
/**
* @override
* @param {!WebInspector.Context} context
@@ -1301,7 +1292,10 @@ WebInspector.ConsoleView.ShowConsoleActionDelegate.prototype = {
*/
handleAction: function(context, actionId)
{
- WebInspector.console.show();
+ if (actionId === "console.show")
+ WebInspector.console.show();
+ else if (actionId === "console.clear")
+ WebInspector.ConsoleModel.clearConsole();
}
}
« no previous file with comments | « no previous file | Source/devtools/front_end/console/module.json » ('j') | Source/devtools/front_end/console/module.json » ('J')

Powered by Google App Engine
This is Rietveld 408576698