| OLD | NEW |
| 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 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 864 Common.UIString('Reconnect when ready by reopening DevTools.'); | 864 Common.UIString('Reconnect when ready by reopening DevTools.'); |
| 865 var button = UI.createTextButton(Common.UIString('Reconnect DevTools'), () =
> window.location.reload()); | 865 var button = UI.createTextButton(Common.UIString('Reconnect DevTools'), () =
> window.location.reload()); |
| 866 this.contentElement.createChild('div', 'button').appendChild(button); | 866 this.contentElement.createChild('div', 'button').appendChild(button); |
| 867 } | 867 } |
| 868 | 868 |
| 869 /** | 869 /** |
| 870 * @param {string} reason | 870 * @param {string} reason |
| 871 */ | 871 */ |
| 872 static show(reason) { | 872 static show(reason) { |
| 873 var dialog = new UI.Dialog(); | 873 var dialog = new UI.Dialog(); |
| 874 dialog.setWrapsContent(true); | 874 dialog.setSizeBehavior(UI.GlassPane.SizeBehavior.MeasureContent); |
| 875 dialog.addCloseButton(); | 875 dialog.addCloseButton(); |
| 876 dialog.setDimmed(true); | 876 dialog.setDimmed(true); |
| 877 new Main.RemoteDebuggingTerminatedScreen(reason).show(dialog.element); | 877 new Main.RemoteDebuggingTerminatedScreen(reason).show(dialog.contentElement)
; |
| 878 dialog.show(); | 878 dialog.showDialog(); |
| 879 } | 879 } |
| 880 }; | 880 }; |
| 881 | 881 |
| 882 | 882 |
| 883 /** | 883 /** |
| 884 * @unrestricted | 884 * @unrestricted |
| 885 */ | 885 */ |
| 886 Main.TargetCrashedScreen = class extends UI.VBox { | 886 Main.TargetCrashedScreen = class extends UI.VBox { |
| 887 /** | 887 /** |
| 888 * @param {function()} hideCallback | 888 * @param {function()} hideCallback |
| 889 */ | 889 */ |
| 890 constructor(hideCallback) { | 890 constructor(hideCallback) { |
| 891 super(true); | 891 super(true); |
| 892 this.registerRequiredCSS('main/targetCrashedScreen.css'); | 892 this.registerRequiredCSS('main/targetCrashedScreen.css'); |
| 893 this.contentElement.createChild('div', 'message').textContent = | 893 this.contentElement.createChild('div', 'message').textContent = |
| 894 Common.UIString('DevTools was disconnected from the page.'); | 894 Common.UIString('DevTools was disconnected from the page.'); |
| 895 this.contentElement.createChild('div', 'message').textContent = | 895 this.contentElement.createChild('div', 'message').textContent = |
| 896 Common.UIString('Once page is reloaded, DevTools will automatically reco
nnect.'); | 896 Common.UIString('Once page is reloaded, DevTools will automatically reco
nnect.'); |
| 897 this._hideCallback = hideCallback; | 897 this._hideCallback = hideCallback; |
| 898 } | 898 } |
| 899 | 899 |
| 900 /** | 900 /** |
| 901 * @param {!SDK.DebuggerModel} debuggerModel | 901 * @param {!SDK.DebuggerModel} debuggerModel |
| 902 */ | 902 */ |
| 903 static show(debuggerModel) { | 903 static show(debuggerModel) { |
| 904 var dialog = new UI.Dialog(); | 904 var dialog = new UI.Dialog(); |
| 905 dialog.setWrapsContent(true); | 905 dialog.setSizeBehavior(UI.GlassPane.SizeBehavior.MeasureContent); |
| 906 dialog.addCloseButton(); | 906 dialog.addCloseButton(); |
| 907 dialog.setDimmed(true); | 907 dialog.setDimmed(true); |
| 908 var hideBound = dialog.detach.bind(dialog, false); | 908 var hideBound = dialog.hideDialog.bind(dialog); |
| 909 debuggerModel.addEventListener(SDK.DebuggerModel.Events.GlobalObjectCleared,
hideBound); | 909 debuggerModel.addEventListener(SDK.DebuggerModel.Events.GlobalObjectCleared,
hideBound); |
| 910 | 910 |
| 911 new Main.TargetCrashedScreen(onHide).show(dialog.element); | 911 new Main.TargetCrashedScreen(onHide).show(dialog.contentElement); |
| 912 dialog.show(); | 912 dialog.showDialog(); |
| 913 | 913 |
| 914 function onHide() { | 914 function onHide() { |
| 915 debuggerModel.removeEventListener(SDK.DebuggerModel.Events.GlobalObjectCle
ared, hideBound); | 915 debuggerModel.removeEventListener(SDK.DebuggerModel.Events.GlobalObjectCle
ared, hideBound); |
| 916 } | 916 } |
| 917 } | 917 } |
| 918 | 918 |
| 919 /** | 919 /** |
| 920 * @override | 920 * @override |
| 921 */ | 921 */ |
| 922 willHide() { | 922 willHide() { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 976 * @override | 976 * @override |
| 977 * @return {?Element} | 977 * @return {?Element} |
| 978 */ | 978 */ |
| 979 settingElement() { | 979 settingElement() { |
| 980 return UI.SettingsUI.createSettingCheckbox( | 980 return UI.SettingsUI.createSettingCheckbox( |
| 981 Common.UIString('Show rulers'), Common.moduleSetting('showMetricsRulers'
)); | 981 Common.UIString('Show rulers'), Common.moduleSetting('showMetricsRulers'
)); |
| 982 } | 982 } |
| 983 }; | 983 }; |
| 984 | 984 |
| 985 new Main.Main(); | 985 new Main.Main(); |
| OLD | NEW |