Skip to content

Commit

Permalink
Bug 1329152 - Enable custom tabs by default r=sebastian
Browse files Browse the repository at this point in the history
Remove related options, just use CustomTabs directly.

MozReview-Commit-ID: DdcMHnsfAU1
  • Loading branch information
walkingice committed Apr 10, 2017
1 parent fae4767 commit 76abaa1
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 42 deletions.
5 changes: 0 additions & 5 deletions mobile/android/app/src/main/res/xml/preferences_advanced.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,6 @@
android:key="android.not_a_preference.category_experimental"
android:title="@string/pref_category_experimental">

<SwitchPreference android:key="android.not_a_preference.customtabs"
android:title="@string/pref_custom_tabs"
android:summary="@string/pref_custom_tabs_summary"
android:defaultValue="false" />

<SwitchPreference android:key="android.not_a_preference.pwa"
android:title="@string/pref_pwa"
android:summary="@string/pref_pwa_summary"
Expand Down
4 changes: 0 additions & 4 deletions mobile/android/base/AndroidManifest.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -312,12 +312,10 @@

</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" />
Expand Down Expand Up @@ -404,15 +402,13 @@
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">
<intent-filter>
<action android:name="android.support.customtabs.action.CustomTabsService" />
</intent-filter>
</service>
#endif

#include ../services/manifests/FxAccountAndroidManifest_services.xml.in

Expand Down
7 changes: 0 additions & 7 deletions mobile/android/base/AppConstants.java.in
Original file line number Diff line number Diff line change
Expand Up @@ -305,13 +305,6 @@ public class AppConstants {
false;
//#endif

public static final boolean MOZ_ANDROID_CUSTOM_TABS =
//#ifdef MOZ_ANDROID_CUSTOM_TABS
true;
//#else
false;
//#endif

public static final boolean MOZ_ANDROID_PWA =
//#ifdef MOZ_ANDROID_PWA
true;
Expand Down
1 change: 0 additions & 1 deletion mobile/android/base/generate_build_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ 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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ protected void onCreate(Bundle savedInstanceState) {
} else if (!isViewIntentWithURL(safeIntent)) {
dispatchNormalIntent();

// Is this a custom tabs intent, and are custom tabs enabled?
} else if (AppConstants.MOZ_ANDROID_CUSTOM_TABS && isCustomTabsIntent(safeIntent)
&& isCustomTabsEnabled()) {
} else if (isCustomTabsIntent(safeIntent)) {
dispatchCustomTabsIntent();

// Can we dispatch this VIEW action intent to the tab queue service?
Expand Down Expand Up @@ -170,10 +168,6 @@ private static boolean isWebAppIntent(@NonNull final SafeIntent safeIntent) {
return GeckoApp.ACTION_WEBAPP.equals(safeIntent.getAction());
}

private boolean isCustomTabsEnabled() {
return GeckoSharedPrefs.forApp(this).getBoolean(GeckoPreferences.PREFS_CUSTOM_TABS, false);
}

private static boolean isShutdownIntent(@NonNull final SafeIntent safeIntent) {
return GeckoApp.ACTION_SHUTDOWN.equals(safeIntent.getAction());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ 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_PWA = NON_PREF_PREFIX + "pwa";
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";
Expand Down Expand Up @@ -646,8 +645,7 @@ private void setupPreferences(PreferenceGroup preferences, ArrayList<String> pre
i--;
continue;
} else if (PREFS_CATEGORY_EXPERIMENTAL_FEATURES.equals(key)
&& !AppConstants.MOZ_ANDROID_PWA
&& !AppConstants.MOZ_ANDROID_CUSTOM_TABS) {
&& !AppConstants.MOZ_ANDROID_PWA) {
preferences.removePreference(pref);
i--;
continue;
Expand Down Expand Up @@ -810,10 +808,6 @@ public boolean onPreferenceClick(Preference preference) {
i--;
continue;
}
} else if (PREFS_CUSTOM_TABS.equals(key) && !AppConstants.MOZ_ANDROID_CUSTOM_TABS) {
preferences.removePreference(pref);
i--;
continue;
} else if (PREFS_PWA.equals(key) && !AppConstants.MOZ_ANDROID_PWA) {
preferences.removePreference(pref);
i--;
Expand Down
5 changes: 0 additions & 5 deletions mobile/android/base/locales/en-US/android_strings.dtd
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,6 @@
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;">
Expand Down
2 changes: 0 additions & 2 deletions mobile/android/base/strings.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,6 @@

<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>
Expand Down
4 changes: 0 additions & 4 deletions mobile/android/moz.configure
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ 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)

project_flag('MOZ_ANDROID_PWA',
help='Enable support for Progressive Web Apps',
default=milestone.is_nightly)
Expand Down

0 comments on commit 76abaa1

Please sign in to comment.