| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 this._lastSelectedTabSetting = WebInspector.settings.createSetting("lastSele
ctedEmulateTab", "device"); | 51 this._lastSelectedTabSetting = WebInspector.settings.createSetting("lastSele
ctedEmulateTab", "device"); |
| 52 this._tabbedPane.selectTab(this._lastSelectedTabSetting.get()); | 52 this._tabbedPane.selectTab(this._lastSelectedTabSetting.get()); |
| 53 this._tabbedPane.addEventListener(WebInspector.TabbedPane.EventTypes.TabSele
cted, this._tabSelected, this); | 53 this._tabbedPane.addEventListener(WebInspector.TabbedPane.EventTypes.TabSele
cted, this._tabSelected, this); |
| 54 this._tabbedPane.show(this.element); | 54 this._tabbedPane.show(this.element); |
| 55 | 55 |
| 56 var resetButtonElement = createTextButton(WebInspector.UIString("Reset"), We
bInspector.overridesSupport.reset.bind(WebInspector.overridesSupport)); | 56 var resetButtonElement = createTextButton(WebInspector.UIString("Reset"), We
bInspector.overridesSupport.reset.bind(WebInspector.overridesSupport)); |
| 57 resetButtonElement.id = "overrides-reset-button"; | 57 resetButtonElement.id = "overrides-reset-button"; |
| 58 this._tabbedPane.appendAfterTabStrip(resetButtonElement); | 58 this._tabbedPane.appendAfterTabStrip(resetButtonElement); |
| 59 | 59 |
| 60 if (!WebInspector.overridesSupport.responsiveDesignAvailable()) { | 60 var disableButtonElement = createTextButton(WebInspector.UIString("Disable")
, this._toggleEmulationEnabled.bind(this), "overrides-disable-button"); |
| 61 var disableButtonElement = createTextButton(WebInspector.UIString("Disab
le"), this._toggleEmulationEnabled.bind(this), "overrides-disable-button"); | 61 disableButtonElement.id = "overrides-disable-button"; |
| 62 disableButtonElement.id = "overrides-disable-button"; | 62 this._tabbedPane.appendAfterTabStrip(disableButtonElement); |
| 63 this._tabbedPane.appendAfterTabStrip(disableButtonElement); | |
| 64 } | |
| 65 | 63 |
| 66 this._splashScreenElement = this.element.createChild("div", "overrides-splas
h-screen"); | 64 this._splashScreenElement = this.element.createChild("div", "overrides-splas
h-screen"); |
| 65 this._splashScreenElement.appendChild(createTextButton(WebInspector.UIString
("Enable emulation"), this._toggleEmulationEnabled.bind(this), "overrides-enable
-button")); |
| 66 |
| 67 this._unavailableSplashScreenElement = this.element.createChild("div", "over
rides-splash-screen"); | 67 this._unavailableSplashScreenElement = this.element.createChild("div", "over
rides-splash-screen"); |
| 68 this._unavailableSplashScreenElement.createTextChild(WebInspector.UIString("
Emulation is not available.")); | 68 this._unavailableSplashScreenElement.createTextChild(WebInspector.UIString("
Emulation is not available.")); |
| 69 | 69 |
| 70 if (WebInspector.overridesSupport.responsiveDesignAvailable()) { | |
| 71 this._splashScreenElement.createTextChild(WebInspector.UIString("Emulati
on is currently disabled. Toggle ")); | |
| 72 var toolbar = new WebInspector.Toolbar(this._splashScreenElement); | |
| 73 var toggleEmulationButton = new WebInspector.ToolbarButton("", "emulatio
n-toolbar-item"); | |
| 74 toggleEmulationButton.addEventListener("click", this._toggleEmulationEna
bled, this); | |
| 75 toolbar.appendToolbarItem(toggleEmulationButton); | |
| 76 this._splashScreenElement.createTextChild(WebInspector.UIString("in the
main toolbar to enable it.")); | |
| 77 } else { | |
| 78 this._splashScreenElement.appendChild(createTextButton(WebInspector.UISt
ring("Enable emulation"), this._toggleEmulationEnabled.bind(this), "overrides-en
able-button")); | |
| 79 } | |
| 80 | |
| 81 this._warningFooter = this.element.createChild("div", "overrides-footer"); | 70 this._warningFooter = this.element.createChild("div", "overrides-footer"); |
| 82 this._overridesWarningUpdated(); | 71 this._overridesWarningUpdated(); |
| 83 | 72 |
| 84 WebInspector.overridesSupport.addEventListener(WebInspector.OverridesSupport
.Events.OverridesWarningUpdated, this._overridesWarningUpdated, this); | 73 WebInspector.overridesSupport.addEventListener(WebInspector.OverridesSupport
.Events.OverridesWarningUpdated, this._overridesWarningUpdated, this); |
| 85 WebInspector.overridesSupport.addEventListener(WebInspector.OverridesSupport
.Events.EmulationStateChanged, this._emulationStateChanged, this); | 74 WebInspector.overridesSupport.addEventListener(WebInspector.OverridesSupport
.Events.EmulationStateChanged, this._emulationStateChanged, this); |
| 86 this._emulationStateChanged(); | 75 this._emulationStateChanged(); |
| 87 } | 76 } |
| 88 | 77 |
| 89 WebInspector.OverridesView.prototype = { | 78 WebInspector.OverridesView.prototype = { |
| 90 /** | 79 /** |
| (...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 * @override | 636 * @override |
| 648 * @param {!Object} overridesSupport | 637 * @param {!Object} overridesSupport |
| 649 * @return {!Promise} | 638 * @return {!Promise} |
| 650 */ | 639 */ |
| 651 reveal: function(overridesSupport) | 640 reveal: function(overridesSupport) |
| 652 { | 641 { |
| 653 WebInspector.inspectorView.showViewInDrawer("emulation"); | 642 WebInspector.inspectorView.showViewInDrawer("emulation"); |
| 654 return Promise.resolve(); | 643 return Promise.resolve(); |
| 655 } | 644 } |
| 656 } | 645 } |
| OLD | NEW |