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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/elements/MetricsSidebarPane.js

Issue 2697603006: DevTools: Fix an exception on adding watch expression. (Closed)
Patch Set: Created 3 years, 10 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) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 var boundKeyDown = this._handleKeyDown.bind(this, context, styleProperty); 312 var boundKeyDown = this._handleKeyDown.bind(this, context, styleProperty);
313 context.keyDownHandler = boundKeyDown; 313 context.keyDownHandler = boundKeyDown;
314 targetElement.addEventListener('keydown', boundKeyDown, false); 314 targetElement.addEventListener('keydown', boundKeyDown, false);
315 315
316 this._isEditingMetrics = true; 316 this._isEditingMetrics = true;
317 317
318 var config = 318 var config =
319 new UI.InplaceEditor.Config(this._editingCommitted.bind(this), this.edit ingCancelled.bind(this), context); 319 new UI.InplaceEditor.Config(this._editingCommitted.bind(this), this.edit ingCancelled.bind(this), context);
320 UI.InplaceEditor.startEditing(targetElement, config); 320 UI.InplaceEditor.startEditing(targetElement, config);
321 321
322 targetElement.getComponentSelection().setBaseAndExtent(targetElement, 0, tar getElement, 1); 322 targetElement.getComponentSelection().selectAllChildren(targetElement);
323 } 323 }
324 324
325 _handleKeyDown(context, styleProperty, event) { 325 _handleKeyDown(context, styleProperty, event) {
326 var element = event.currentTarget; 326 var element = event.currentTarget;
327 327
328 /** 328 /**
329 * @param {string} originalValue 329 * @param {string} originalValue
330 * @param {string} replacementString 330 * @param {string} replacementString
331 * @this {Elements.MetricsSidebarPane} 331 * @this {Elements.MetricsSidebarPane}
332 */ 332 */
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 if (commitEditor) 445 if (commitEditor)
446 this.update(); 446 this.update();
447 } 447 }
448 } 448 }
449 449
450 _editingCommitted(element, userInput, previousContent, context) { 450 _editingCommitted(element, userInput, previousContent, context) {
451 this.editingEnded(element, context); 451 this.editingEnded(element, context);
452 this._applyUserInput(element, userInput, previousContent, context, true); 452 this._applyUserInput(element, userInput, previousContent, context, true);
453 } 453 }
454 }; 454 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698