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

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

Issue 2150713002: [Devtools] Refactor NetworkLogViewColumns to be dynamic (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes 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 | « no previous file | third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js » ('j') | 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) 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 = 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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 702
703 _updateVersionFrom18To19: function()
704 {
705 var defaultColumns = {
706 status: true,
707 type: true,
708 initiator: true,
709 size: true,
710 time: true
711 };
712 var visibleColumnSettings = WebInspector.settings.createSetting("network LogColumnsVisibility", defaultColumns);
713 var visibleColumns = visibleColumnSettings.get();
714 visibleColumns.name = true;
715 visibleColumns.timeline = true;
716
717 var configs = {};
718 for (var columnId in visibleColumns) {
719 if (!visibleColumns.hasOwnProperty(columnId))
720 continue;
721 configs[columnId.toLowerCase()] = {
722 visible: visibleColumns[columnId]
723 };
724 }
725 var newSetting = WebInspector.settings.createSetting("networkLogColumns" , {});
726 newSetting.set(configs);
727 visibleColumnSettings.remove();
728 },
729
703 _migrateSettingsFromLocalStorage: function() 730 _migrateSettingsFromLocalStorage: function()
704 { 731 {
705 // This step migrates all the settings except for the ones below into th e browser profile. 732 // 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", 733 var localSettings = [ "advancedSearchConfig", "breakpoints", "consoleHis tory", "domBreakpoints", "eventListenerBreakpoints",
707 "fileSystemMapping", "lastSelectedSourcesSidebarPa neTab", "previouslyViewedFiles", 734 "fileSystemMapping", "lastSelectedSourcesSidebarPa neTab", "previouslyViewedFiles",
708 "savedURLs", "watchExpressions", "workspaceExclude dFolders", "xhrBreakpoints" ].keySet(); 735 "savedURLs", "watchExpressions", "workspaceExclude dFolders", "xhrBreakpoints" ].keySet();
709 if (!window.localStorage) 736 if (!window.localStorage)
710 return; 737 return;
711 738
712 for (var key in window.localStorage) { 739 for (var key in window.localStorage) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 } 773 }
747 774
748 /** 775 /**
749 * @param {string} settingName 776 * @param {string} settingName
750 * @return {!WebInspector.Setting} 777 * @return {!WebInspector.Setting}
751 */ 778 */
752 WebInspector.settingForTest = function(settingName) 779 WebInspector.settingForTest = function(settingName)
753 { 780 {
754 return WebInspector.settings.settingForTest(settingName); 781 return WebInspector.settings.settingForTest(settingName);
755 } 782 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698