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

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

Issue 2835843002: Revert of [DevTools] Consolidate overlay-related functionality in Overlay domain (Closed)
Patch Set: Created 3 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 * @implements {SDK.TargetManager.Observer} 5 * @implements {SDK.TargetManager.Observer}
6 * @unrestricted 6 * @unrestricted
7 */ 7 */
8 Emulation.DeviceModeModel = class { 8 Emulation.DeviceModeModel = class {
9 /** 9 /**
10 * @param {function()} updateCallback 10 * @param {function()} updateCallback
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 this._scaleSetting.get(), this._deviceScaleFactorSetting.get() || defa ultDeviceScaleFactor, mobile, 465 this._scaleSetting.get(), this._deviceScaleFactorSetting.get() || defa ultDeviceScaleFactor, mobile,
466 screenHeight >= screenWidth ? Protocol.Emulation.ScreenOrientationType .PortraitPrimary : 466 screenHeight >= screenWidth ? Protocol.Emulation.ScreenOrientationType .PortraitPrimary :
467 Protocol.Emulation.ScreenOrientationType .LandscapePrimary, 467 Protocol.Emulation.ScreenOrientationType .LandscapePrimary,
468 resetPageScaleFactor); 468 resetPageScaleFactor);
469 this._applyUserAgent(mobile ? Emulation.DeviceModeModel._defaultMobileUser Agent : ''); 469 this._applyUserAgent(mobile ? Emulation.DeviceModeModel._defaultMobileUser Agent : '');
470 this._applyTouch( 470 this._applyTouch(
471 this._uaSetting.get() === Emulation.DeviceModeModel.UA.DesktopTouch || 471 this._uaSetting.get() === Emulation.DeviceModeModel.UA.DesktopTouch ||
472 this._uaSetting.get() === Emulation.DeviceModeModel.UA.Mobile, 472 this._uaSetting.get() === Emulation.DeviceModeModel.UA.Mobile,
473 this._uaSetting.get() === Emulation.DeviceModeModel.UA.Mobile); 473 this._uaSetting.get() === Emulation.DeviceModeModel.UA.Mobile);
474 } 474 }
475 var overlayModel = this._target ? this._target.model(SDK.OverlayModel) : nul l; 475 if (this._target)
476 if (overlayModel) 476 this._target.renderingAgent().setShowViewportSizeOnResize(this._type === E mulation.DeviceModeModel.Type.None);
477 overlayModel.setShowViewportSizeOnResize(this._type === Emulation.DeviceMo deModel.Type.None);
478 this._updateCallback.call(null); 477 this._updateCallback.call(null);
479 } 478 }
480 479
481 /** 480 /**
482 * @param {number} screenWidth 481 * @param {number} screenWidth
483 * @param {number} screenHeight 482 * @param {number} screenHeight
484 * @param {!UI.Insets=} outline 483 * @param {!UI.Insets=} outline
485 * @param {!UI.Insets=} insets 484 * @param {!UI.Insets=} insets
486 * @return {number} 485 * @return {number}
487 */ 486 */
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 695
697 Emulation.DeviceModeModel.MinDeviceSize = 50; 696 Emulation.DeviceModeModel.MinDeviceSize = 50;
698 Emulation.DeviceModeModel.MaxDeviceSize = 9999; 697 Emulation.DeviceModeModel.MaxDeviceSize = 9999;
699 698
700 699
701 Emulation.DeviceModeModel._defaultMobileUserAgent = 700 Emulation.DeviceModeModel._defaultMobileUserAgent =
702 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 ( KHTML, like Gecko) Chrome/%s Mobile Safari/537.36'; 701 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 ( KHTML, like Gecko) Chrome/%s Mobile Safari/537.36';
703 Emulation.DeviceModeModel._defaultMobileUserAgent = 702 Emulation.DeviceModeModel._defaultMobileUserAgent =
704 SDK.MultitargetNetworkManager.patchUserAgentWithChromeVersion(Emulation.Devi ceModeModel._defaultMobileUserAgent); 703 SDK.MultitargetNetworkManager.patchUserAgentWithChromeVersion(Emulation.Devi ceModeModel._defaultMobileUserAgent);
705 Emulation.DeviceModeModel.defaultMobileScaleFactor = 2; 704 Emulation.DeviceModeModel.defaultMobileScaleFactor = 2;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698