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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/common/Settings.js

Issue 2412023002: DevTools: migrate InspectorView to tabbed view location. (Closed)
Patch Set: made layers panel closeable. Created 4 years, 2 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 } 392 }
393 393
394 /** 394 /**
395 * @constructor 395 * @constructor
396 */ 396 */
397 WebInspector.VersionController = function() 397 WebInspector.VersionController = function()
398 { 398 {
399 } 399 }
400 400
401 WebInspector.VersionController._currentVersionName = "inspectorVersion"; 401 WebInspector.VersionController._currentVersionName = "inspectorVersion";
402 WebInspector.VersionController.currentVersion = 19; 402 WebInspector.VersionController.currentVersion = 20;
403 403
404 WebInspector.VersionController.prototype = { 404 WebInspector.VersionController.prototype = {
405 updateVersion: function() 405 updateVersion: function()
406 { 406 {
407 var localStorageVersion = window.localStorage ? window.localStorage[WebI nspector.VersionController._currentVersionName] : 0; 407 var localStorageVersion = window.localStorage ? window.localStorage[WebI nspector.VersionController._currentVersionName] : 0;
408 var versionSetting = WebInspector.settings.createSetting(WebInspector.Ve rsionController._currentVersionName, 0); 408 var versionSetting = WebInspector.settings.createSetting(WebInspector.Ve rsionController._currentVersionName, 0);
409 var currentVersion = WebInspector.VersionController.currentVersion; 409 var currentVersion = WebInspector.VersionController.currentVersion;
410 // While localStorage version exists, treat it as the main one. It'll be erased once migrated to prefs. 410 var oldVersion = versionSetting.get() || parseInt(localStorageVersion || "0", 10);
411 var oldVersion = parseInt(localStorageVersion || "0", 10) || versionSett ing.get();
412 if (oldVersion === 0) { 411 if (oldVersion === 0) {
413 // First run, no need to do anything. 412 // First run, no need to do anything.
414 versionSetting.set(currentVersion); 413 versionSetting.set(currentVersion);
415 return; 414 return;
416 } 415 }
417 var methodsToRun = this._methodsToRunToUpdateVersion(oldVersion, current Version); 416 var methodsToRun = this._methodsToRunToUpdateVersion(oldVersion, current Version);
418 for (var i = 0; i < methodsToRun.length; ++i) 417 for (var i = 0; i < methodsToRun.length; ++i)
419 this[methodsToRun[i]].call(this); 418 this[methodsToRun[i]].call(this);
420 versionSetting.set(currentVersion); 419 versionSetting.set(currentVersion);
421 }, 420 },
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 continue; 719 continue;
721 configs[columnId.toLowerCase()] = { 720 configs[columnId.toLowerCase()] = {
722 visible: visibleColumns[columnId] 721 visible: visibleColumns[columnId]
723 }; 722 };
724 } 723 }
725 var newSetting = WebInspector.settings.createSetting("networkLogColumns" , {}); 724 var newSetting = WebInspector.settings.createSetting("networkLogColumns" , {});
726 newSetting.set(configs); 725 newSetting.set(configs);
727 visibleColumnSettings.remove(); 726 visibleColumnSettings.remove();
728 }, 727 },
729 728
729 _updateVersionFrom19To20: function()
730 {
731 var oldSetting = WebInspector.settings.createSetting("InspectorView.pane lOrder", {});
732 var newSetting = WebInspector.settings.createSetting("panel-tabOrder", { });
733 newSetting.set(oldSetting.get());
734 oldSetting.remove();
735 },
736
730 _migrateSettingsFromLocalStorage: function() 737 _migrateSettingsFromLocalStorage: function()
731 { 738 {
732 // This step migrates all the settings except for the ones below into th e browser profile. 739 // This step migrates all the settings except for the ones below into th e browser profile.
733 var localSettings = new Set([ "advancedSearchConfig", "breakpoints", "co nsoleHistory", "domBreakpoints", "eventListenerBreakpoints", 740 var localSettings = new Set([ "advancedSearchConfig", "breakpoints", "co nsoleHistory", "domBreakpoints", "eventListenerBreakpoints",
734 "fileSystemMapping", "lastSelectedSourcesSidebarPa neTab", "previouslyViewedFiles", 741 "fileSystemMapping", "lastSelectedSourcesSidebarPa neTab", "previouslyViewedFiles",
735 "savedURLs", "watchExpressions", "workspaceExclude dFolders", "xhrBreakpoints" ]); 742 "savedURLs", "watchExpressions", "workspaceExclude dFolders", "xhrBreakpoints" ]);
736 if (!window.localStorage) 743 if (!window.localStorage)
737 return; 744 return;
738 745
739 for (var key in window.localStorage) { 746 for (var key in window.localStorage) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 } 780 }
774 781
775 /** 782 /**
776 * @param {string} settingName 783 * @param {string} settingName
777 * @return {!WebInspector.Setting} 784 * @return {!WebInspector.Setting}
778 */ 785 */
779 WebInspector.settingForTest = function(settingName) 786 WebInspector.settingForTest = function(settingName)
780 { 787 {
781 return WebInspector.settings.settingForTest(settingName); 788 return WebInspector.settings.settingForTest(settingName);
782 } 789 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698