| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 this._createSettings(prefs); | 66 this._createSettings(prefs); |
| 67 this._createAppUI(); | 67 this._createAppUI(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 /** | 70 /** |
| 71 * @param {!Object<string, string>} prefs | 71 * @param {!Object<string, string>} prefs |
| 72 * Note: this function is called from testSettings in Tests.js. | 72 * Note: this function is called from testSettings in Tests.js. |
| 73 */ | 73 */ |
| 74 _createSettings(prefs) { | 74 _createSettings(prefs) { |
| 75 this._initializeExperiments(prefs); | 75 this._initializeExperiments(prefs); |
| 76 WebInspector.settings = new WebInspector.Settings(new WebInspector.SettingsS
torage( | 76 var storagePrefix = WebInspector.isCustomDevtoolsFrontend() ? '__custom__' :
''; |
| 77 var clearLocalStorage = window.localStorage ? window.localStorage.clear.bind
(window.localStorage) : undefined; |
| 78 var localStorage = |
| 79 new WebInspector.SettingsStorage(window.localStorage || {}, undefined, u
ndefined, clearLocalStorage, storagePrefix); |
| 80 var globalStorage = new WebInspector.SettingsStorage( |
| 77 prefs, InspectorFrontendHost.setPreference, InspectorFrontendHost.remove
Preference, | 81 prefs, InspectorFrontendHost.setPreference, InspectorFrontendHost.remove
Preference, |
| 78 InspectorFrontendHost.clearPreferences)); | 82 InspectorFrontendHost.clearPreferences, storagePrefix); |
| 83 WebInspector.settings = new WebInspector.Settings(globalStorage, localStorag
e); |
| 79 | 84 |
| 80 if (!InspectorFrontendHost.isUnderTest()) | 85 if (!InspectorFrontendHost.isUnderTest()) |
| 81 new WebInspector.VersionController().updateVersion(); | 86 new WebInspector.VersionController().updateVersion(); |
| 82 } | 87 } |
| 83 | 88 |
| 84 /** | 89 /** |
| 85 * @param {!Object<string, string>} prefs | 90 * @param {!Object<string, string>} prefs |
| 86 */ | 91 */ |
| 87 _initializeExperiments(prefs) { | 92 _initializeExperiments(prefs) { |
| 88 Runtime.experiments.register('accessibilityInspection', 'Accessibility Inspe
ction'); | 93 Runtime.experiments.register('accessibilityInspection', 'Accessibility Inspe
ction'); |
| (...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1041 * @override | 1046 * @override |
| 1042 * @return {?Element} | 1047 * @return {?Element} |
| 1043 */ | 1048 */ |
| 1044 settingElement() { | 1049 settingElement() { |
| 1045 return WebInspector.SettingsUI.createSettingCheckbox( | 1050 return WebInspector.SettingsUI.createSettingCheckbox( |
| 1046 WebInspector.UIString('Show rulers'), WebInspector.moduleSetting('showMe
tricsRulers')); | 1051 WebInspector.UIString('Show rulers'), WebInspector.moduleSetting('showMe
tricsRulers')); |
| 1047 } | 1052 } |
| 1048 }; | 1053 }; |
| 1049 | 1054 |
| 1050 new WebInspector.Main(); | 1055 new WebInspector.Main(); |
| OLD | NEW |