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

Unified Diff: dart/editor/tools/plugins/com.google.dart.tools.debug.ui/src/com/google/dart/tools/debug/ui/internal/DefaultDebugUIHelper.java

Issue 337623003: Version 1.5.0-dev.4.11 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: dart/editor/tools/plugins/com.google.dart.tools.debug.ui/src/com/google/dart/tools/debug/ui/internal/DefaultDebugUIHelper.java
===================================================================
--- dart/editor/tools/plugins/com.google.dart.tools.debug.ui/src/com/google/dart/tools/debug/ui/internal/DefaultDebugUIHelper.java (revision 37301)
+++ dart/editor/tools/plugins/com.google.dart.tools.debug.ui/src/com/google/dart/tools/debug/ui/internal/DefaultDebugUIHelper.java (working copy)
@@ -15,10 +15,12 @@
package com.google.dart.tools.debug.ui.internal;
import com.google.dart.tools.core.DartCore;
+import com.google.dart.tools.core.mobile.MobileUrlConnectionException;
import com.google.dart.tools.debug.core.DartDebugCorePlugin;
import com.google.dart.tools.debug.core.DebugUIHelper;
import com.google.dart.tools.debug.core.dartium.DartiumDebugTarget;
import com.google.dart.tools.debug.ui.internal.dartium.DevToolsDisconnectManager;
+import com.google.dart.tools.debug.ui.internal.dialogs.MobilePortForwardDialog;
import com.google.dart.tools.debug.ui.internal.util.LaunchUtils;
import com.google.dart.tools.debug.ui.internal.view.DebuggerView;
@@ -72,6 +74,27 @@
}
@Override
+ public void showError(String title, CoreException e) {
+
+ // Detect mobile launch port forwarding problems
+ // and present user with more specific dialog to help fix them fix the problem
+ if (e instanceof MobileUrlConnectionException) {
+ final String pageUrl = ((MobileUrlConnectionException) e).getPageUrl();
+ final boolean localhostOverUsb = ((MobileUrlConnectionException) e).isLocalhostOverUsb();
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
+ new MobilePortForwardDialog(shell, pageUrl, localhostOverUsb).open();
+ }
+ });
+ return;
+ }
+
+ showError(title, e.getMessage());
+ }
+
+ @Override
public void showError(final String title, final String message) {
final Display display = Display.getDefault();
@@ -217,5 +240,4 @@
return (Integer) method.invoke(null, window.longValue());
}
}
-
}

Powered by Google App Engine
This is Rietveld 408576698