зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 3e06253547af (bug 1329152) on developers request / bug 1371561
This commit is contained in:
Родитель
ddd92794b2
Коммит
59fc3e791f
|
@ -312,10 +312,12 @@
|
|||
|
||||
</activity>
|
||||
|
||||
#ifdef MOZ_ANDROID_CUSTOM_TABS
|
||||
<activity android:name="org.mozilla.gecko.customtabs.CustomTabsActivity"
|
||||
android:configChanges="keyboard|keyboardHidden|mcc|mnc|orientation|screenSize|locale|layoutDirection|smallestScreenSize|screenLayout"
|
||||
android:windowSoftInputMode="stateUnspecified|adjustResize"
|
||||
android:theme="@style/GeckoCustomTabs" />
|
||||
#endif
|
||||
|
||||
<activity android:name="org.mozilla.gecko.webapps.WebAppActivity"
|
||||
android:theme="@style/Theme.AppCompat.NoActionBar" />
|
||||
|
@ -419,6 +421,7 @@
|
|||
android:name="org.mozilla.gecko.telemetry.TelemetryUploadService"
|
||||
android:exported="false"/>
|
||||
|
||||
#ifdef MOZ_ANDROID_CUSTOM_TABS
|
||||
<service
|
||||
android:name="org.mozilla.gecko.customtabs.GeckoCustomTabsService"
|
||||
android:exported="true">
|
||||
|
@ -426,6 +429,7 @@
|
|||
<action android:name="android.support.customtabs.action.CustomTabsService" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
#endif
|
||||
|
||||
#include ../services/manifests/FxAccountAndroidManifest_services.xml.in
|
||||
|
||||
|
|
|
@ -309,6 +309,13 @@ public class AppConstants {
|
|||
false;
|
||||
//#endif
|
||||
|
||||
public static final boolean MOZ_ANDROID_CUSTOM_TABS =
|
||||
//#ifdef MOZ_ANDROID_CUSTOM_TABS
|
||||
true;
|
||||
//#else
|
||||
false;
|
||||
//#endif
|
||||
|
||||
// (bug 1266820) Temporarily disabled since no one is working on it.
|
||||
public static final boolean SCREENSHOTS_IN_BOOKMARKS_ENABLED = false;
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@ def _defines():
|
|||
for var in ('MOZ_ANDROID_ACTIVITY_STREAM'
|
||||
'MOZ_ANDROID_ANR_REPORTER',
|
||||
'MOZ_ANDROID_BEAM',
|
||||
'MOZ_ANDROID_CUSTOM_TABS',
|
||||
'MOZ_ANDROID_DOWNLOADS_INTEGRATION',
|
||||
'MOZ_ANDROID_DOWNLOAD_CONTENT_SERVICE',
|
||||
'MOZ_ANDROID_EXCLUDE_FONTS',
|
||||
|
|
|
@ -65,7 +65,9 @@ public class LauncherActivity extends Activity {
|
|||
} else if (!isViewIntentWithURL(safeIntent)) {
|
||||
dispatchNormalIntent();
|
||||
|
||||
} else if (isCustomTabsIntent(safeIntent)) {
|
||||
// Is this a custom tabs intent, and are custom tabs enabled?
|
||||
} else if (AppConstants.MOZ_ANDROID_CUSTOM_TABS && isCustomTabsIntent(safeIntent)
|
||||
&& isCustomTabsEnabled()) {
|
||||
dispatchCustomTabsIntent();
|
||||
|
||||
// Can we dispatch this VIEW action intent to the tab queue service?
|
||||
|
@ -156,6 +158,10 @@ public class LauncherActivity extends Activity {
|
|||
return GeckoApp.ACTION_WEBAPP.equals(safeIntent.getAction());
|
||||
}
|
||||
|
||||
private boolean isCustomTabsEnabled() {
|
||||
return GeckoSharedPrefs.forApp(this).getBoolean(GeckoPreferences.PREFS_CUSTOM_TABS, false);
|
||||
}
|
||||
|
||||
private boolean isDeepLink(SafeIntent intent) {
|
||||
if (intent == null || intent.getData() == null || intent.getData().getScheme() == null
|
||||
|| intent.getAction() == null) {
|
||||
|
|
|
@ -161,6 +161,7 @@ public class GeckoPreferences
|
|||
public static final String PREFS_APP_UPDATE_LAST_BUILD_ID = "app.update.last_build_id";
|
||||
public static final String PREFS_READ_PARTNER_CUSTOMIZATIONS_PROVIDER = NON_PREF_PREFIX + "distribution.read_partner_customizations_provider";
|
||||
public static final String PREFS_READ_PARTNER_BOOKMARKS_PROVIDER = NON_PREF_PREFIX + "distribution.read_partner_bookmarks_provider";
|
||||
public static final String PREFS_CUSTOM_TABS = NON_PREF_PREFIX + "customtabs";
|
||||
public static final String PREFS_ACTIVITY_STREAM = NON_PREF_PREFIX + "experiments.activitystream";
|
||||
public static final String PREFS_CATEGORY_EXPERIMENTAL_FEATURES = NON_PREF_PREFIX + "category_experimental";
|
||||
public static final String PREFS_COMPACT_TABS = NON_PREF_PREFIX + "compact_tabs";
|
||||
|
@ -695,6 +696,7 @@ public class GeckoPreferences
|
|||
i--;
|
||||
continue;
|
||||
} else if (PREFS_CATEGORY_EXPERIMENTAL_FEATURES.equals(key)
|
||||
&& !AppConstants.MOZ_ANDROID_CUSTOM_TABS
|
||||
&& !ActivityStream.isUserSwitchable(this)) {
|
||||
preferences.removePreference(pref);
|
||||
i--;
|
||||
|
@ -885,6 +887,10 @@ public class GeckoPreferences
|
|||
i--;
|
||||
continue;
|
||||
}
|
||||
} else if (PREFS_CUSTOM_TABS.equals(key) && !AppConstants.MOZ_ANDROID_CUSTOM_TABS) {
|
||||
preferences.removePreference(pref);
|
||||
i--;
|
||||
continue;
|
||||
} else if (PREFS_ACTIVITY_STREAM.equals(key)
|
||||
&& !ActivityStream.isUserSwitchable(this)) {
|
||||
preferences.removePreference(pref);
|
||||
|
|
|
@ -283,6 +283,11 @@
|
|||
for experimental features. -->
|
||||
<!ENTITY pref_category_experimental "Experimental features">
|
||||
|
||||
<!-- Custom Tabs is an Android API for allowing third-party apps to open URLs in a customized UI.
|
||||
Instead of switching to the browser it appears as if the user stays in the third-party app.
|
||||
For more see: https://developer.chrome.com/multidevice/android/customtabs -->
|
||||
<!ENTITY pref_custom_tabs "Custom Tabs">
|
||||
<!ENTITY pref_custom_tabs_summary3 "Allow apps to open websites using a customized version of &brandShortName;">
|
||||
<!-- Localization note (custom_tabs_menu_item_open_in): The variable is replaced by the name of
|
||||
default browser from user's preference, such as "Open in Firefox" -->
|
||||
<!ENTITY custom_tabs_menu_item_open_in "Open in &formatS;">
|
||||
|
|
|
@ -89,6 +89,12 @@
|
|||
android:title="@string/pref_activity_stream"
|
||||
android:summary="@string/pref_activity_stream_summary" />
|
||||
|
||||
|
||||
<SwitchPreference android:key="android.not_a_preference.customtabs"
|
||||
android:title="@string/pref_custom_tabs"
|
||||
android:summary="@string/pref_custom_tabs_summary"
|
||||
android:defaultValue="false" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
</PreferenceScreen>
|
||||
|
|
|
@ -241,6 +241,8 @@
|
|||
|
||||
<string name="pref_category_experimental">&pref_category_experimental;</string>
|
||||
|
||||
<string name="pref_custom_tabs">&pref_custom_tabs;</string>
|
||||
<string name="pref_custom_tabs_summary">&pref_custom_tabs_summary3;</string>
|
||||
<string name="custom_tabs_menu_item_open_in">&custom_tabs_menu_item_open_in;</string>
|
||||
<string name="custom_tabs_menu_footer">&custom_tabs_menu_footer;</string>
|
||||
<string name="custom_tabs_hint_url_copy">&custom_tabs_hint_url_copy;</string>
|
||||
|
|
|
@ -68,6 +68,10 @@ project_flag('MOZ_ANDROID_DOWNLOAD_CONTENT_SERVICE',
|
|||
help='Background service for downloading additional content at runtime',
|
||||
default=True)
|
||||
|
||||
project_flag('MOZ_ANDROID_CUSTOM_TABS',
|
||||
help='Enable support for Android custom tabs',
|
||||
default=milestone.is_nightly)
|
||||
|
||||
# Enable the Switchboard A/B framework code.
|
||||
# Note: The framework is always included in the app. This flag controls
|
||||
# usage of the framework.
|
||||
|
|
Загрузка…
Ссылка в новой задаче