Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 = 18; | 402 WebInspector.VersionController.currentVersion = 19; |
| 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 // While localStorage version exists, treat it as the main one. It'll be erased once migrated to prefs. |
| 411 var oldVersion = parseInt(localStorageVersion || "0", 10) || versionSett ing.get(); | 411 var oldVersion = parseInt(localStorageVersion || "0", 10) || versionSett ing.get(); |
| 412 if (oldVersion === 0) { | 412 if (oldVersion === 0) { |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 692 if (!newKey.startsWith("file://")) { | 692 if (!newKey.startsWith("file://")) { |
| 693 if (newKey.startsWith("/")) | 693 if (newKey.startsWith("/")) |
| 694 newKey = "file://" + newKey; | 694 newKey = "file://" + newKey; |
| 695 else | 695 else |
| 696 newKey = "file:///" + newKey; | 696 newKey = "file:///" + newKey; |
| 697 } | 697 } |
| 698 newValue[newKey] = oldValue[oldKey]; | 698 newValue[newKey] = oldValue[oldKey]; |
| 699 } | 699 } |
| 700 setting.set(newValue); | 700 setting.set(newValue); |
| 701 }, | 701 }, |
| 702 _updateVersionFrom18To19: function() | |
|
dgozman
2016/07/15 23:47:49
Blank line before function please.
allada
2016/07/25 23:05:53
Done.
| |
| 703 { | |
| 704 var defaultColumns = { | |
| 705 status: true, | |
| 706 type: true, | |
| 707 initiator: true, | |
| 708 size: true, | |
| 709 time: true | |
| 710 }; | |
| 711 var visibleColumnSettings = WebInspector.settings.createSetting("network LogColumnsVisibility", defaultColumns); | |
| 712 var visibleColumns = visibleColumnSettings.get(); | |
| 713 visibleColumns.name = true; | |
| 714 visibleColumns.timeline = true; | |
| 715 | |
| 716 var configs = {}; | |
| 717 for (var columnId in visibleColumns) { | |
| 718 if (!visibleColumns.hasOwnProperty(columnId)) | |
| 719 continue; | |
| 720 configs[columnId.toLowerCase()] = { | |
| 721 visible: visibleColumns[columnId] | |
| 722 }; | |
| 723 } | |
| 724 var newSetting = WebInspector.settings.createSetting("networkLogColumns" , {}); | |
| 725 newSetting.set(configs); | |
| 726 visibleColumnSettings.remove() | |
|
dgozman
2016/07/15 23:47:49
semicolons please!
allada
2016/07/25 23:05:53
Done.
| |
| 727 }, | |
| 702 | 728 |
| 703 _migrateSettingsFromLocalStorage: function() | 729 _migrateSettingsFromLocalStorage: function() |
| 704 { | 730 { |
| 705 // This step migrates all the settings except for the ones below into th e browser profile. | 731 // This step migrates all the settings except for the ones below into th e browser profile. |
| 706 var localSettings = [ "advancedSearchConfig", "breakpoints", "consoleHis tory", "domBreakpoints", "eventListenerBreakpoints", | 732 var localSettings = [ "advancedSearchConfig", "breakpoints", "consoleHis tory", "domBreakpoints", "eventListenerBreakpoints", |
| 707 "fileSystemMapping", "lastSelectedSourcesSidebarPa neTab", "previouslyViewedFiles", | 733 "fileSystemMapping", "lastSelectedSourcesSidebarPa neTab", "previouslyViewedFiles", |
| 708 "savedURLs", "watchExpressions", "workspaceExclude dFolders", "xhrBreakpoints" ].keySet(); | 734 "savedURLs", "watchExpressions", "workspaceExclude dFolders", "xhrBreakpoints" ].keySet(); |
| 709 if (!window.localStorage) | 735 if (!window.localStorage) |
| 710 return; | 736 return; |
| 711 | 737 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 746 } | 772 } |
| 747 | 773 |
| 748 /** | 774 /** |
| 749 * @param {string} settingName | 775 * @param {string} settingName |
| 750 * @return {!WebInspector.Setting} | 776 * @return {!WebInspector.Setting} |
| 751 */ | 777 */ |
| 752 WebInspector.settingForTest = function(settingName) | 778 WebInspector.settingForTest = function(settingName) |
| 753 { | 779 { |
| 754 return WebInspector.settings.settingForTest(settingName); | 780 return WebInspector.settings.settingForTest(settingName); |
| 755 } | 781 } |
| OLD | NEW |