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

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

Issue 1449143002: DevTools: remove Object.observe usage, it is being deprecated. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removeAll added Created 5 years, 1 month 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/common/Settings.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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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();
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/common/Settings.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698