| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 .createChild('div', 'settings-window-title') | 45 .createChild('div', 'settings-window-title') |
| 46 .textContent = Common.UIString('Settings'); | 46 .textContent = Common.UIString('Settings'); |
| 47 | 47 |
| 48 this._tabbedLocation = | 48 this._tabbedLocation = |
| 49 UI.viewManager.createTabbedLocation(() => Settings.SettingsScreen._showS
ettingsScreen(), 'settings-view'); | 49 UI.viewManager.createTabbedLocation(() => Settings.SettingsScreen._showS
ettingsScreen(), 'settings-view'); |
| 50 var tabbedPane = this._tabbedLocation.tabbedPane(); | 50 var tabbedPane = this._tabbedLocation.tabbedPane(); |
| 51 tabbedPane.leftToolbar().appendToolbarItem(new UI.ToolbarItem(settingsLabelE
lement)); | 51 tabbedPane.leftToolbar().appendToolbarItem(new UI.ToolbarItem(settingsLabelE
lement)); |
| 52 tabbedPane.setShrinkableTabs(false); | 52 tabbedPane.setShrinkableTabs(false); |
| 53 tabbedPane.setVerticalTabLayout(true); | 53 tabbedPane.setVerticalTabLayout(true); |
| 54 var shortcutsView = new UI.SimpleView(Common.UIString('Shortcuts')); | 54 var shortcutsView = new UI.SimpleView(Common.UIString('Shortcuts')); |
| 55 Components.shortcutsScreen.createShortcutsTabView().show(shortcutsView.eleme
nt); | 55 UI.shortcutsScreen.createShortcutsTabView().show(shortcutsView.element); |
| 56 this._tabbedLocation.appendView(shortcutsView); | 56 this._tabbedLocation.appendView(shortcutsView); |
| 57 tabbedPane.show(this.contentElement); | 57 tabbedPane.show(this.contentElement); |
| 58 | 58 |
| 59 this.element.addEventListener('keydown', this._keyDown.bind(this), false); | 59 this.element.addEventListener('keydown', this._keyDown.bind(this), false); |
| 60 this._developerModeCounter = 0; | 60 this._developerModeCounter = 0; |
| 61 this.setDefaultFocusedElement(this.contentElement); | 61 this.setDefaultFocusedElement(this.contentElement); |
| 62 } | 62 } |
| 63 | 63 |
| 64 /** | 64 /** |
| 65 * @param {string=} name | 65 * @param {string=} name |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 for (var sectionName of explicitSectionOrder) | 174 for (var sectionName of explicitSectionOrder) |
| 175 this._sectionElement(sectionName); | 175 this._sectionElement(sectionName); |
| 176 self.runtime.extensions('setting').forEach(this._addSetting.bind(this)); | 176 self.runtime.extensions('setting').forEach(this._addSetting.bind(this)); |
| 177 self.runtime.extensions(UI.SettingUI).forEach(this._addSettingUI.bind(this))
; | 177 self.runtime.extensions(UI.SettingUI).forEach(this._addSettingUI.bind(this))
; |
| 178 | 178 |
| 179 this._appendSection().appendChild( | 179 this._appendSection().appendChild( |
| 180 UI.createTextButton(Common.UIString('Restore defaults and reload'), rest
oreAndReload)); | 180 UI.createTextButton(Common.UIString('Restore defaults and reload'), rest
oreAndReload)); |
| 181 | 181 |
| 182 function restoreAndReload() { | 182 function restoreAndReload() { |
| 183 Common.settings.clearAll(); | 183 Common.settings.clearAll(); |
| 184 Components.reload(); | 184 Main.reload(); |
| 185 } | 185 } |
| 186 } | 186 } |
| 187 | 187 |
| 188 /** | 188 /** |
| 189 * @param {!Runtime.Extension} extension | 189 * @param {!Runtime.Extension} extension |
| 190 * @return {boolean} | 190 * @return {boolean} |
| 191 */ | 191 */ |
| 192 static isSettingVisible(extension) { | 192 static isSettingVisible(extension) { |
| 193 var descriptor = extension.descriptor(); | 193 var descriptor = extension.descriptor(); |
| 194 if (!('title' in descriptor)) | 194 if (!('title' in descriptor)) |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 return; | 535 return; |
| 536 var settings = extension.descriptor()['settings']; | 536 var settings = extension.descriptor()['settings']; |
| 537 if (settings && settings.indexOf(setting.name) !== -1) { | 537 if (settings && settings.indexOf(setting.name) !== -1) { |
| 538 InspectorFrontendHost.bringToFront(); | 538 InspectorFrontendHost.bringToFront(); |
| 539 Settings.SettingsScreen._showSettingsScreen(extension.descriptor()['id']
); | 539 Settings.SettingsScreen._showSettingsScreen(extension.descriptor()['id']
); |
| 540 success = true; | 540 success = true; |
| 541 } | 541 } |
| 542 } | 542 } |
| 543 } | 543 } |
| 544 }; | 544 }; |
| OLD | NEW |