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

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

Issue 2851913002: [DevTools] Do not expose agents on Target
Patch Set: storage and tests.js 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 Persistence.persistence = 197 Persistence.persistence =
198 new Persistence.Persistence(Workspace.workspace, Bindings.breakpointMana ger, Workspace.fileSystemMapping); 198 new Persistence.Persistence(Workspace.workspace, Bindings.breakpointMana ger, Workspace.fileSystemMapping);
199 199
200 new Main.ExecutionContextSelector(SDK.targetManager, UI.context); 200 new Main.ExecutionContextSelector(SDK.targetManager, UI.context);
201 Bindings.blackboxManager = new Bindings.BlackboxManager(Bindings.debuggerWor kspaceBinding); 201 Bindings.blackboxManager = new Bindings.BlackboxManager(Bindings.debuggerWor kspaceBinding);
202 202
203 new Main.Main.PauseListener(); 203 new Main.Main.PauseListener();
204 new Main.Main.InspectedNodeRevealer(); 204 new Main.Main.InspectedNodeRevealer();
205 new Main.NetworkPanelIndicator(); 205 new Main.NetworkPanelIndicator();
206 new Main.SourcesPanelIndicator(); 206 new Main.SourcesPanelIndicator();
207 new Main.BackendSettingsSync();
208 207
209 UI.actionRegistry = new UI.ActionRegistry(); 208 UI.actionRegistry = new UI.ActionRegistry();
210 UI.shortcutRegistry = new UI.ShortcutRegistry(UI.actionRegistry, document); 209 UI.shortcutRegistry = new UI.ShortcutRegistry(UI.actionRegistry, document);
211 UI.ShortcutsScreen.registerShortcuts(); 210 UI.ShortcutsScreen.registerShortcuts();
212 this._registerForwardedShortcuts(); 211 this._registerForwardedShortcuts();
213 this._registerMessageSinkListener(); 212 this._registerMessageSinkListener();
214 213
215 self.runtime.extension(Common.AppProvider).instance().then(this._showAppUI.b ind(this)); 214 self.runtime.extension(Common.AppProvider).instance().then(this._showAppUI.b ind(this));
216 console.timeEnd('Main._createAppUI'); 215 console.timeEnd('Main._createAppUI');
217 } 216 }
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 UI.inspectorView.onSuspendStateChanged(suspended); 438 UI.inspectorView.onSuspendStateChanged(suspended);
440 } 439 }
441 }; 440 };
442 441
443 /** 442 /**
444 * @implements {Protocol.InspectorDispatcher} 443 * @implements {Protocol.InspectorDispatcher}
445 */ 444 */
446 Main.Main.InspectorModel = class extends SDK.SDKModel { 445 Main.Main.InspectorModel = class extends SDK.SDKModel {
447 /** 446 /**
448 * @param {!SDK.Target} target 447 * @param {!SDK.Target} target
448 * @param {!Protocol.Dispatcher} dispatcher
449 */ 449 */
450 constructor(target) { 450 constructor(target, dispatcher) {
451 super(target); 451 super(target, dispatcher);
452 target.registerInspectorDispatcher(this); 452 dispatcher.registerInspectorDispatcher(this);
453 target.inspectorAgent().enable(); 453 dispatcher.inspectorAgent().enable();
454 } 454 }
455 455
456 /** 456 /**
457 * @override 457 * @override
458 * @param {string} reason 458 * @param {string} reason
459 */ 459 */
460 detached(reason) { 460 detached(reason) {
461 Main._disconnectedScreenWithReasonWasShown = true; 461 Main._disconnectedScreenWithReasonWasShown = true;
462 Main.RemoteDebuggingTerminatedScreen.show(reason); 462 Main.RemoteDebuggingTerminatedScreen.show(reason);
463 } 463 }
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
895 /** 895 /**
896 * @override 896 * @override
897 */ 897 */
898 willHide() { 898 willHide() {
899 this._hideCallback.call(null); 899 this._hideCallback.call(null);
900 } 900 }
901 }; 901 };
902 902
903 903
904 /** 904 /**
905 * @implements {SDK.TargetManager.Observer}
906 * @unrestricted
907 */
908 Main.BackendSettingsSync = class {
909 constructor() {
910 this._autoAttachSetting = Common.settings.moduleSetting('autoAttachToCreated Pages');
911 this._autoAttachSetting.addChangeListener(this._update, this);
912 SDK.targetManager.observeTargets(this, SDK.Target.Capability.Browser);
913 }
914
915 /**
916 * @param {!SDK.Target} target
917 */
918 _updateTarget(target) {
919 target.pageAgent().setAutoAttachToCreatedPages(this._autoAttachSetting.get() );
920 }
921
922 _update() {
923 SDK.targetManager.targets(SDK.Target.Capability.Browser).forEach(this._updat eTarget, this);
924 }
925
926 /**
927 * @param {!SDK.Target} target
928 * @override
929 */
930 targetAdded(target) {
931 this._updateTarget(target);
932 }
933
934 /**
935 * @param {!SDK.Target} target
936 * @override
937 */
938 targetRemoved(target) {
939 }
940 };
941
942 /**
943 * @implements {UI.SettingUI} 905 * @implements {UI.SettingUI}
944 * @unrestricted 906 * @unrestricted
945 */ 907 */
946 Main.ShowMetricsRulersSettingUI = class { 908 Main.ShowMetricsRulersSettingUI = class {
947 /** 909 /**
948 * @override 910 * @override
949 * @return {?Element} 911 * @return {?Element}
950 */ 912 */
951 settingElement() { 913 settingElement() {
952 return UI.SettingsUI.createSettingCheckbox( 914 return UI.SettingsUI.createSettingCheckbox(
953 Common.UIString('Show rulers'), Common.moduleSetting('showMetricsRulers' )); 915 Common.UIString('Show rulers'), Common.moduleSetting('showMetricsRulers' ));
954 } 916 }
955 }; 917 };
956 918
957 new Main.Main(); 919 new Main.Main();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698