Skip to content

Commit

Permalink
Revert "Update UI for unsupported Android OS and make Jelly Bean unsu…
Browse files Browse the repository at this point in the history
…pported."

This reverts commit 601b3e3.

Reason for revert: Breaks Chrome Custom Tabs.

Original change's description:
> Update UI for unsupported Android OS and make Jelly Bean unsupported.
> 
> This CL updates the UI to show a badge icon in the app menu icon
> whenever the user is running Chrome on a currently unsupported Android
> version.  This badge in the app menu is only displayed once, until the
> user taps the app menu icon. If the user does in fact get a new version,
> the badge state is reset, and will be shown again. The current behavior
> for out of date users stays the same as before (once per cold start).
> 
> In addition, a new menu item is displayed at the top of the menu that
> explains that Chrome is unable to update. Nothing happens when you tap
> the menu item in the case of an unsupported OS version.
> 
> The new menu item and the new warning message in About Chrome will
> always be displayed when the user is in this state, regardless of
> whether the app menu has already been tapped (which removes the badge).
> 
> This CL also updates the UI in Settings - About Chrome to show a new
> message and a warning icon when the user is running Chrome on an
> unsupported version of the Android OS.
> 
> By default, Jelly Bean is considered unsupported after this CL, but this
> can be overridden from the variations framework.
> 
> It is possible to use command line flags or chrome://flags for
> testing the different states, though that does not impact the
> About Chrome screen.
> 
> Binary-Size: This CL adds new assets and the minimal code required.
> Bug: 847940
> Change-Id: If128e1692b66c5804928183718000aaf1e2ffaa6
> Reviewed-on: https://chromium-review.googlesource.com/c/1243167
> Commit-Queue: Tommy Nyquist <nyquist@chromium.org>
> Reviewed-by: Theresa <twellington@chromium.org>
> Cr-Original-Commit-Position: refs/heads/master@{#599369}(cherry picked from commit 5423fd8)
> Reviewed-on: https://chromium-review.googlesource.com/c/1279959
> Reviewed-by: Tommy Nyquist <nyquist@chromium.org>
> Cr-Commit-Position: refs/branch-heads/3578@{#15}
> Cr-Branched-From: 4226ddf-refs/heads/master@{#599034}

TBR=nyquist@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 847940
Change-Id: Iec0d8b4c07f123597f4883d1be3f14c3207e7c05
Reviewed-on: https://chromium-review.googlesource.com/c/1286281
Reviewed-by: Tommy Nyquist <nyquist@chromium.org>
Cr-Commit-Position: refs/branch-heads/3578@{#92}
Cr-Branched-From: 4226ddf-refs/heads/master@{#599034}
  • Loading branch information
tommynyquist committed Oct 17, 2018
1 parent 1edc83a commit 7f0a8e3
Show file tree
Hide file tree
Showing 41 changed files with 180 additions and 612 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

6 changes: 2 additions & 4 deletions chrome/android/java/res/layout/toolbar_tablet.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
android:contentDescription="@string/accessibility_toolbar_btn_tabswitcher_toggle_default"
android:visibility="gone" />

<org.chromium.chrome.browser.toolbar.MenuButton
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/menu_button_wrapper" >
Expand All @@ -78,7 +78,6 @@
style="@style/ToolbarMenuButtonTablet"
android:src="@drawable/ic_more_vert_black_24dp"
android:contentDescription="@string/accessibility_toolbar_btn_menu"
android:layout_gravity="center"
app:tint="@color/dark_mode_tint" />

<ImageView
Expand All @@ -87,9 +86,8 @@
android:src="@drawable/badge_update_dark"
tools:ignore="ContentDescription"
android:importantForAccessibility="no"
android:layout_gravity="center"
android:visibility="invisible" />

</org.chromium.chrome.browser.toolbar.MenuButton>
</FrameLayout>
</LinearLayout>
</org.chromium.chrome.browser.toolbar.ToolbarTablet>
3 changes: 3 additions & 0 deletions chrome/android/java/res/values-v17/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@
<item name="android:paddingEnd">8dp</item>
</style>
<style name="PreferenceLayout" parent="PreferenceLayoutBase" />
<style name="DeprecationWarningPreferenceTheme" parent="PreferencesTheme">
<item name="android:textAppearance">@style/BlackBodyDefault</item>
</style>
<style name="PreferenceSpinnerItem">
<item name="android:textAppearance">@style/TextAppearance.PreferenceMediumText</item>
</style>
Expand Down
2 changes: 1 addition & 1 deletion chrome/android/java/res/xml/about_chrome_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Preference
android:key="application_version"
android:title="@string/application_version_title" />
<org.chromium.chrome.browser.preferences.AboutChromePreferenceOSVersion
<Preference
android:key="os_version"
android:title="@string/os_version_title" />
<Preference
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2067,8 +2067,9 @@ public AppMenuPropertiesDelegate getAppMenuPropertiesDelegate() {

/**
* Callback after UpdateMenuItemHelper#checkForUpdateOnBackgroundThread is complete.
* @param updateAvailable Whether an update is available.
*/
public void onCheckForUpdate() {
public void onCheckForUpdate(boolean updateAvailable) {
if (UpdateMenuItemHelper.getInstance().shouldShowToolbarBadge(this)) {
mToolbarManager.showAppMenuUpdateBadge();
mCompositorViewHolder.requestRender();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ public static boolean getFieldTrialParamByFeatureAsBoolean(
public static final String INFLATE_TOOLBAR_ON_BACKGROUND_THREAD = "BackgroundToolbarInflation";
public static final String INTEREST_FEED_CONTENT_SUGGESTIONS = "InterestFeedContentSuggestions";
public static final String LANGUAGES_PREFERENCE = "LanguagesPreference";
public static final String JELLY_BEAN_SUPPORTED = "JellyBeanSupported";
public static final String LONG_PRESS_BACK_FOR_HISTORY = "LongPressBackForHistory";
public static final String SEARCH_ENGINE_PROMO_EXISTING_DEVICE =
"SearchEnginePromo.ExistingDevice";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,26 +68,17 @@ public abstract class ChromeSwitches {
public static final String DISABLE_LOFI_SNACKBAR = "disable-lo-fi-snackbar";

/**
* Forces the update state to be set to the given state if the value is {@link
* org.chromium.chrome.browser.omaha.UpdateMenuItemHelper#NONE_SWITCH_VALUE}, {@link
* org.chromium.chrome.browser.omaha.UpdateMenuItemHelper#UPDATE_AVAILABLE_SWITCH_VALUE},
* {@link
* org.chromium.chrome.browser.omaha.UpdateMenuItemHelper#UNSUPPORTED_OS_VERSION_SWITCH_VALUE}.
* Forces the update menu item to show.
*/
public static final String FORCE_UPDATE_MENU_UPDATE_TYPE = "force-update-menu-type";
public static final String FORCE_SHOW_UPDATE_MENU_ITEM = "force-show-update-menu-item";

/**
* Forces the update menu badge to show. This requires the update type to be valid as well.
*
* @see #FORCE_UPDATE_MENU_UPDATE_TYPE
* Forces the update menu badge to show.
*/
public static final String FORCE_SHOW_UPDATE_MENU_BADGE = "force-show-update-menu-badge";

/**
* Sets the market URL for Chrome for use in testing. This requires setting {@link
* #FORCE_UPDATE_MENU_UPDATE_TYPE} to {@link
* org.chromium.chrome.browser.omaha.UpdateMenuItemHelper#UPDATE_AVAILABLE_SWITCH_VALUE}.
* @see #FORCE_UPDATE_MENU_UPDATE_TYPE
* Sets the market URL for Chrome for use in testing.
*/
public static final String MARKET_URL_FOR_TESTING = "market-url-for-testing";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,5 @@ protected boolean handleBackPressed() {
}

@Override
public void onCheckForUpdate() {}
public void onCheckForUpdate(boolean updateAvailable) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,13 @@ public View getView(int position, View convertView, ViewGroup parent) {
holder = (CustomMenuItemViewHolder) convertView.getTag();
}
setupStandardMenuItemViewHolder(holder, convertView, item);
UpdateMenuItemHelper.getInstance().decorateMenuItemViews(
mInflater.getContext(), holder.text, holder.image, holder.summary);
String summary = UpdateMenuItemHelper.getInstance().getMenuItemSummaryText(
mInflater.getContext());
if (TextUtils.isEmpty(summary)) {
holder.summary.setVisibility(View.GONE);
} else {
holder.summary.setText(summary);
}
break;
}
case MenuItemType.THREE_BUTTON:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1356,7 +1356,8 @@ public CustomTabAppMenuPropertiesDelegate getAppMenuPropertiesDelegate() {
}

@Override
public void onCheckForUpdate() {}
public void onCheckForUpdate(boolean updateAvailable) {
}

/**
* @return The {@link CustomTabIntentDataProvider} for this {@link CustomTabActivity}. For test
Expand Down
Loading

0 comments on commit 7f0a8e3

Please sign in to comment.