| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). | 3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). |
| 4 * Copyright (C) 2009 Joseph Pecoraro | 4 * Copyright (C) 2009 Joseph Pecoraro |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * | 9 * |
| 10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 try { | 83 try { |
| 84 var settings = JSON.parse(window.decodeURI(settingsParam)); | 84 var settings = JSON.parse(window.decodeURI(settingsParam)); |
| 85 for (var key in settings) | 85 for (var key in settings) |
| 86 prefs[key] = settings[key]; | 86 prefs[key] = settings[key]; |
| 87 } catch(e) { | 87 } catch(e) { |
| 88 // Ignore malformed settings. | 88 // Ignore malformed settings. |
| 89 } | 89 } |
| 90 } | 90 } |
| 91 | 91 |
| 92 this._initializeExperiments(prefs); | 92 this._initializeExperiments(prefs); |
| 93 | 93 WebInspector.settings = new WebInspector.Settings(new WebInspector.Setti
ngsStorage(prefs, |
| 94 /** | 94 InspectorFrontendHost.setPreference, InspectorFrontendHost.removePre
ference, InspectorFrontendHost.clearPreferences)); |
| 95 * @param {!Array<{name: string}>} changes | |
| 96 */ | |
| 97 function trackPrefsObject(changes) | |
| 98 { | |
| 99 if (!Object.keys(prefs).length) { | |
| 100 InspectorFrontendHost.clearPreferences(); | |
| 101 return; | |
| 102 } | |
| 103 | |
| 104 for (var change of changes) { | |
| 105 var name = change.name; | |
| 106 if (name in prefs) | |
| 107 InspectorFrontendHost.setPreference(name, prefs[name]); | |
| 108 else | |
| 109 InspectorFrontendHost.removePreference(name); | |
| 110 } | |
| 111 } | |
| 112 | |
| 113 Object.observe(prefs, trackPrefsObject); | |
| 114 WebInspector.settings = new WebInspector.Settings(prefs); | |
| 115 | 95 |
| 116 if (!InspectorFrontendHost.isUnderTest()) | 96 if (!InspectorFrontendHost.isUnderTest()) |
| 117 new WebInspector.VersionController().updateVersion(); | 97 new WebInspector.VersionController().updateVersion(); |
| 118 }, | 98 }, |
| 119 | 99 |
| 120 /** | 100 /** |
| 121 * @param {!Object<string, string>} prefs | 101 * @param {!Object<string, string>} prefs |
| 122 */ | 102 */ |
| 123 _initializeExperiments: function(prefs) | 103 _initializeExperiments: function(prefs) |
| 124 { | 104 { |
| (...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1084 */ | 1064 */ |
| 1085 willHide: function() | 1065 willHide: function() |
| 1086 { | 1066 { |
| 1087 this._hideCallback.call(null); | 1067 this._hideCallback.call(null); |
| 1088 }, | 1068 }, |
| 1089 | 1069 |
| 1090 __proto__: WebInspector.VBox.prototype | 1070 __proto__: WebInspector.VBox.prototype |
| 1091 } | 1071 } |
| 1092 | 1072 |
| 1093 new WebInspector.Main(); | 1073 new WebInspector.Main(); |
| OLD | NEW |