Backed out changeset e5ec40672f6e (bug 1258450)

--HG--
extra : rebase_source : fec0cf93dbd00663fbb072ffa3394c12b3cf7fc5
This commit is contained in:
Carsten "Tomcat" Book 2016-03-30 14:02:10 +02:00
Родитель d661d27402
Коммит 6079058c19
3 изменённых файлов: 15 добавлений и 64 удалений

Просмотреть файл

@ -161,22 +161,4 @@ public class BaseGeckoInterface implements GeckoAppShell.GeckoInterface {
public void setAccessibilityEnabled(boolean enabled) {
// By default, take no action when accessibility is toggled on or off.
}
@Override
public boolean openUriExternal(String targetURI, String mimeType, String packageName, String className, String action, String title) {
// By default, never open external URIs.
return false;
}
@Override
public String[] getHandlersForMimeType(String mimeType, String action) {
// By default, offer no handlers for any MIME type.
return new String[] {};
}
@Override
public String[] getHandlersForURL(String url, String action) {
// By default, offer no handlers for any URL.
return new String[] {};
}
}

Просмотреть файл

@ -2530,16 +2530,9 @@ public abstract class GeckoApp
mLayerView.setOverScrollMode(View.OVER_SCROLL_NEVER);
}
@Override
public void setAccessibilityEnabled(boolean enabled) {
}
@Override
public boolean openUriExternal(String targetURI, String mimeType, String packageName, String className, String action, String title) {
// Default to showing prompt in private browsing to be safe.
return IntentHelper.openUriExternal(targetURI, mimeType, packageName, className, action, title, true);
}
public static class MainLayout extends RelativeLayout {
private TouchEventInterceptor mTouchEventInterceptor;
private MotionEventInterceptor mMotionEventInterceptor;
@ -2794,23 +2787,4 @@ public abstract class GeckoApp
}
});
}
@Override
public String[] getHandlersForMimeType(String mimeType, String action) {
Intent intent = IntentHelper.getIntentForActionString(action);
if (mimeType != null && mimeType.length() > 0)
intent.setType(mimeType);
return IntentHelper.getHandlersForIntent(intent);
}
@Override
public String[] getHandlersForURL(String url, String action) {
// May contain the whole URL or just the protocol.
Uri uri = url.indexOf(':') >= 0 ? Uri.parse(url) : new Uri.Builder().scheme(url).build();
Intent intent = IntentHelper.getOpenURIIntent(getApplicationContext(), uri.toString(), "",
TextUtils.isEmpty(action) ? Intent.ACTION_VIEW : action, "");
return IntentHelper.getHandlersForIntent(intent);
}
}

Просмотреть файл

@ -20,6 +20,7 @@ import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.StringTokenizer;
import java.util.TreeMap;
@ -834,20 +835,21 @@ public class GeckoAppShell
@WrapForJNI(stubName = "GetHandlersForMimeTypeWrapper")
static String[] getHandlersForMimeType(String aMimeType, String aAction) {
final GeckoInterface geckoInterface = getGeckoInterface();
if (geckoInterface == null) {
return new String[] {};
}
return geckoInterface.getHandlersForMimeType(aMimeType, aAction);
Intent intent = IntentHelper.getIntentForActionString(aAction);
if (aMimeType != null && aMimeType.length() > 0)
intent.setType(aMimeType);
return IntentHelper.getHandlersForIntent(intent);
}
@WrapForJNI(stubName = "GetHandlersForURLWrapper")
static String[] getHandlersForURL(String aURL, String aAction) {
final GeckoInterface geckoInterface = getGeckoInterface();
if (geckoInterface == null) {
return new String[] {};
}
return geckoInterface.getHandlersForURL(aURL, aAction);
// aURL may contain the whole URL or just the protocol
Uri uri = aURL.indexOf(':') >= 0 ? Uri.parse(aURL) : new Uri.Builder().scheme(aURL).build();
Intent intent = IntentHelper.getOpenURIIntent(getApplicationContext(), uri.toString(), "",
TextUtils.isEmpty(aAction) ? Intent.ACTION_VIEW : aAction, "");
return IntentHelper.getHandlersForIntent(intent);
}
@WrapForJNI(stubName = "GetHWEncoderCapability")
@ -926,11 +928,9 @@ public class GeckoAppShell
String className,
String action,
String title) {
final GeckoInterface geckoInterface = getGeckoInterface();
if (geckoInterface == null) {
return false;
}
return geckoInterface.openUriExternal(targetURI, mimeType, packageName, className, action, title);
// Default to showing prompt in private browsing to be safe.
return IntentHelper.openUriExternal(targetURI, mimeType, packageName, className, action, title, true);
}
/**
@ -1815,11 +1815,6 @@ public class GeckoAppShell
public void setUriTitle(final String uri, final String title);
public void setAccessibilityEnabled(boolean enabled);
public boolean openUriExternal(String targetURI, String mimeType, String packageName, String className, String action, String title);
public String[] getHandlersForMimeType(String mimeType, String action);
public String[] getHandlersForURL(String url, String action);
};
private static GeckoInterface sGeckoInterface;