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

Side by Side Diff: Source/devtools/front_end/Settings.js

Issue 204333004: DevTools: Speculatively patch DevTools to make CodeSchool extension work. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed pause settings Created 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/devtools/front_end/Main.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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 { 653 {
654 // If there are too many breakpoints in a storage, it is likely due to a recent bug that caused 654 // If there are too many breakpoints in a storage, it is likely due to a recent bug that caused
655 // periodical breakpoints duplication leading to inspector slowness. 655 // periodical breakpoints duplication leading to inspector slowness.
656 if (breakpointsSetting.get().length > maxBreakpointsCount) 656 if (breakpointsSetting.get().length > maxBreakpointsCount)
657 breakpointsSetting.set([]); 657 breakpointsSetting.set([]);
658 } 658 }
659 } 659 }
660 660
661 WebInspector.settings = new WebInspector.Settings(); 661 WebInspector.settings = new WebInspector.Settings();
662 WebInspector.experimentsSettings = new WebInspector.ExperimentsSettings(WebInspe ctor.queryParam("experiments") !== null); 662 WebInspector.experimentsSettings = new WebInspector.ExperimentsSettings(WebInspe ctor.queryParam("experiments") !== null);
663
664 // These methods are added for backwards compatibility with Devtools CodeSchool extension.
665 // DO NOT REMOVE
666
667 /**
668 * @constructor
669 */
670 WebInspector.PauseOnExceptionStateSetting = function()
671 {
672 WebInspector.settings.pauseOnExceptionEnabled.addChangeListener(this._enable dChanged, this);
673 WebInspector.settings.pauseOnCaughtException.addChangeListener(this._pauseOn CaughtChanged, this);
674 this._name = "pauseOnExceptionStateString";
675 this._eventSupport = new WebInspector.Object();
676 this._value = this._calculateValue();
677 }
678
679 WebInspector.PauseOnExceptionStateSetting.prototype = {
680 /**
681 * @param {function(!WebInspector.Event)} listener
682 * @param {!Object=} thisObject
683 */
684 addChangeListener: function(listener, thisObject)
685 {
686 this._eventSupport.addEventListener(this._name, listener, thisObject);
687 },
688
689 /**
690 * @param {function(!WebInspector.Event)} listener
691 * @param {!Object=} thisObject
692 */
693 removeChangeListener: function(listener, thisObject)
694 {
695 this._eventSupport.removeEventListener(this._name, listener, thisObject) ;
696 },
697
698 /**
699 * @return {string}
700 */
701 get: function()
702 {
703 return this._value;
704 },
705
706 /**
707 * @return {string}
708 */
709 _calculateValue: function()
710 {
711 if (!WebInspector.settings.pauseOnExceptionEnabled.get())
712 return "none";
713 // The correct code here would be
714 // return WebInspector.settings.pauseOnCaughtException.get() ? "all" : "uncaught";
715 // But the CodeSchool DevTools relies on the fact that we used to enable pausing on ALL extensions by default, so we trick it here.
716 return "all";
717 },
718
719 _enabledChanged: function(event)
720 {
721 this._fireChangedIfNeeded();
722 },
723
724 _pauseOnCaughtChanged: function(event)
725 {
726 this._fireChangedIfNeeded();
727 },
728
729 _fireChangedIfNeeded: function()
730 {
731 var newValue = this._calculateValue();
732 if (newValue === this._value)
733 return;
734 this._value = newValue;
735 this._eventSupport.dispatchEventToListeners(this._name, this._value);
736 }
737 }
738
739 WebInspector.settings.pauseOnExceptionStateString = new WebInspector.PauseOnExce ptionStateSetting();
OLDNEW
« no previous file with comments | « Source/devtools/front_end/Main.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698