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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/main/Main.js

Issue 2843763004: [DevTools] Introduce EmulationModel which will encapsulate emulation (Closed)
Patch Set: +throttling Created 3 years, 7 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 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). 3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com).
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after
902 902
903 903
904 /** 904 /**
905 * @implements {SDK.TargetManager.Observer} 905 * @implements {SDK.TargetManager.Observer}
906 * @unrestricted 906 * @unrestricted
907 */ 907 */
908 Main.BackendSettingsSync = class { 908 Main.BackendSettingsSync = class {
909 constructor() { 909 constructor() {
910 this._autoAttachSetting = Common.settings.moduleSetting('autoAttachToCreated Pages'); 910 this._autoAttachSetting = Common.settings.moduleSetting('autoAttachToCreated Pages');
911 this._autoAttachSetting.addChangeListener(this._update, this); 911 this._autoAttachSetting.addChangeListener(this._update, this);
912 this._disableJavascriptSetting = Common.settings.moduleSetting('javaScriptDi sabled');
913 this._disableJavascriptSetting.addChangeListener(this._update, this);
914 SDK.targetManager.observeTargets(this, SDK.Target.Capability.Browser); 912 SDK.targetManager.observeTargets(this, SDK.Target.Capability.Browser);
915 } 913 }
916 914
917 /** 915 /**
918 * @param {!SDK.Target} target 916 * @param {!SDK.Target} target
919 */ 917 */
920 _updateTarget(target) { 918 _updateTarget(target) {
921 target.pageAgent().setAutoAttachToCreatedPages(this._autoAttachSetting.get() ); 919 target.pageAgent().setAutoAttachToCreatedPages(this._autoAttachSetting.get() );
922 target.emulationAgent().setScriptExecutionDisabled(this._disableJavascriptSe tting.get());
923 } 920 }
924 921
925 _update() { 922 _update() {
926 SDK.targetManager.targets(SDK.Target.Capability.Browser).forEach(this._updat eTarget, this); 923 SDK.targetManager.targets(SDK.Target.Capability.Browser).forEach(this._updat eTarget, this);
927 } 924 }
928 925
929 /** 926 /**
930 * @param {!SDK.Target} target 927 * @param {!SDK.Target} target
931 * @override 928 * @override
932 */ 929 */
(...skipping 18 matching lines...) Expand all
951 * @override 948 * @override
952 * @return {?Element} 949 * @return {?Element}
953 */ 950 */
954 settingElement() { 951 settingElement() {
955 return UI.SettingsUI.createSettingCheckbox( 952 return UI.SettingsUI.createSettingCheckbox(
956 Common.UIString('Show rulers'), Common.moduleSetting('showMetricsRulers' )); 953 Common.UIString('Show rulers'), Common.moduleSetting('showMetricsRulers' ));
957 } 954 }
958 }; 955 };
959 956
960 new Main.Main(); 957 new Main.Main();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698