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

Side by Side Diff: Source/devtools/front_end/emulation/OverridesView.js

Issue 1178643004: [DevTools] Initial implementation of device modes. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Turn into class Created 5 years, 6 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 | Annotate | Revision Log
OLDNEW
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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 192
193 WebInspector.OverridesView.DeviceTab.prototype = { 193 WebInspector.OverridesView.DeviceTab.prototype = {
194 _createDeviceElement: function() 194 _createDeviceElement: function()
195 { 195 {
196 var fieldsetElement = createElement("fieldset"); 196 var fieldsetElement = createElement("fieldset");
197 fieldsetElement.id = "metrics-override-section"; 197 fieldsetElement.id = "metrics-override-section";
198 198
199 var deviceModelElement = fieldsetElement.createChild("p", "overrides-dev ice-model-section"); 199 var deviceModelElement = fieldsetElement.createChild("p", "overrides-dev ice-model-section");
200 deviceModelElement.createChild("span").textContent = WebInspector.UIStri ng("Model:"); 200 deviceModelElement.createChild("span").textContent = WebInspector.UIStri ng("Model:");
201 201
202 deviceModelElement.appendChild(WebInspector.OverridesUI.createDeviceSele ct()); 202 var rotateButton = createElement("button");
203 rotateButton.textContent = " \u21C4 ";
204 var deviceSelect = new WebInspector.DeviceSelect(rotateButton);
205 deviceModelElement.appendChild(deviceSelect.element);
203 206
204 var emulateResolutionCheckbox = WebInspector.SettingsUI.createSettingChe ckbox(WebInspector.UIString("Emulate screen resolution"), WebInspector.overrides Support.settings.emulateResolution, true); 207 var emulateResolutionCheckbox = WebInspector.SettingsUI.createSettingChe ckbox(WebInspector.UIString("Emulate screen resolution"), WebInspector.overrides Support.settings.emulateResolution, true);
205 fieldsetElement.appendChild(emulateResolutionCheckbox); 208 fieldsetElement.appendChild(emulateResolutionCheckbox);
206 var resolutionFieldset = WebInspector.SettingsUI.createSettingFieldset(W ebInspector.overridesSupport.settings.emulateResolution); 209 var resolutionFieldset = WebInspector.SettingsUI.createSettingFieldset(W ebInspector.overridesSupport.settings.emulateResolution);
207 fieldsetElement.appendChild(resolutionFieldset); 210 fieldsetElement.appendChild(resolutionFieldset);
208 211
209 var tableElement = resolutionFieldset.createChild("table"); 212 var tableElement = resolutionFieldset.createChild("table");
210 var rowElement = tableElement.createChild("tr"); 213 var rowElement = tableElement.createChild("tr");
211 var cellElement = rowElement.createChild("td"); 214 var cellElement = rowElement.createChild("td");
212 cellElement.createTextChild(WebInspector.UIString("Resolution:")); 215 cellElement.createTextChild(WebInspector.UIString("Resolution:"));
213 cellElement = rowElement.createChild("td"); 216 cellElement = rowElement.createChild("td");
214 217
215 var widthOverrideInput = WebInspector.SettingsUI.createSettingInputField ("", WebInspector.overridesSupport.settings.deviceWidth, true, 4, "80px", WebIns pector.OverridesSupport.deviceSizeValidator, true, true, WebInspector.UIString(" \u2013")); 218 var widthOverrideInput = WebInspector.SettingsUI.createSettingInputField ("", WebInspector.overridesSupport.settings.deviceWidth, true, 4, "80px", WebIns pector.OverridesSupport.deviceSizeValidator, true, true, WebInspector.UIString(" \u2013"));
216 cellElement.appendChild(widthOverrideInput); 219 cellElement.appendChild(widthOverrideInput);
217 this._swapDimensionsElement = cellElement.createChild("button", "overrid es-swap");
218 this._swapDimensionsElement.createTextChild(" \u21C4 "); // RIGHTWARDS A RROW OVER LEFTWARDS ARROW.
219 this._swapDimensionsElement.title = WebInspector.UIString("Swap dimensio ns");
220 this._swapDimensionsElement.addEventListener("click", WebInspector.overr idesSupport.swapDimensions.bind(WebInspector.overridesSupport), false);
221 this._swapDimensionsElement.tabIndex = -1;
222 var heightOverrideInput = WebInspector.SettingsUI.createSettingInputFiel d("", WebInspector.overridesSupport.settings.deviceHeight, true, 4, "80px", WebI nspector.OverridesSupport.deviceSizeValidator, true, true, WebInspector.UIString ("\u2013")); 220 var heightOverrideInput = WebInspector.SettingsUI.createSettingInputFiel d("", WebInspector.overridesSupport.settings.deviceHeight, true, 4, "80px", WebI nspector.OverridesSupport.deviceSizeValidator, true, true, WebInspector.UIString ("\u2013"));
223 cellElement.appendChild(heightOverrideInput); 221 cellElement.appendChild(heightOverrideInput);
224 222
225 rowElement = tableElement.createChild("tr"); 223 rowElement = tableElement.createChild("tr");
226 cellElement = rowElement.createChild("td"); 224 cellElement = rowElement.createChild("td");
227 cellElement.colSpan = 4; 225 cellElement.colSpan = 4;
228 226
229 rowElement = tableElement.createChild("tr"); 227 rowElement = tableElement.createChild("tr");
230 rowElement.title = WebInspector.UIString("Ratio between a device's physi cal pixels and device-independent pixels."); 228 rowElement.title = WebInspector.UIString("Ratio between a device's physi cal pixels and device-independent pixels.");
231 rowElement.createChild("td").createTextChild(WebInspector.UIString("Devi ce pixel ratio:")); 229 rowElement.createChild("td").createTextChild(WebInspector.UIString("Devi ce pixel ratio:"));
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 * @override 615 * @override
618 * @param {!Object} overridesSupport 616 * @param {!Object} overridesSupport
619 * @return {!Promise} 617 * @return {!Promise}
620 */ 618 */
621 reveal: function(overridesSupport) 619 reveal: function(overridesSupport)
622 { 620 {
623 WebInspector.inspectorView.showViewInDrawer("emulation"); 621 WebInspector.inspectorView.showViewInDrawer("emulation");
624 return Promise.resolve(); 622 return Promise.resolve();
625 } 623 }
626 } 624 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/emulation/OverridesUI.js ('k') | Source/devtools/front_end/emulation/ResponsiveDesignView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698