| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 * @extends {WebInspector.VBox} | 7 * @extends {WebInspector.VBox} |
| 8 * @implements {WebInspector.OverridesSupport.PageResizer} | 8 * @implements {WebInspector.OverridesSupport.PageResizer} |
| 9 * @implements {WebInspector.TargetManager.Observer} | 9 * @implements {WebInspector.TargetManager.Observer} |
| 10 * @param {!WebInspector.InspectedPagePlaceholder} inspectedPagePlaceholder | 10 * @param {!WebInspector.InspectedPagePlaceholder} inspectedPagePlaceholder |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 { | 560 { |
| 561 this._updateUI(); | 561 this._updateUI(); |
| 562 }, | 562 }, |
| 563 | 563 |
| 564 _createToolbar: function() | 564 _createToolbar: function() |
| 565 { | 565 { |
| 566 this._toolbarElement = this._responsiveDesignContainer.element.createChi
ld("div", "responsive-design-toolbar"); | 566 this._toolbarElement = this._responsiveDesignContainer.element.createChi
ld("div", "responsive-design-toolbar"); |
| 567 this._createButtonsSection(); | 567 this._createButtonsSection(); |
| 568 this._createDeviceSection(); | 568 this._createDeviceSection(); |
| 569 this._toolbarElement.createChild("div", "responsive-design-separator"); | 569 this._toolbarElement.createChild("div", "responsive-design-separator"); |
| 570 this._createNetworkSection(); | |
| 571 this._toolbarElement.createChild("div", "responsive-design-separator"); | |
| 572 | 570 |
| 573 var moreButtonContainer = this._toolbarElement.createChild("div", "respo
nsive-design-more-button-container"); | 571 var moreButtonContainer = this._toolbarElement.createChild("div", "respo
nsive-design-more-button-container"); |
| 574 var moreButton = moreButtonContainer.createChild("button", "responsive-d
esign-more-button"); | 572 var moreButton = moreButtonContainer.createChild("button", "responsive-d
esign-more-button"); |
| 575 moreButton.title = WebInspector.UIString("More overrides"); | 573 moreButton.title = WebInspector.UIString("More overrides"); |
| 576 moreButton.addEventListener("click", this._showEmulationInDrawer.bind(th
is), false); | 574 moreButton.addEventListener("click", this._showEmulationInDrawer.bind(th
is), false); |
| 577 moreButton.textContent = "\u2026"; | 575 moreButton.textContent = "\u2026"; |
| 578 }, | 576 }, |
| 579 | 577 |
| 580 _createButtonsSection: function() | 578 _createButtonsSection: function() |
| 581 { | 579 { |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 | 654 |
| 657 /** | 655 /** |
| 658 * @param {!Element} checkbox | 656 * @param {!Element} checkbox |
| 659 */ | 657 */ |
| 660 function themeCheckbox(checkbox) | 658 function themeCheckbox(checkbox) |
| 661 { | 659 { |
| 662 checkbox.checkColor = "rgb(255, 156, 0)"; | 660 checkbox.checkColor = "rgb(255, 156, 0)"; |
| 663 checkbox.backgroundColor = "rgb(102, 102, 102)"; | 661 checkbox.backgroundColor = "rgb(102, 102, 102)"; |
| 664 checkbox.borderColor = "rgb(45, 45, 45)"; | 662 checkbox.borderColor = "rgb(45, 45, 45)"; |
| 665 } | 663 } |
| 666 }, | |
| 667 | |
| 668 _createNetworkSection: function() | |
| 669 { | |
| 670 var networkSection = this._toolbarElement.createChild("div", "responsive
-design-section responsive-design-section-network"); | |
| 671 | |
| 672 networkSection.createChild("div", "responsive-design-section-decorator")
; | |
| 673 | |
| 674 // Bandwidth. | |
| 675 var bandwidthElement = networkSection.createChild("div", "responsive-des
ign-suite responsive-design-suite-top").createChild("div"); | |
| 676 var fieldsetElement = bandwidthElement.createChild("fieldset"); | |
| 677 var networkCheckbox = fieldsetElement.createChild("label"); | |
| 678 networkCheckbox.textContent = WebInspector.UIString("Network"); | |
| 679 fieldsetElement.appendChild(WebInspector.OverridesUI.createNetworkCondit
ionsSelect()); | |
| 680 | 664 |
| 681 // User agent. | 665 // User agent. |
| 682 var userAgentElement = networkSection.createChild("div", "responsive-des
ign-suite").createChild("div"); | 666 detailsElement.createChild("div", "responsive-design-suite-separator"); |
| 683 fieldsetElement = userAgentElement.createChild("fieldset"); | 667 var userAgentElement = detailsElement.createChild("div").createChild("la
bel", "responsive-design-user-agent"); |
| 684 fieldsetElement.appendChild(WebInspector.SettingsUI.createSettingInputFi
eld("UA", WebInspector.overridesSupport.settings.userAgent, false, 0, "", undefi
ned, false, false, WebInspector.UIString("No override"))); | 668 WebInspector.overridesSupport.settings.userAgent.addChangeListener(userA
gentChanged); |
| 669 userAgentChanged(); |
| 670 |
| 671 function userAgentChanged() |
| 672 { |
| 673 var value = WebInspector.overridesSupport.settings.userAgent.get(); |
| 674 if (!value) |
| 675 value = WebInspector.UIString("No UA override"); |
| 676 userAgentElement.textContent = value; |
| 677 userAgentElement.title = WebInspector.UIString("User agent: %s", val
ue); |
| 678 } |
| 685 }, | 679 }, |
| 686 | 680 |
| 687 _onToggleMediaInspectorButtonClick: function() | 681 _onToggleMediaInspectorButtonClick: function() |
| 688 { | 682 { |
| 689 this._showMediaQueryInspectorSetting.set(!this._toggleMediaInspectorButt
on.toggled()); | 683 this._showMediaQueryInspectorSetting.set(!this._toggleMediaInspectorButt
on.toggled()); |
| 690 }, | 684 }, |
| 691 | 685 |
| 692 _updateMediaQueryInspector: function() | 686 _updateMediaQueryInspector: function() |
| 693 { | 687 { |
| 694 this._toggleMediaInspectorButton.setToggled(this._showMediaQueryInspecto
rSetting.get()); | 688 this._toggleMediaInspectorButton.setToggled(this._showMediaQueryInspecto
rSetting.get()); |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 806 WebInspector.EmulationDispatcher.prototype = { | 800 WebInspector.EmulationDispatcher.prototype = { |
| 807 /** | 801 /** |
| 808 * @override | 802 * @override |
| 809 * @param {!EmulationAgent.Viewport=} viewport | 803 * @param {!EmulationAgent.Viewport=} viewport |
| 810 */ | 804 */ |
| 811 viewportChanged: function(viewport) | 805 viewportChanged: function(viewport) |
| 812 { | 806 { |
| 813 this._responsiveDesignView._viewportChanged(viewport); | 807 this._responsiveDesignView._viewportChanged(viewport); |
| 814 } | 808 } |
| 815 } | 809 } |
| OLD | NEW |