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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 this._createSettings(prefs); | 70 this._createSettings(prefs); |
71 this._createAppUI(); | 71 this._createAppUI(); |
72 }, | 72 }, |
73 | 73 |
74 /** | 74 /** |
75 * @param {!Object<string, string>} prefs | 75 * @param {!Object<string, string>} prefs |
76 * Note: this function is called from testSettings in Tests.js. | 76 * Note: this function is called from testSettings in Tests.js. |
77 */ | 77 */ |
78 _createSettings: function(prefs) | 78 _createSettings: function(prefs) |
79 { | 79 { |
80 // Patch settings from the URL param (for tests). | |
81 var settingsParam = Runtime.queryParam("settings"); | |
82 if (settingsParam) { | |
83 try { | |
84 var settings = JSON.parse(window.decodeURI(settingsParam)); | |
85 for (var key in settings) | |
86 prefs[key] = settings[key]; | |
87 } catch (e) { | |
88 // Ignore malformed settings. | |
89 } | |
90 } | |
91 | |
92 this._initializeExperiments(prefs); | 80 this._initializeExperiments(prefs); |
93 WebInspector.settings = new WebInspector.Settings(new WebInspector.Setti
ngsStorage(prefs, | 81 WebInspector.settings = new WebInspector.Settings(new WebInspector.Setti
ngsStorage(prefs, |
94 InspectorFrontendHost.setPreference, InspectorFrontendHost.removePre
ference, InspectorFrontendHost.clearPreferences)); | 82 InspectorFrontendHost.setPreference, InspectorFrontendHost.removePre
ference, InspectorFrontendHost.clearPreferences)); |
95 | 83 |
96 if (!InspectorFrontendHost.isUnderTest()) | 84 if (!InspectorFrontendHost.isUnderTest()) |
97 new WebInspector.VersionController().updateVersion(); | 85 new WebInspector.VersionController().updateVersion(); |
98 }, | 86 }, |
99 | 87 |
100 /** | 88 /** |
101 * @param {!Object<string, string>} prefs | 89 * @param {!Object<string, string>} prefs |
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1112 * @return {?Element} | 1100 * @return {?Element} |
1113 */ | 1101 */ |
1114 settingElement: function() | 1102 settingElement: function() |
1115 { | 1103 { |
1116 return WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIStri
ng("Show rulers"), WebInspector.moduleSetting("showMetricsRulers")); | 1104 return WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIStri
ng("Show rulers"), WebInspector.moduleSetting("showMetricsRulers")); |
1117 } | 1105 } |
1118 } | 1106 } |
1119 | 1107 |
1120 | 1108 |
1121 new WebInspector.Main(); | 1109 new WebInspector.Main(); |
OLD | NEW |