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

Side by Side Diff: Source/devtools/front_end/elements/Spectrum.js

Issue 486573003: DevTools: remove eye dropper from behind experiment. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/devtools/front_end/common/Settings.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) 2011 Brian Grinstead All rights reserved. 2 * Copyright (C) 2011 Brian Grinstead 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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 this.hide(true); 365 this.hide(true);
366 } 366 }
367 367
368 this._anchorElement = element; 368 this._anchorElement = element;
369 369
370 this._spectrum.setColor(color); 370 this._spectrum.setColor(color);
371 this._spectrum._originalFormat = format !== WebInspector.Color.Format.Or iginal ? format : color.format(); 371 this._spectrum._originalFormat = format !== WebInspector.Color.Format.Or iginal ? format : color.format();
372 this.reposition(element); 372 this.reposition(element);
373 373
374 document.addEventListener("mousedown", this._hideProxy, false); 374 document.addEventListener("mousedown", this._hideProxy, false);
375 if (WebInspector.experimentsSettings.colorPicker.isEnabled()) { 375 WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeMod el, WebInspector.ResourceTreeModel.EventTypes.ColorPicked, this._colorPicked, th is);
376 WebInspector.targetManager.addModelListener(WebInspector.ResourceTre eModel, WebInspector.ResourceTreeModel.EventTypes.ColorPicked, this._colorPicked , this); 376 PageAgent.setColorPickerEnabled(true);
377 PageAgent.setColorPickerEnabled(true);
378 }
379 return true; 377 return true;
380 }, 378 },
381 379
382 reposition: function(element) 380 reposition: function(element)
383 { 381 {
384 if (!this._previousFocusElement) 382 if (!this._previousFocusElement)
385 this._previousFocusElement = WebInspector.currentFocusElement(); 383 this._previousFocusElement = WebInspector.currentFocusElement();
386 this._popover.showView(this._spectrum, element); 384 this._popover.showView(this._spectrum, element);
387 WebInspector.setCurrentFocusElement(this._spectrum.element); 385 WebInspector.setCurrentFocusElement(this._spectrum.element);
388 }, 386 },
389 387
390 /** 388 /**
391 * @param {boolean=} commitEdit 389 * @param {boolean=} commitEdit
392 */ 390 */
393 hide: function(commitEdit) 391 hide: function(commitEdit)
394 { 392 {
395 if (!this._popover.isShowing()) 393 if (!this._popover.isShowing())
396 return; 394 return;
397 this._popover.hide(); 395 this._popover.hide();
398 396
399 document.removeEventListener("mousedown", this._hideProxy, false); 397 document.removeEventListener("mousedown", this._hideProxy, false);
400 398
401 if (WebInspector.experimentsSettings.colorPicker.isEnabled()) { 399 PageAgent.setColorPickerEnabled(false);
402 PageAgent.setColorPickerEnabled(false); 400 WebInspector.targetManager.removeModelListener(WebInspector.ResourceTree Model, WebInspector.ResourceTreeModel.EventTypes.ColorPicked, this._colorPicked, this);
403 WebInspector.targetManager.removeModelListener(WebInspector.Resource TreeModel, WebInspector.ResourceTreeModel.EventTypes.ColorPicked, this._colorPic ked, this);
404 }
405 401
406 this.dispatchEventToListeners(WebInspector.SpectrumPopupHelper.Events.Hi dden, !!commitEdit); 402 this.dispatchEventToListeners(WebInspector.SpectrumPopupHelper.Events.Hi dden, !!commitEdit);
407 403
408 WebInspector.setCurrentFocusElement(this._previousFocusElement); 404 WebInspector.setCurrentFocusElement(this._previousFocusElement);
409 delete this._previousFocusElement; 405 delete this._previousFocusElement;
410 406
411 delete this._anchorElement; 407 delete this._anchorElement;
412 }, 408 },
413 409
414 _onKeyDown: function(event) 410 _onKeyDown: function(event)
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 451
456 WebInspector.ColorSwatch.prototype = { 452 WebInspector.ColorSwatch.prototype = {
457 /** 453 /**
458 * @param {string} colorString 454 * @param {string} colorString
459 */ 455 */
460 setColorString: function(colorString) 456 setColorString: function(colorString)
461 { 457 {
462 this._swatchInnerElement.style.backgroundColor = colorString; 458 this._swatchInnerElement.style.backgroundColor = colorString;
463 } 459 }
464 } 460 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/common/Settings.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698