Commit e5178bee authored by newt's avatar newt Committed by Commit bot

Remove document mode opt-out promo.

BUG=582539

Review URL: https://codereview.chromium.org/1837963003

Cr-Commit-Position: refs/heads/master@{#383835}
parent e192fbd5
...@@ -56,7 +56,7 @@ Still reading? ...@@ -56,7 +56,7 @@ Still reading?
<ignore path="ui/android/java/res/drawable-xxhdpi"/> <ignore path="ui/android/java/res/drawable-xxhdpi"/>
<ignore path="ui/android/java/res/drawable-xxxhdpi"/> <ignore path="ui/android/java/res/drawable-xxxhdpi"/>
<!-- The large assets below only include a few densities to reduce APK size. --> <!-- The large assets below only include a few densities to reduce APK size. -->
<ignore regexp=".*: data_reduction_illustration.png, google_icon_sprite.png, physical_web_logo.png, physical_web_logo_anim1.png, physical_web_logo_anim2.png, tabs_moved_htc.png, tabs_moved_nexus.png, tabs_moved_samsung.png$"/> <ignore regexp=".*: data_reduction_illustration.png, google_icon_sprite.png, physical_web_logo.png, physical_web_logo_anim1.png, physical_web_logo_anim2.png$"/>
</issue> </issue>
<issue id="IconDipSize"> <issue id="IconDipSize">
<ignore regexp=".*google_icon_sprite.png.*"/> <ignore regexp=".*google_icon_sprite.png.*"/>
......
...@@ -95,14 +95,6 @@ ...@@ -95,14 +95,6 @@
android:layout_weight="0" android:layout_weight="0"
android:visibility="invisible" /> android:visibility="invisible" />
<!-- Document mode opt out promo -->
<ViewStub
android:id="@+id/opt_out_promo_stub"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inflatedId="@+id/opt_out_promo"
android:layout="@layout/opt_out_promo" />
<!-- Most visited items --> <!-- Most visited items -->
<org.chromium.chrome.browser.ntp.MostVisitedLayout <org.chromium.chrome.browser.ntp.MostVisitedLayout
android:id="@+id/most_visited_layout" android:id="@+id/most_visited_layout"
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2015 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/opt_out_promo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:id="@+id/tabs_moved_illustration"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:adjustViewBounds="true"
android:background="#4FC3F7"
android:contentDescription="@null" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:layout_marginTop="24dp"
android:layout_marginStart="32dp"
android:layout_marginEnd="32dp"
android:text="@string/tabs_and_apps_opt_out_title"
android:textColor="@color/default_text_color" />
<org.chromium.ui.widget.TextViewWithClickableSpans
android:id="@+id/opt_out_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginStart="32dp"
android:layout_marginEnd="32dp"
android:bufferType="spannable"
android:textSize="14sp"
android:textColor="@color/opt_out_text_color"
android:lineSpacingMultiplier="1.4" />
<Button
style="@style/ButtonCompatBorderless"
android:id="@+id/got_it_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginTop="24dp"
android:layout_marginBottom="16dp"
android:layout_marginEnd="32dp"
android:text="@string/tabs_and_apps_got_it_button"
android:textColor="@color/light_active_color" />
</LinearLayout>
...@@ -162,9 +162,6 @@ ...@@ -162,9 +162,6 @@
<!-- Bookmark widget colors --> <!-- Bookmark widget colors -->
<color name="bookmark_widget_pressed_highlight">#1D000000</color> <color name="bookmark_widget_pressed_highlight">#1D000000</color>
<!-- Opt out promo -->
<color name="opt_out_text_color">#646464</color>
<!-- Media UI Colors --> <!-- Media UI Colors -->
<color name="media_session_icon_color">#14181C</color> <color name="media_session_icon_color">#14181C</color>
......
...@@ -36,9 +36,4 @@ public class DocumentMetricIds { ...@@ -36,9 +36,4 @@ public class DocumentMetricIds {
public static final int STARTED_BY_EXTERNAL_APP_WHATSAPP = 410; public static final int STARTED_BY_EXTERNAL_APP_WHATSAPP = 410;
public static final int STARTED_BY_EXTERNAL_APP_GSA = 411; public static final int STARTED_BY_EXTERNAL_APP_GSA = 411;
public static final int STARTED_BY_CONTEXTUAL_SEARCH = 500; public static final int STARTED_BY_CONTEXTUAL_SEARCH = 500;
// DocumentActivity.OptOutDecision (enumerated)
public static final int OPT_OUT_CLICK_GOT_IT = 0;
public static final int OPT_OUT_CLICK_SETTINGS = 1;
public static final int OPT_OUT_CLICK_COUNT = 2;
} }
...@@ -34,7 +34,6 @@ import org.chromium.chrome.browser.NativePage; ...@@ -34,7 +34,6 @@ import org.chromium.chrome.browser.NativePage;
import org.chromium.chrome.browser.UrlConstants; import org.chromium.chrome.browser.UrlConstants;
import org.chromium.chrome.browser.bookmarks.BookmarkUtils; import org.chromium.chrome.browser.bookmarks.BookmarkUtils;
import org.chromium.chrome.browser.compositor.layouts.content.InvalidationAwareThumbnailProvider; import org.chromium.chrome.browser.compositor.layouts.content.InvalidationAwareThumbnailProvider;
import org.chromium.chrome.browser.document.DocumentMetricIds;
import org.chromium.chrome.browser.document.DocumentUtils; import org.chromium.chrome.browser.document.DocumentUtils;
import org.chromium.chrome.browser.favicon.FaviconHelper; import org.chromium.chrome.browser.favicon.FaviconHelper;
import org.chromium.chrome.browser.favicon.FaviconHelper.FaviconImageCallback; import org.chromium.chrome.browser.favicon.FaviconHelper.FaviconImageCallback;
...@@ -49,10 +48,7 @@ import org.chromium.chrome.browser.ntp.interests.InterestsPage; ...@@ -49,10 +48,7 @@ import org.chromium.chrome.browser.ntp.interests.InterestsPage;
import org.chromium.chrome.browser.ntp.interests.InterestsPage.InterestsClickListener; import org.chromium.chrome.browser.ntp.interests.InterestsPage.InterestsClickListener;
import org.chromium.chrome.browser.ntp.snippets.SnippetsManager; import org.chromium.chrome.browser.ntp.snippets.SnippetsManager;
import org.chromium.chrome.browser.offlinepages.OfflinePageBridge; import org.chromium.chrome.browser.offlinepages.OfflinePageBridge;
import org.chromium.chrome.browser.preferences.DocumentModeManager;
import org.chromium.chrome.browser.preferences.DocumentModePreference;
import org.chromium.chrome.browser.preferences.PrefServiceBridge; import org.chromium.chrome.browser.preferences.PrefServiceBridge;
import org.chromium.chrome.browser.preferences.PreferencesLauncher;
import org.chromium.chrome.browser.profiles.MostVisitedSites; import org.chromium.chrome.browser.profiles.MostVisitedSites;
import org.chromium.chrome.browser.profiles.MostVisitedSites.MostVisitedURLsObserver; import org.chromium.chrome.browser.profiles.MostVisitedSites.MostVisitedURLsObserver;
import org.chromium.chrome.browser.profiles.MostVisitedSites.ThumbnailCallback; import org.chromium.chrome.browser.profiles.MostVisitedSites.ThumbnailCallback;
...@@ -89,9 +85,6 @@ import jp.tomorrowkey.android.gifplayer.BaseGifImage; ...@@ -89,9 +85,6 @@ import jp.tomorrowkey.android.gifplayer.BaseGifImage;
public class NewTabPage public class NewTabPage
implements NativePage, InvalidationAwareThumbnailProvider, TemplateUrlServiceObserver { implements NativePage, InvalidationAwareThumbnailProvider, TemplateUrlServiceObserver {
// The number of times that the document-mode opt-out promo will be shown.
private static final int MAX_OPT_OUT_PROMO_COUNT = 10;
// MostVisitedItem Context menu item IDs. // MostVisitedItem Context menu item IDs.
static final int ID_OPEN_IN_NEW_TAB = 0; static final int ID_OPEN_IN_NEW_TAB = 0;
static final int ID_OPEN_IN_INCOGNITO_TAB = 1; static final int ID_OPEN_IN_INCOGNITO_TAB = 1;
...@@ -116,7 +109,6 @@ public class NewTabPage ...@@ -116,7 +109,6 @@ public class NewTabPage
private LargeIconBridge mLargeIconBridge; private LargeIconBridge mLargeIconBridge;
private LogoBridge mLogoBridge; private LogoBridge mLogoBridge;
private boolean mSearchProviderHasLogo; private boolean mSearchProviderHasLogo;
private final boolean mOptOutPromoShown;
private String mOnLogoClickUrl; private String mOnLogoClickUrl;
private String mAnimatedLogoUrl; private String mAnimatedLogoUrl;
private FakeboxDelegate mFakeboxDelegate; private FakeboxDelegate mFakeboxDelegate;
...@@ -259,41 +251,6 @@ public class NewTabPage ...@@ -259,41 +251,6 @@ public class NewTabPage
mMostVisitedSites.recordOpenedMostVisitedItem(item.getIndex(), item.getTileType()); mMostVisitedSites.recordOpenedMostVisitedItem(item.getIndex(), item.getTileType());
} }
private void recordDocumentOptOutPromoClick(int which) {
RecordHistogram.recordEnumeratedHistogram("DocumentActivity.OptOutClick", which,
DocumentMetricIds.OPT_OUT_CLICK_COUNT);
}
@Override
public boolean shouldShowOptOutPromo() {
if (!FeatureUtilities.isDocumentMode(mActivity)) return false;
DocumentModeManager documentModeManager = DocumentModeManager.getInstance(mActivity);
return !documentModeManager.isOptOutPromoDismissed()
&& (documentModeManager.getOptOutShownCount() < MAX_OPT_OUT_PROMO_COUNT);
}
@Override
public void optOutPromoShown() {
assert FeatureUtilities.isDocumentMode(mActivity);
DocumentModeManager.getInstance(mActivity).incrementOptOutShownCount();
RecordUserAction.record("DocumentActivity_OptOutShownOnHome");
}
@Override
public void optOutPromoClicked(boolean settingsClicked) {
assert FeatureUtilities.isDocumentMode(mActivity);
if (settingsClicked) {
recordDocumentOptOutPromoClick(DocumentMetricIds.OPT_OUT_CLICK_SETTINGS);
PreferencesLauncher.launchSettingsPage(mActivity,
DocumentModePreference.class.getName());
} else {
recordDocumentOptOutPromoClick(DocumentMetricIds.OPT_OUT_CLICK_GOT_IT);
DocumentModeManager documentModeManager = DocumentModeManager.getInstance(
mActivity);
documentModeManager.setOptedOutState(DocumentModeManager.OPT_OUT_PROMO_DISMISSED);
}
}
@Override @Override
public void open(MostVisitedItem item) { public void open(MostVisitedItem item) {
if (mIsDestroyed) return; if (mIsDestroyed) return;
...@@ -573,11 +530,6 @@ public class NewTabPage ...@@ -573,11 +530,6 @@ public class NewTabPage
activity.getResources(), R.color.default_primary_color); activity.getResources(), R.color.default_primary_color);
TemplateUrlService.getInstance().addObserver(this); TemplateUrlService.getInstance().addObserver(this);
// Whether to show the promo can change within the lifetime of a single NTP instance
// because the user can dismiss the promo. To ensure the UI is consistent, cache the
// value initially and ignore further updates.
mOptOutPromoShown = mNewTabPageManager.shouldShowOptOutPromo();
mTabObserver = new EmptyTabObserver() { mTabObserver = new EmptyTabObserver() {
@Override @Override
public void onShown(Tab tab) { public void onShown(Tab tab) {
...@@ -654,7 +606,6 @@ public class NewTabPage ...@@ -654,7 +606,6 @@ public class NewTabPage
private boolean isInSingleUrlBarMode(Context context) { private boolean isInSingleUrlBarMode(Context context) {
if (DeviceFormFactor.isTablet(context)) return false; if (DeviceFormFactor.isTablet(context)) return false;
if (mOptOutPromoShown) return false;
return mSearchProviderHasLogo; return mSearchProviderHasLogo;
} }
...@@ -664,8 +615,7 @@ public class NewTabPage ...@@ -664,8 +615,7 @@ public class NewTabPage
mSearchProviderHasLogo = false; mSearchProviderHasLogo = false;
if (mNewTabPageView != null) mNewTabPageView.setSearchProviderHasLogo(false); if (mNewTabPageView != null) mNewTabPageView.setSearchProviderHasLogo(false);
} else { } else {
mSearchProviderHasLogo = !mOptOutPromoShown mSearchProviderHasLogo = TemplateUrlService.getInstance().isDefaultSearchEngineGoogle();
&& TemplateUrlService.getInstance().isDefaultSearchEngineGoogle();
} }
} }
......
...@@ -87,7 +87,6 @@ public class NewTabPageLayout extends BoundedLinearLayout { ...@@ -87,7 +87,6 @@ public class NewTabPageLayout extends BoundedLinearLayout {
} }
if (child.getId() == R.id.most_visited_layout) break; if (child.getId() == R.id.most_visited_layout) break;
if (child.getId() == R.id.opt_out_promo) break;
if (child.getVisibility() != View.GONE) { if (child.getVisibility() != View.GONE) {
minScrollAmountRequired += child.getMeasuredHeight(); minScrollAmountRequired += child.getMeasuredHeight();
......
...@@ -14,7 +14,6 @@ import android.graphics.Color; ...@@ -14,7 +14,6 @@ import android.graphics.Color;
import android.graphics.Rect; import android.graphics.Rect;
import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.BitmapDrawable;
import android.net.Uri; import android.net.Uri;
import android.os.Build;
import android.support.v4.graphics.drawable.RoundedBitmapDrawable; import android.support.v4.graphics.drawable.RoundedBitmapDrawable;
import android.support.v4.graphics.drawable.RoundedBitmapDrawableFactory; import android.support.v4.graphics.drawable.RoundedBitmapDrawableFactory;
import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.LinearLayoutManager;
...@@ -22,7 +21,6 @@ import android.support.v7.widget.RecyclerView; ...@@ -22,7 +21,6 @@ import android.support.v7.widget.RecyclerView;
import android.text.Editable; import android.text.Editable;
import android.text.TextUtils; import android.text.TextUtils;
import android.text.TextWatcher; import android.text.TextWatcher;
import android.text.method.LinkMovementMethod;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.MotionEvent; import android.view.MotionEvent;
...@@ -30,7 +28,6 @@ import android.view.View; ...@@ -30,7 +28,6 @@ import android.view.View;
import android.view.View.OnLayoutChangeListener; import android.view.View.OnLayoutChangeListener;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.ViewStub; import android.view.ViewStub;
import android.widget.Button;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
...@@ -49,16 +46,10 @@ import org.chromium.chrome.browser.ntp.LogoBridge.LogoObserver; ...@@ -49,16 +46,10 @@ import org.chromium.chrome.browser.ntp.LogoBridge.LogoObserver;
import org.chromium.chrome.browser.ntp.MostVisitedItem.MostVisitedItemManager; import org.chromium.chrome.browser.ntp.MostVisitedItem.MostVisitedItemManager;
import org.chromium.chrome.browser.ntp.NewTabPage.OnSearchBoxScrollListener; import org.chromium.chrome.browser.ntp.NewTabPage.OnSearchBoxScrollListener;
import org.chromium.chrome.browser.ntp.snippets.SnippetsManager; import org.chromium.chrome.browser.ntp.snippets.SnippetsManager;
import org.chromium.chrome.browser.preferences.DocumentModeManager;
import org.chromium.chrome.browser.profiles.MostVisitedSites.MostVisitedURLsObserver; import org.chromium.chrome.browser.profiles.MostVisitedSites.MostVisitedURLsObserver;
import org.chromium.chrome.browser.profiles.MostVisitedSites.ThumbnailCallback; import org.chromium.chrome.browser.profiles.MostVisitedSites.ThumbnailCallback;
import org.chromium.chrome.browser.util.ViewUtils; import org.chromium.chrome.browser.util.ViewUtils;
import org.chromium.chrome.browser.widget.RoundedIconGenerator; import org.chromium.chrome.browser.widget.RoundedIconGenerator;
import org.chromium.ui.text.NoUnderlineClickableSpan;
import org.chromium.ui.text.SpanApplier;
import org.chromium.ui.text.SpanApplier.SpanInfo;
import java.util.Locale;
import jp.tomorrowkey.android.gifplayer.BaseGifImage; import jp.tomorrowkey.android.gifplayer.BaseGifImage;
...@@ -81,7 +72,6 @@ public class NewTabPageView extends FrameLayout ...@@ -81,7 +72,6 @@ public class NewTabPageView extends FrameLayout
private ImageView mVoiceSearchButton; private ImageView mVoiceSearchButton;
private MostVisitedLayout mMostVisitedLayout; private MostVisitedLayout mMostVisitedLayout;
private View mMostVisitedPlaceholder; private View mMostVisitedPlaceholder;
private View mOptOutView;
private View mNoSearchLogoSpacer; private View mNoSearchLogoSpacer;
private RecyclerView mSnippetsView; private RecyclerView mSnippetsView;
...@@ -126,15 +116,6 @@ public class NewTabPageView extends FrameLayout ...@@ -126,15 +116,6 @@ public class NewTabPageView extends FrameLayout
/** @return Whether the toolbar at the bottom of the NTP is enabled and should be shown. */ /** @return Whether the toolbar at the bottom of the NTP is enabled and should be shown. */
boolean isToolbarEnabled(); boolean isToolbarEnabled();
/** @return Whether the document mode opt out promo should be shown. */
boolean shouldShowOptOutPromo();
/** Called when the document mode opt out promo is shown. */
void optOutPromoShown();
/** Called when the user clicks "settings" or "ok, got it" on the opt out promo. */
void optOutPromoClicked(boolean settingsClicked);
/** Opens the bookmarks page in the current tab. */ /** Opens the bookmarks page in the current tab. */
void navigateToBookmarks(); void navigateToBookmarks();
...@@ -350,8 +331,6 @@ public class NewTabPageView extends FrameLayout ...@@ -350,8 +331,6 @@ public class NewTabPageView extends FrameLayout
mManager.setMostVisitedURLsObserver(this, mManager.setMostVisitedURLsObserver(this,
mMostVisitedDesign.getNumberOfTiles(searchProviderHasLogo)); mMostVisitedDesign.getNumberOfTiles(searchProviderHasLogo));
if (mManager.shouldShowOptOutPromo()) showOptOutPromo();
// Set up snippets // Set up snippets
if (ChromeFeatureList.isEnabled(ChromeFeatureList.NTP_SNIPPETS)) { if (ChromeFeatureList.isEnabled(ChromeFeatureList.NTP_SNIPPETS)) {
mSnippetsView = (RecyclerView) findViewById(R.id.snippets_card_list); mSnippetsView = (RecyclerView) findViewById(R.id.snippets_card_list);
...@@ -377,60 +356,6 @@ public class NewTabPageView extends FrameLayout ...@@ -377,60 +356,6 @@ public class NewTabPageView extends FrameLayout
} }
} }
private int getTabsMovedIllustration() {
switch (Build.MANUFACTURER.toLowerCase(Locale.US)) {
case "samsung":
if (DocumentModeManager.isDeviceTabbedModeByDefault()) return 0;
return R.drawable.tabs_moved_samsung;
case "htc":
return R.drawable.tabs_moved_htc;
default:
return R.drawable.tabs_moved_nexus;
}
}
private void showOptOutPromo() {
ViewStub optOutPromoStub = (ViewStub) findViewById(R.id.opt_out_promo_stub);
mOptOutView = optOutPromoStub.inflate();
// Fill in opt-out text with Settings link
TextView optOutText = (TextView) mOptOutView.findViewById(R.id.opt_out_text);
NoUnderlineClickableSpan settingsLink = new NoUnderlineClickableSpan() {
@Override
public void onClick(View view) {
mManager.optOutPromoClicked(true);
}
};
optOutText.setText(SpanApplier.applySpans(
getContext().getString(R.string.tabs_and_apps_opt_out_text),
new SpanInfo("<link>", "</link>", settingsLink)));
optOutText.setMovementMethod(LinkMovementMethod.getInstance());
ImageView illustration = (ImageView) mOptOutView.findViewById(R.id.tabs_moved_illustration);
int resourceId = getTabsMovedIllustration();
if (resourceId != 0) {
illustration.setImageResource(getTabsMovedIllustration());
} else {
illustration.setImageDrawable(null);
}
mOptOutView.setVisibility(View.VISIBLE);
mMostVisitedLayout.setVisibility(View.GONE);
Button gotItButton = (Button) mOptOutView.findViewById(R.id.got_it_button);
gotItButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mOptOutView.setVisibility(View.GONE);
mMostVisitedLayout.setVisibility(View.VISIBLE);
mManager.optOutPromoClicked(false);
updateMostVisitedPlaceholderVisibility();
}
});
mManager.optOutPromoShown();
}
private void updateSearchBoxOnScroll() { private void updateSearchBoxOnScroll() {
if (mDisableUrlFocusChangeAnimations) return; if (mDisableUrlFocusChangeAnimations) return;
...@@ -864,7 +789,6 @@ public class NewTabPageView extends FrameLayout ...@@ -864,7 +789,6 @@ public class NewTabPageView extends FrameLayout
*/ */
private void updateMostVisitedPlaceholderVisibility() { private void updateMostVisitedPlaceholderVisibility() {
boolean showPlaceholder = mHasReceivedMostVisitedSites boolean showPlaceholder = mHasReceivedMostVisitedSites
&& !mManager.shouldShowOptOutPromo()
&& mMostVisitedLayout.getChildCount() == 0 && mMostVisitedLayout.getChildCount() == 0
&& !mSearchProviderHasLogo; && !mSearchProviderHasLogo;
......
...@@ -6,14 +6,11 @@ package org.chromium.chrome.browser.preferences; ...@@ -6,14 +6,11 @@ package org.chromium.chrome.browser.preferences;
import android.content.Context; import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.os.Build;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import org.chromium.base.ThreadUtils; import org.chromium.base.ThreadUtils;
import org.chromium.base.VisibleForTesting; import org.chromium.base.VisibleForTesting;
import java.util.Locale;
/** /**
* Tracks opt out status for document mode * Tracks opt out status for document mode
*/ */
...@@ -27,141 +24,6 @@ public class DocumentModeManager { ...@@ -27,141 +24,6 @@ public class DocumentModeManager {
public static final String OPT_OUT_SHOWN_COUNT = "opt_out_shown_count"; public static final String OPT_OUT_SHOWN_COUNT = "opt_out_shown_count";
public static final String OPT_OUT_CLEAN_UP_PENDING = "opt_out_clean_up_pending"; public static final String OPT_OUT_CLEAN_UP_PENDING = "opt_out_clean_up_pending";
// Taken from https://support.google.com/googleplay/answer/1727131?hl=en-GB
private static final String[] DEFAULT_TABBED_MODE_DEVICES = {
"GT-I9505G", // Galaxy S4 Google Play Edition
"SC-04E", // Galaxy S4
"GT-I9500", // Galaxy S4
"SCH-I959", // Galaxy S4
"SHV-E300K", // Galaxy S4
"SHV-E300L", // Galaxy S4
"SHV-E300S", // Galaxy S4
"GT-I9505", // Galaxy S4
"GT-I9508", // Galaxy S4
"GT-I9508C", // Galaxy S4
"GT-I9508V", // Galaxy S4
"SAMSUNG-SGH-I337Z", // Galaxy S4
"SAMSUNG-SGH-I337", // Galaxy S4
"SGH-I337M", // Galaxy S4
"SGH-M919V", // Galaxy S4
"SGH-M919N", // Galaxy S4
"SCH-R970C", // Galaxy S4
"SCH-R970X", // Galaxy S4
"SCH-I545L", // Galaxy S4
"SCH-I545PP", // Galaxy S4
"SPH-L720T", // Galaxy S4
"SPH-L720", // Galaxy S4
"SM-S975L", // Galaxy S4
"SGH-S970G", // Galaxy S4
"SGH-M919", // Galaxy S4
"SCH-R970", // Galaxy S4
"SCH-I545", // Galaxy S4
"GT-I9507", // Galaxy S4
"GT-I9507V", // Galaxy S4
"GT-I9515", // Galaxy S4
"GT-I9515L", // Galaxy S4
"GT-I9505X", // Galaxy S4
"GT-I9506", // Galaxy S4
"SHV-E330K", // Galaxy S4
"SHV-E330L", // Galaxy S4
"GT-I9295", // Galaxy S4 Active
"SAMSUNG-SGH-I537", // Galaxy S4 Active
"SGH-I537", // Galaxy S4 Active
"SHV-E470S", // Galaxy S4 Active
"GT-I9502", // Galaxy S4 Duos
"SHV-E330S", // Galaxy S4 LTE-A
"GT-I9190", // Galaxy S4 Mini
"GT-I9192", // Galaxy S4 Mini
"GT-I9195", // Galaxy S4 Mini
"GT-I9195L", // Galaxy S4 Mini
"GT-I9195T", // Galaxy S4 Mini
"GT-I9195X", // Galaxy S4 Mini
"GT-I9197", // Galaxy S4 Mini
"SGH-I257M", // Galaxy S4 Mini
"SHV-E370K", // Galaxy S4 Mini
"SHV-E370D", // Galaxy S4 Mini
"SCH-I435L", // Galaxy S4 Mini
"SPH-L520", // Galaxy S4 Mini
"SCH-R890", // Galaxy S4 Mini
"SCH-I435", // Galaxy S4 Mini
"GT-I9192I", // Galaxy S4 Mini
"GT-I9195I", // Galaxy S4 Mini
"SAMSUNG-SGH-I257", // Galaxy S4 Mini
"SM-C101", // Galaxy S4 Zoom
"SAMSUNG-SM-C105A", // Galaxy S4 Zoom
"SM-C105L", // Galaxy S4 Zoom
"SM-C105S", // Galaxy S4 Zoom
"SM-C105K", // Galaxy S4 Zoom
"SM-C105", // Galaxy S4 Zoom
"SC-02E", // Galaxy Note2
"GT-N7100", // Galaxy Note2
"GT-N7100T", // Galaxy Note2
"GT-N7102", // Galaxy Note2
"GT-N7108", // Galaxy Note2
"SCH-N719", // Galaxy Note2
"GT-N7102", // Galaxy Note2
"GT-N7102I", // Galaxy Note2
"GT-N7105", // Galaxy Note2
"GT-N7105T", // Galaxy Note2
"SAMSUNG-SGH-I317", // Galaxy Note2
"SGH-I317M", // Galaxy Note2
"SGH-T889V", // Galaxy Note2
"GT-N7108D", // Galaxy Note2
"SC-02E", // Galaxy Note2
"SHV-E250K", // Galaxy Note2
"SHV-E250L", // Galaxy Note2
"SHV-E250S", // Galaxy Note2
"SPH-L900", // Galaxy Note2
"SGH-T889", // Galaxy Note2
"SCH-R950", // Galaxy Note2
"SCH-I605", // Galaxy Note2
"SAMSUNG-SGH-I317", // Galaxy Note2
"SC-02F", // Galaxy Note3
"SCL22", // Galaxy Note3
"SM-N900", // Galaxy Note3
"SM-N9000Q", // Galaxy Note3
"SM-N9005", // Galaxy Note3
"SM-N9006", // Galaxy Note3
"SM-N9007", // Galaxy Note3
"SM-N9008V", // Galaxy Note3
"SM-N9009", // Galaxy Note3
"SM-N900U", // Galaxy Note3
"SAMSUNG-SM-N900A", // Galaxy Note3
"SM-N900W8", // Galaxy Note3
"SM-N900K", // Galaxy Note3
"SM-N900L", // Galaxy Note3
"SM-N900S", // Galaxy Note3
"SM-N900P", // Galaxy Note3
"SM-N900T", // Galaxy Note3
"SM-N900R4", // Galaxy Note3
"SM-N900V", // Galaxy Note3
"SM-N9007", // Galaxy Note3
"SM-N9002", // Galaxy Note3 Duos
"SM-N9008", // Galaxy Note3 Duos
"SM-N750K", // Galaxy Note3 Neo
"SM-N750L", // Galaxy Note3 Neo
"SM-N750S", // Galaxy Note3 Neo
"SM-N750", // Galaxy Note3 Neo
"SM-N7500Q", // Galaxy Note3 Neo
"SM-N7502", // Galaxy Note3 Neo
"SM-N7505", // Galaxy Note3 Neo
"SM-N7505L", // Galaxy Note3 Neo
"SM-N7507", // Galaxy Note3 Neo
"HTC ONE DUAL SIM", // HTC ONE
"HTC 801E", // HTC One
"HTC ONE", // HTC One
"HTC ONE 801E", // HTC One
"HTC_PN071", // HTC One
"HTC 802T", // HTC One
"HTC 802T 16GB", // HTC One
"HTC 802W", // HTC One
"HTC 802D", // HTC One
"HTC ONE DUAL 802D", // HTC One
"HTCONE", // HTC One
"HTC ONE 801E", // HTC One 801e
"HTC ONE 801S", // HTC One 801e
};
private static DocumentModeManager sManager; private static DocumentModeManager sManager;
private final SharedPreferences mSharedPreferences; private final SharedPreferences mSharedPreferences;
...@@ -190,13 +52,6 @@ public class DocumentModeManager { ...@@ -190,13 +52,6 @@ public class DocumentModeManager {
return getOptOutState() == OPTED_OUT_OF_DOCUMENT_MODE; return getOptOutState() == OPTED_OUT_OF_DOCUMENT_MODE;
} }
/**
* @return Whether the user dismissed the opt out promo.
*/
public boolean isOptOutPromoDismissed() {
return getOptOutState() == OPT_OUT_PROMO_DISMISSED;
}
/** /**
* Sets the opt out preference. * Sets the opt out preference.
* @param state One of OPTED_OUT_OF_DOCUMENT_MODE or OPT_OUT_PROMO_DISMISSED. * @param state One of OPTED_OUT_OF_DOCUMENT_MODE or OPT_OUT_PROMO_DISMISSED.
...@@ -207,23 +62,6 @@ public class DocumentModeManager { ...@@ -207,23 +62,6 @@ public class DocumentModeManager {
sharedPreferencesEditor.apply(); sharedPreferencesEditor.apply();
} }
/**
* Increments a preference that keeps track of how many times the opt out message has been
* shown on home screen.
*/
public void incrementOptOutShownCount() {
SharedPreferences.Editor sharedPreferencesEditor = mSharedPreferences.edit();
sharedPreferencesEditor.putLong(OPT_OUT_SHOWN_COUNT, getOptOutShownCount() + 1);
sharedPreferencesEditor.apply();
}
/**
* @return The number of times the opt out message has been shown so far.
*/
public long getOptOutShownCount() {
return mSharedPreferences.getLong(OPT_OUT_SHOWN_COUNT, 0);
}
/** /**
* @return Whether we need to clean up old document activity tasks from Recents. * @return Whether we need to clean up old document activity tasks from Recents.
*/ */
...@@ -242,19 +80,6 @@ public class DocumentModeManager { ...@@ -242,19 +80,6 @@ public class DocumentModeManager {
sharedPreferencesEditor.apply(); sharedPreferencesEditor.apply();
} }
/**
* @return Whether Chrome should default to Tabbed mode despite Document mode being supported
* at the platform level. A device will default to Tabbed mode if accessing the
* platform Overview screen is deemed too difficult to make Document mode user friendly.
*/
public static boolean isDeviceTabbedModeByDefault() {
String model = Build.MODEL.toUpperCase(Locale.US);
for (String device : DEFAULT_TABBED_MODE_DEVICES) {
if (model.equals(device)) return true;
}
return false;
}
private int getOptOutState() { private int getOptOutState() {
int optOutState = mSharedPreferences.getInt(OPT_OUT_STATE, OPT_OUT_STATE_UNSET); int optOutState = mSharedPreferences.getInt(OPT_OUT_STATE, OPT_OUT_STATE_UNSET);
if (optOutState == OPT_OUT_STATE_UNSET) { if (optOutState == OPT_OUT_STATE_UNSET) {
......
...@@ -1587,15 +1587,6 @@ You are signing in with a managed account and giving its administrator control o ...@@ -1587,15 +1587,6 @@ You are signing in with a managed account and giving its administrator control o
<message name="IDS_TABS_AND_APPS_TITLE" desc="The title of a preference which controls whether your tabs are shown within Chrome or in system app switcher."> <message name="IDS_TABS_AND_APPS_TITLE" desc="The title of a preference which controls whether your tabs are shown within Chrome or in system app switcher.">
Merge tabs and apps Merge tabs and apps
</message> </message>
<message name="IDS_TABS_AND_APPS_OPT_OUT_TITLE" desc="A title for the promo message shown to users who have document mode enabled to explain the new location for the tabs and provide an option to opt out.">
Chrome tabs have moved
</message>
<message name="IDS_TABS_AND_APPS_OPT_OUT_TEXT" desc="A promo message shown to users who have document mode enabled to explain the new location for the tabs and provide an option to opt out">
See your tabs with other recent apps on your phone’s Overview screen. You can control this in <ph name="BEGIN_LINK">&lt;link&gt;</ph>Settings<ph name="END_LINK">&lt;/link&gt;</ph>.
</message>
<message name="IDS_TABS_AND_APPS_GOT_IT_BUTTON" desc="A button to confirm and dismiss opt out promo">
Ok, got it
</message>
<message name="IDS_TABS_AND_APPS_SETTINGS_DESCRIPTION" desc="A message shown on settings screen from which you can enable/disable the feature that combines Chrome tabs with recent applications and shows them together in the system app switcher."> <message name="IDS_TABS_AND_APPS_SETTINGS_DESCRIPTION" desc="A message shown on settings screen from which you can enable/disable the feature that combines Chrome tabs with recent applications and shows them together in the system app switcher.">
See your tabs with other recent apps on your phone’s Overview screen. See your tabs with other recent apps on your phone’s Overview screen.
</message> </message>
......
...@@ -2905,16 +2905,19 @@ should be able to be added at any place in this file. ...@@ -2905,16 +2905,19 @@ should be able to be added at any place in this file.
<action name="DocumentActivity_OptOutShownOnHome"> <action name="DocumentActivity_OptOutShownOnHome">
<owner>mariakhomenko@chromium.org</owner> <owner>mariakhomenko@chromium.org</owner>
<description>User was presented with the opt out promo.</description> <description>User was presented with the opt out promo.</description>
<obsolete>Removed in M51.</obsolete>
</action> </action>
<action name="DocumentActivity_UserOptIn"> <action name="DocumentActivity_UserOptIn">
<owner>mariakhomenko@chromium.org</owner> <owner>mariakhomenko@chromium.org</owner>
<description>User opted in to document mode through settings.</description> <description>User opted in to document mode through settings.</description>
<obsolete>Removed in M51.</obsolete>
</action> </action>
<action name="DocumentActivity_UserOptOut"> <action name="DocumentActivity_UserOptOut">
<owner>mariakhomenko@chromium.org</owner> <owner>mariakhomenko@chromium.org</owner>
<description>User opted out of document mode through settings.</description> <description>User opted out of document mode through settings.</description>
<obsolete>Removed in M51.</obsolete>
</action> </action>
<action name="DomDistiller_DistilledPageOpened"> <action name="DomDistiller_DistilledPageOpened">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment