Bug 1549741 - Removed TrackingProtectionPrompt. r=VladBaicu
authorNagy Mihaly <mihaly.nagy@softvision.com>
Mon, 13 May 2019 14:17:33 +0000
changeset 532509 7db0ea895005973d998409c051d9d7e69c2a896b
parent 532508 ff2278c703c15245c7d8639f4fc10d13ba44b51c
child 532510 419436973f91a86cee1fb0523be60f5b131847b4
push id11268
push usercsabou@mozilla.com
push dateTue, 14 May 2019 15:24:22 +0000
treeherdermozilla-beta@5fb7fcd568d6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersVladBaicu
bugs1549741
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1549741 - Removed TrackingProtectionPrompt. r=VladBaicu *** Differential Revision: https://phabricator.services.mozilla.com/D30918
mobile/android/app/src/main/res/drawable-hdpi/tracking_protection_toolbar_illustration.png
mobile/android/app/src/main/res/drawable-xhdpi/tracking_protection_toolbar_illustration.png
mobile/android/app/src/main/res/drawable-xxhdpi/tracking_protection_toolbar_illustration.png
mobile/android/app/src/main/res/layout/tracking_protection_prompt.xml
mobile/android/base/AndroidManifest.xml.in
mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
mobile/android/base/java/org/mozilla/gecko/preferences/GeckoPreferences.java
mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarDisplayLayout.java
mobile/android/base/java/org/mozilla/gecko/trackingprotection/TrackingProtectionPrompt.java
mobile/android/base/locales/en-US/android_strings.dtd
mobile/android/base/strings.xml.in
deleted file mode 100644
index e6749cbc8a32bad1207978e483baa984b2ae23ff..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 223deed57aed9ae843e9dfe12b38cbbf9eb1378e..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 555b3f6a2b956b59c40a8945a313c034a4aca73e..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/mobile/android/app/src/main/res/layout/tracking_protection_prompt.xml
+++ /dev/null
@@ -1,108 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<merge
-        xmlns:android="http://schemas.android.com/apk/res/android"
-        xmlns:tools="http://schemas.android.com/tools"
-        android:id="@+id/tracking_protection_container"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:clipChildren="false"
-        android:clipToPadding="false">
-
-    <LinearLayout
-            android:id="@+id/tracking_protection_inner_container"
-            android:layout_width="@dimen/overlay_prompt_container_width"
-            android:layout_height="wrap_content"
-            android:layout_gravity="bottom|center"
-            android:background="@android:color/white"
-            android:orientation="vertical"
-            android:paddingBottom="40dp">
-
-        <ScrollView android:layout_width="match_parent"
-                    android:layout_height="0dp"
-                    android:layout_weight="1"
-                    android:fillViewport="true"
-                    android:fadeScrollbars="false">
-
-            <LinearLayout
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:orientation="vertical">
-
-                <ImageView android:layout_width="wrap_content"
-                           android:layout_height="wrap_content"
-                           android:src="@drawable/tracking_protection_toolbar_illustration"
-                           android:layout_gravity="center"
-                           android:layout_marginTop="40dp"
-                           android:layout_marginBottom="20dp"/>
-
-                <TextView
-                        android:id="@+id/title"
-                        android:layout_width="@dimen/overlay_prompt_content_width"
-                        android:layout_height="wrap_content"
-                        android:layout_gravity="center"
-                        android:fontFamily="sans-serif-light"
-                        android:gravity="center_horizontal"
-                        android:text="@string/tracking_protection_prompt_title"
-                        android:textColor="@color/text_and_tabs_tray_grey"
-                        android:textSize="20sp"
-
-                        tools:text="Now with Tracking Protection"/>
-
-                <TextView
-                        android:id="@+id/text"
-                        android:layout_width="@dimen/overlay_prompt_content_width"
-                        android:layout_height="wrap_content"
-                        android:layout_gravity="center"
-                        android:gravity="center"
-                        android:lineSpacingMultiplier="1.25"
-                        android:paddingTop="20dp"
-                        android:text="@string/tracking_protection_prompt_text"
-                        android:textColor="@color/placeholder_grey"
-                        android:textSize="16sp"
-
-                        tools:text="Actively block tracking elements so you don't have to worry."/>
-
-                <TextView
-                        android:id="@+id/link_text"
-                        android:layout_width="@dimen/overlay_prompt_content_width"
-                        android:layout_height="wrap_content"
-                        android:layout_gravity="center"
-                        android:gravity="center"
-                        android:paddingBottom="30dp"
-                        android:paddingTop="20dp"
-                        android:text="@string/tracking_protection_prompt_tip_text"
-                        android:textColor="@color/link_blue"
-                        android:textSize="14sp"
-
-                        tools:text="Visit Privacy settings to learn more"/>
-
-            </LinearLayout>
-
-        </ScrollView>
-
-        <Button
-                android:id="@+id/ok_button"
-                style="@style/Widget.BaseButton"
-                android:layout_width="match_parent"
-
-                android:layout_height="52dp"
-                android:layout_gravity="center"
-                android:background="@drawable/button_background_action_photon_round"
-                android:text="@string/tracking_protection_prompt_action_button"
-                android:textColor="@android:color/white"
-                android:textSize="16sp"
-
-                android:layout_marginLeft="32dp"
-                android:layout_marginStart="32dp"
-                android:layout_marginRight="32dp"
-                android:layout_marginEnd="32dp"
-                tools:text="Got it"/>
-
-    </LinearLayout>
-
-</merge>
--- a/mobile/android/base/AndroidManifest.xml.in
+++ b/mobile/android/base/AndroidManifest.xml.in
@@ -200,20 +200,16 @@
         </service>
 
         <service
             android:name="org.mozilla.gecko.GeckoServicesCreatorService"
             android:exported="false"
             android:permission="android.permission.BIND_JOB_SERVICE">
         </service>
 
-        <activity android:name="org.mozilla.gecko.trackingprotection.TrackingProtectionPrompt"
-                  android:launchMode="singleTop"
-                  android:theme="@style/OverlayActivity" />
-
         <activity android:name="org.mozilla.gecko.promotion.SimpleHelperUI"
                   android:launchMode="singleTop"
                   android:theme="@style/OverlayActivity" />
 
         <!-- The main reason for the Tab Queue build flag is to not mess with the VIEW intent filter
              before the rest of the plumbing is in place -->
 
         <service android:name="org.mozilla.gecko.tabqueue.TabQueueService" />
--- a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
@@ -138,17 +138,16 @@ import org.mozilla.gecko.tabs.TabsPanel;
 import org.mozilla.gecko.telemetry.TelemetryCorePingDelegate;
 import org.mozilla.gecko.telemetry.TelemetryUploadService;
 import org.mozilla.gecko.telemetry.measurements.SearchCountMeasurements;
 import org.mozilla.gecko.toolbar.AutocompleteHandler;
 import org.mozilla.gecko.toolbar.BrowserToolbar;
 import org.mozilla.gecko.toolbar.BrowserToolbar.CommitEventSource;
 import org.mozilla.gecko.toolbar.BrowserToolbar.TabEditingState;
 import org.mozilla.gecko.toolbar.PwaConfirm;
-import org.mozilla.gecko.trackingprotection.TrackingProtectionPrompt;
 import org.mozilla.gecko.updater.PostUpdateHandler;
 import org.mozilla.gecko.updater.UpdateServiceHelper;
 import org.mozilla.gecko.util.ActivityUtils;
 import org.mozilla.gecko.util.ContextUtils;
 import org.mozilla.gecko.util.DrawableUtil;
 import org.mozilla.gecko.util.EventCallback;
 import org.mozilla.gecko.util.FileUtils;
 import org.mozilla.gecko.util.GamepadUtils;
@@ -2177,30 +2176,16 @@ public class BrowserApp extends GeckoApp
         addTab(Tabs.LOADURL_NONE);
     }
 
     @Override
     public void addPrivateTab() {
         Tabs.getInstance().addPrivateTab();
     }
 
-    public void showTrackingProtectionPromptIfApplicable() {
-        final SharedPreferences prefs = getSharedPreferences();
-
-        final boolean hasTrackingProtectionPromptBeShownBefore = prefs.getBoolean(GeckoPreferences.PREFS_TRACKING_PROTECTION_PROMPT_SHOWN, false);
-
-        if (hasTrackingProtectionPromptBeShownBefore) {
-            return;
-        }
-
-        prefs.edit().putBoolean(GeckoPreferences.PREFS_TRACKING_PROTECTION_PROMPT_SHOWN, true).apply();
-
-        startActivity(new Intent(BrowserApp.this, TrackingProtectionPrompt.class));
-    }
-
     @Override
     public void showNormalTabs() {
         showTabs(TabsPanel.Panel.NORMAL_TABS);
     }
 
     @Override
     public void showPrivateTabs() {
         showTabs(TabsPanel.Panel.PRIVATE_TABS);
--- a/mobile/android/base/java/org/mozilla/gecko/preferences/GeckoPreferences.java
+++ b/mobile/android/base/java/org/mozilla/gecko/preferences/GeckoPreferences.java
@@ -114,17 +114,16 @@ public class GeckoPreferences
     // We have a white background, which makes transitions on
     // some devices look bad. Don't use transitions on those
     // devices.
     private static final boolean NO_TRANSITIONS = HardwareUtils.IS_KINDLE_DEVICE;
     private static final int NO_SUCH_ID = 0;
 
     public static final String NON_PREF_PREFIX = "android.not_a_preference.";
     public static final String INTENT_EXTRA_RESOURCES = "resource";
-    public static final String PREFS_TRACKING_PROTECTION_PROMPT_SHOWN = NON_PREF_PREFIX + "trackingProtectionPromptShown";
     public static final String PREFS_HEALTHREPORT_UPLOAD_ENABLED = NON_PREF_PREFIX + "healthreport.uploadEnabled";
     public static final String PREFS_SYNC = NON_PREF_PREFIX + "sync";
 
     private static boolean sIsCharEncodingEnabled;
     private boolean mInitialized;
     private PrefsHelper.PrefHandler mPrefsRequest;
     private List<Header> mHeaders;
 
--- a/mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarDisplayLayout.java
+++ b/mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarDisplayLayout.java
@@ -55,18 +55,16 @@ import android.widget.HorizontalScrollVi
 * {@code ToolbarDisplayLayout} is meant to be owned by {@code BrowserToolbar}
 * which is the main event bus for the toolbar subsystem.
 */
 public class ToolbarDisplayLayout extends ThemedLinearLayout {
     private static final String LOGTAG = "GeckoToolbarDisplayLayout";
 
     private static final int MIN_DOMAIN_SCROLL_MARGIN_DP = 10;
 
-    private boolean mTrackingProtectionEnabled;
-
     // To be used with updateFromTab() to allow the caller
     // to give enough context for the requested state change.
     enum UpdateFlags {
         TITLE,
         FAVICON,
         PROGRESS,
         SITE_IDENTITY,
         PRIVATE_MODE,
@@ -358,17 +356,16 @@ public class ToolbarDisplayLayout extend
     }
 
     private void updateSiteIdentity(@NonNull Tab tab) {
         final SiteIdentity siteIdentity = tab.getSiteIdentity();
         final SecurityModeUtil.IconType type = SecurityModeUtil.resolve(siteIdentity, tab.getURL());
         final int imageLevel = type.getImageLevel();
 
         mSiteIdentityPopup.setSiteIdentity(siteIdentity);
-        mTrackingProtectionEnabled = SecurityModeUtil.isTrackingProtectionEnabled(siteIdentity);
 
         if (mSecurityImageLevel != imageLevel) {
             mSecurityImageLevel = imageLevel;
             mSiteSecurity.setImageLevel(mSecurityImageLevel);
             updatePageActions();
         }
     }
 
@@ -418,20 +415,16 @@ public class ToolbarDisplayLayout extend
         final int scrollTarget = domainTextWidth + targetMargin - scrollViewWidth;
         mTitleScroll.scrollTo(scrollTarget, 0);
     }
 
     private void updateProgress(@NonNull Tab tab) {
         final boolean shouldShowThrobber = tab.getState() == Tab.STATE_LOADING;
 
         updateUiMode(shouldShowThrobber ? UIMode.PROGRESS : UIMode.DISPLAY);
-
-        if (Tab.STATE_SUCCESS == tab.getState() && mTrackingProtectionEnabled) {
-            mActivity.showTrackingProtectionPromptIfApplicable();
-        }
     }
 
     private void updateUiMode(UIMode uiMode) {
         if (mUiMode == uiMode) {
             return;
         }
 
         mUiMode = uiMode;
deleted file mode 100644
--- a/mobile/android/base/java/org/mozilla/gecko/trackingprotection/TrackingProtectionPrompt.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package org.mozilla.gecko.trackingprotection;
-
-import org.mozilla.gecko.Locales;
-import org.mozilla.gecko.R;
-import org.mozilla.gecko.preferences.GeckoPreferences;
-import org.mozilla.gecko.util.HardwareUtils;
-
-import android.content.Intent;
-import android.os.Bundle;
-import android.view.MotionEvent;
-import android.view.View;
-import android.animation.Animator;
-import android.animation.AnimatorListenerAdapter;
-import android.animation.AnimatorSet;
-import android.animation.ObjectAnimator;
-
-public class TrackingProtectionPrompt extends Locales.LocaleAwareActivity {
-        public static final String LOGTAG = "Gecko" + TrackingProtectionPrompt.class.getSimpleName();
-
-        // Flag set during animation to prevent animation multiple-start.
-        private boolean isAnimating;
-
-        private View containerView;
-
-        @Override
-        protected void onCreate(Bundle savedInstanceState) {
-            super.onCreate(savedInstanceState);
-
-            showPrompt();
-        }
-
-        private void showPrompt() {
-            setContentView(R.layout.tracking_protection_prompt);
-
-            findViewById(R.id.ok_button).setOnClickListener(new View.OnClickListener() {
-                @Override
-                public void onClick(View v) {
-                    onConfirmButtonPressed();
-                }
-            });
-            findViewById(R.id.link_text).setOnClickListener(new View.OnClickListener() {
-                @Override
-                public void onClick(View v) {
-                    slideOut();
-                    final Intent settingsIntent = new Intent(TrackingProtectionPrompt.this, GeckoPreferences.class);
-                    GeckoPreferences.setResourceToOpen(settingsIntent, "preferences_privacy");
-                    startActivity(settingsIntent);
-
-                    // Don't use a transition to settings if we're on a device where that
-                    // would look bad.
-                    if (HardwareUtils.IS_KINDLE_DEVICE) {
-                        overridePendingTransition(0, 0);
-                    }
-                }
-            });
-
-            containerView = findViewById(R.id.tracking_protection_inner_container);
-
-            containerView.setTranslationY(500);
-            containerView.setAlpha(0);
-
-            final Animator translateAnimator = ObjectAnimator.ofFloat(containerView, "translationY", 0);
-            translateAnimator.setDuration(400);
-
-            final Animator alphaAnimator = ObjectAnimator.ofFloat(containerView, "alpha", 1);
-            alphaAnimator.setStartDelay(200);
-            alphaAnimator.setDuration(600);
-
-            final AnimatorSet set = new AnimatorSet();
-            set.playTogether(alphaAnimator, translateAnimator);
-            set.setStartDelay(400);
-
-            set.start();
-        }
-
-        @Override
-        public void finish() {
-            super.finish();
-
-            // Don't perform an activity-dismiss animation.
-            overridePendingTransition(0, 0);
-        }
-
-        private void onConfirmButtonPressed() {
-            slideOut();
-        }
-
-        /**
-         * Slide the overlay down off the screen and destroy it.
-         */
-        private void slideOut() {
-            if (isAnimating) {
-                return;
-            }
-
-            isAnimating = true;
-
-            ObjectAnimator animator = ObjectAnimator.ofFloat(containerView, "translationY", containerView.getHeight());
-            animator.addListener(new AnimatorListenerAdapter() {
-
-                @Override
-                public void onAnimationEnd(Animator animation) {
-                    finish();
-                }
-
-            });
-            animator.start();
-        }
-
-        /**
-         * Close the dialog if back is pressed.
-         */
-        @Override
-        public void onBackPressed() {
-            slideOut();
-        }
-
-        /**
-         * Close the dialog if the anything that isn't a button is tapped.
-         */
-        @Override
-        public boolean onTouchEvent(MotionEvent event) {
-            slideOut();
-            return true;
-        }
-    }
--- a/mobile/android/base/locales/en-US/android_strings.dtd
+++ b/mobile/android/base/locales/en-US/android_strings.dtd
@@ -323,21 +323,16 @@
 <!ENTITY custom_tabs_menu_item_open_in "Open in &formatS;">
 <!ENTITY custom_tabs_menu_footer "Powered by &brandShortName;">
 <!-- Long-click title of CustomTabsActivity will copy URL to clipboard and display this hint -->
 <!ENTITY custom_tabs_hint_url_copy "URL copied">
 
 <!ENTITY pref_pwa "Progressive Web Apps">
 <!ENTITY pref_pwa_summary "Allow web apps to be added to home screen">
 
-<!ENTITY tracking_protection_prompt_title "Now with Tracking Protection">
-<!ENTITY tracking_protection_prompt_text "Actively block tracking elements so you don\'t have to worry.">
-<!ENTITY tracking_protection_prompt_tip_text "Visit Privacy settings to learn more">
-<!ENTITY tracking_protection_prompt_action_button "Got it!">
-
 <!ENTITY tab_queue_toast_message3 "Tab saved in &brandShortName;">
 <!ENTITY tab_queue_toast_action "Open now">
 <!ENTITY tab_queue_prompt_title "Opening multiple links?">
 <!ENTITY tab_queue_prompt_text4 "Save them until the next time you open &brandShortName;.">
 <!ENTITY tab_queue_prompt_tip_text2 "You can change this later in Settings">
 <!-- Localization note (tab_queue_prompt_permit_drawing_over_apps): This additional text is shown if the
      user needs to enable an Android setting in order to enable tab queues. -->
 <!ENTITY tab_queue_prompt_permit_drawing_over_apps "Turn on Permit drawing over other apps">
--- a/mobile/android/base/strings.xml.in
+++ b/mobile/android/base/strings.xml.in
@@ -285,21 +285,16 @@
   <string name="pref_private_data_syncedTabs">&pref_private_data_syncedTabs;</string>
   <string name="pref_import_android">&pref_import_options;</string>
   <string name="pref_import_android_summary">&pref_import_android_summary;</string>
   <string name="pref_update_autodownload">&pref_update_autodownload3;</string>
   <string name="pref_update_autodownload_wifi">&pref_update_autodownload_wifi;</string>
   <string name="pref_update_autodownload_disabled">&pref_update_autodownload_never;</string>
   <string name="pref_update_autodownload_enabled">&pref_update_autodownload_always;</string>
 
-  <string name="tracking_protection_prompt_title">&tracking_protection_prompt_title;</string>
-  <string name="tracking_protection_prompt_text">&tracking_protection_prompt_text;</string>
-  <string name="tracking_protection_prompt_tip_text">&tracking_protection_prompt_tip_text;</string>
-  <string name="tracking_protection_prompt_action_button">&tracking_protection_prompt_action_button;</string>
-
   <string name="pref_tab_queue_title">&pref_tab_queue_title3;</string>
   <string name="pref_tab_queue_summary">&pref_tab_queue_summary4;</string>
   <string name="tab_queue_prompt_title">&tab_queue_prompt_title;</string>
   <string name="tab_queue_prompt_text">&tab_queue_prompt_text4;</string>
   <string name="tab_queue_prompt_tip_text">&tab_queue_prompt_tip_text2;</string>
   <string name="tab_queue_prompt_positive_action_button">&tab_queue_prompt_positive_action_button;</string>
   <string name="tab_queue_prompt_negative_action_button">&tab_queue_prompt_negative_action_button;</string>
   <string name="tab_queue_prompt_permit_drawing_over_apps">&tab_queue_prompt_permit_drawing_over_apps;</string>