mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-25 03:05:34 +00:00
Bug 1549741 - Removed TrackingProtectionPrompt. r=VladBaicu
*** Differential Revision: https://phabricator.services.mozilla.com/D30918 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
e454783943
commit
b72de12fc1
Binary file not shown.
Before Width: | Height: | Size: 2.4 KiB |
Binary file not shown.
Before Width: | Height: | Size: 3.4 KiB |
Binary file not shown.
Before Width: | Height: | Size: 5.5 KiB |
@ -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>
|
|
@ -205,10 +205,6 @@
|
|||||||
android:permission="android.permission.BIND_JOB_SERVICE">
|
android:permission="android.permission.BIND_JOB_SERVICE">
|
||||||
</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"
|
<activity android:name="org.mozilla.gecko.promotion.SimpleHelperUI"
|
||||||
android:launchMode="singleTop"
|
android:launchMode="singleTop"
|
||||||
android:theme="@style/OverlayActivity" />
|
android:theme="@style/OverlayActivity" />
|
||||||
|
@ -143,7 +143,6 @@ import org.mozilla.gecko.toolbar.BrowserToolbar;
|
|||||||
import org.mozilla.gecko.toolbar.BrowserToolbar.CommitEventSource;
|
import org.mozilla.gecko.toolbar.BrowserToolbar.CommitEventSource;
|
||||||
import org.mozilla.gecko.toolbar.BrowserToolbar.TabEditingState;
|
import org.mozilla.gecko.toolbar.BrowserToolbar.TabEditingState;
|
||||||
import org.mozilla.gecko.toolbar.PwaConfirm;
|
import org.mozilla.gecko.toolbar.PwaConfirm;
|
||||||
import org.mozilla.gecko.trackingprotection.TrackingProtectionPrompt;
|
|
||||||
import org.mozilla.gecko.updater.PostUpdateHandler;
|
import org.mozilla.gecko.updater.PostUpdateHandler;
|
||||||
import org.mozilla.gecko.updater.UpdateServiceHelper;
|
import org.mozilla.gecko.updater.UpdateServiceHelper;
|
||||||
import org.mozilla.gecko.util.ActivityUtils;
|
import org.mozilla.gecko.util.ActivityUtils;
|
||||||
@ -2182,20 +2181,6 @@ public class BrowserApp extends GeckoApp
|
|||||||
Tabs.getInstance().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
|
@Override
|
||||||
public void showNormalTabs() {
|
public void showNormalTabs() {
|
||||||
showTabs(TabsPanel.Panel.NORMAL_TABS);
|
showTabs(TabsPanel.Panel.NORMAL_TABS);
|
||||||
|
@ -119,7 +119,6 @@ public class GeckoPreferences
|
|||||||
|
|
||||||
public static final String NON_PREF_PREFIX = "android.not_a_preference.";
|
public static final String NON_PREF_PREFIX = "android.not_a_preference.";
|
||||||
public static final String INTENT_EXTRA_RESOURCES = "resource";
|
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_HEALTHREPORT_UPLOAD_ENABLED = NON_PREF_PREFIX + "healthreport.uploadEnabled";
|
||||||
public static final String PREFS_SYNC = NON_PREF_PREFIX + "sync";
|
public static final String PREFS_SYNC = NON_PREF_PREFIX + "sync";
|
||||||
|
|
||||||
|
@ -60,8 +60,6 @@ public class ToolbarDisplayLayout extends ThemedLinearLayout {
|
|||||||
|
|
||||||
private static final int MIN_DOMAIN_SCROLL_MARGIN_DP = 10;
|
private static final int MIN_DOMAIN_SCROLL_MARGIN_DP = 10;
|
||||||
|
|
||||||
private boolean mTrackingProtectionEnabled;
|
|
||||||
|
|
||||||
// To be used with updateFromTab() to allow the caller
|
// To be used with updateFromTab() to allow the caller
|
||||||
// to give enough context for the requested state change.
|
// to give enough context for the requested state change.
|
||||||
enum UpdateFlags {
|
enum UpdateFlags {
|
||||||
@ -363,7 +361,6 @@ public class ToolbarDisplayLayout extends ThemedLinearLayout {
|
|||||||
final int imageLevel = type.getImageLevel();
|
final int imageLevel = type.getImageLevel();
|
||||||
|
|
||||||
mSiteIdentityPopup.setSiteIdentity(siteIdentity);
|
mSiteIdentityPopup.setSiteIdentity(siteIdentity);
|
||||||
mTrackingProtectionEnabled = SecurityModeUtil.isTrackingProtectionEnabled(siteIdentity);
|
|
||||||
|
|
||||||
if (mSecurityImageLevel != imageLevel) {
|
if (mSecurityImageLevel != imageLevel) {
|
||||||
mSecurityImageLevel = imageLevel;
|
mSecurityImageLevel = imageLevel;
|
||||||
@ -423,10 +420,6 @@ public class ToolbarDisplayLayout extends ThemedLinearLayout {
|
|||||||
final boolean shouldShowThrobber = tab.getState() == Tab.STATE_LOADING;
|
final boolean shouldShowThrobber = tab.getState() == Tab.STATE_LOADING;
|
||||||
|
|
||||||
updateUiMode(shouldShowThrobber ? UIMode.PROGRESS : UIMode.DISPLAY);
|
updateUiMode(shouldShowThrobber ? UIMode.PROGRESS : UIMode.DISPLAY);
|
||||||
|
|
||||||
if (Tab.STATE_SUCCESS == tab.getState() && mTrackingProtectionEnabled) {
|
|
||||||
mActivity.showTrackingProtectionPromptIfApplicable();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateUiMode(UIMode uiMode) {
|
private void updateUiMode(UIMode uiMode) {
|
||||||
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -328,11 +328,6 @@
|
|||||||
<!ENTITY pref_pwa "Progressive Web Apps">
|
<!ENTITY pref_pwa "Progressive Web Apps">
|
||||||
<!ENTITY pref_pwa_summary "Allow web apps to be added to home screen">
|
<!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_message3 "Tab saved in &brandShortName;">
|
||||||
<!ENTITY tab_queue_toast_action "Open now">
|
<!ENTITY tab_queue_toast_action "Open now">
|
||||||
<!ENTITY tab_queue_prompt_title "Opening multiple links?">
|
<!ENTITY tab_queue_prompt_title "Opening multiple links?">
|
||||||
|
@ -290,11 +290,6 @@
|
|||||||
<string name="pref_update_autodownload_disabled">&pref_update_autodownload_never;</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="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_title">&pref_tab_queue_title3;</string>
|
||||||
<string name="pref_tab_queue_summary">&pref_tab_queue_summary4;</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_title">&tab_queue_prompt_title;</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user