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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeWrapper.js

Issue 1840533002: Devtools: Add screenshot button to device mode toolbar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebaselined again Created 4 years, 8 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 * @extends {WebInspector.VBox} 6 * @extends {WebInspector.VBox}
7 * @param {!WebInspector.InspectedPagePlaceholder} inspectedPagePlaceholder 7 * @param {!WebInspector.InspectedPagePlaceholder} inspectedPagePlaceholder
8 * @constructor 8 * @constructor
9 */ 9 */
10 WebInspector.DeviceModeWrapper = function(inspectedPagePlaceholder) 10 WebInspector.DeviceModeWrapper = function(inspectedPagePlaceholder)
(...skipping 12 matching lines...) Expand all
23 /** @type {!WebInspector.DeviceModeWrapper} */ 23 /** @type {!WebInspector.DeviceModeWrapper} */
24 WebInspector.DeviceModeView._wrapperInstance; 24 WebInspector.DeviceModeView._wrapperInstance;
25 25
26 WebInspector.DeviceModeWrapper.prototype = { 26 WebInspector.DeviceModeWrapper.prototype = {
27 _toggleDeviceMode: function() 27 _toggleDeviceMode: function()
28 { 28 {
29 this._showDeviceModeSetting.set(!this._showDeviceModeSetting.get()); 29 this._showDeviceModeSetting.set(!this._showDeviceModeSetting.get());
30 }, 30 },
31 31
32 /** 32 /**
33 * @return {boolean}
34 */
35 _captureScreenshot: function()
36 {
37 if (!this._deviceModeView)
38 return false;
39 this._deviceModeView.captureScreenshot();
40 return true;
41 },
42
43 /**
33 * @param {boolean} force 44 * @param {boolean} force
34 */ 45 */
35 _update: function(force) 46 _update: function(force)
36 { 47 {
37 this._toggleDeviceModeAction.setToggled(this._showDeviceModeSetting.get( )); 48 this._toggleDeviceModeAction.setToggled(this._showDeviceModeSetting.get( ));
38 if (!force) { 49 if (!force) {
39 var showing = this._deviceModeView && this._deviceModeView.isShowing (); 50 var showing = this._deviceModeView && this._deviceModeView.isShowing ();
40 if (this._showDeviceModeSetting.get() === showing) 51 if (this._showDeviceModeSetting.get() === showing)
41 return; 52 return;
42 } 53 }
(...skipping 30 matching lines...) Expand all
73 * @param {string} actionId 84 * @param {string} actionId
74 * @return {boolean} 85 * @return {boolean}
75 */ 86 */
76 handleAction: function(context, actionId) 87 handleAction: function(context, actionId)
77 { 88 {
78 if (WebInspector.DeviceModeView._wrapperInstance) { 89 if (WebInspector.DeviceModeView._wrapperInstance) {
79 if (actionId === "emulation.toggle-device-mode") { 90 if (actionId === "emulation.toggle-device-mode") {
80 WebInspector.DeviceModeView._wrapperInstance._toggleDeviceMode() ; 91 WebInspector.DeviceModeView._wrapperInstance._toggleDeviceMode() ;
81 return true; 92 return true;
82 } 93 }
94 if (actionId === "emulation.capture-screenshot")
95 return WebInspector.DeviceModeView._wrapperInstance._captureScre enshot();
83 } 96 }
84 return false; 97 return false;
85 } 98 }
86 } 99 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698