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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/main/Main.js

Issue 2223093002: Merge to 2785 "[DevTools] Do not use "settings" query param." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 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
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/devtools.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) 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 this._createSettings(prefs); 69 this._createSettings(prefs);
70 this._createAppUI(); 70 this._createAppUI();
71 }, 71 },
72 72
73 /** 73 /**
74 * @param {!Object<string, string>} prefs 74 * @param {!Object<string, string>} prefs
75 * Note: this function is called from testSettings in Tests.js. 75 * Note: this function is called from testSettings in Tests.js.
76 */ 76 */
77 _createSettings: function(prefs) 77 _createSettings: function(prefs)
78 { 78 {
79 // Patch settings from the URL param (for tests).
80 var settingsParam = Runtime.queryParam("settings");
81 if (settingsParam) {
82 try {
83 var settings = JSON.parse(window.decodeURI(settingsParam));
84 for (var key in settings)
85 prefs[key] = settings[key];
86 } catch (e) {
87 // Ignore malformed settings.
88 }
89 }
90
91 this._initializeExperiments(prefs); 79 this._initializeExperiments(prefs);
92 WebInspector.settings = new WebInspector.Settings(new WebInspector.Setti ngsStorage(prefs, 80 WebInspector.settings = new WebInspector.Settings(new WebInspector.Setti ngsStorage(prefs,
93 InspectorFrontendHost.setPreference, InspectorFrontendHost.removePre ference, InspectorFrontendHost.clearPreferences)); 81 InspectorFrontendHost.setPreference, InspectorFrontendHost.removePre ference, InspectorFrontendHost.clearPreferences));
94 82
95 if (!InspectorFrontendHost.isUnderTest()) 83 if (!InspectorFrontendHost.isUnderTest())
96 new WebInspector.VersionController().updateVersion(); 84 new WebInspector.VersionController().updateVersion();
97 }, 85 },
98 86
99 /** 87 /**
100 * @param {!Object<string, string>} prefs 88 * @param {!Object<string, string>} prefs
(...skipping 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after
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();
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/devtools.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698