Commit 47b74209 authored by Pavel Yatsuk's avatar Pavel Yatsuk Committed by Commit Bot

[GID] Add "User" settings category, workaround profile image size issue

In this change:
- Added "User" category to Sync and Services preference. The category is
  gated by identity-disc flag.
  Mocks: http://slides/1dckRy0Dm5-fOQebZvZyL6CBm2DWCKYppkuOinEORDR4#slide=id.g5615bd983f_0_157
  Screenshot: http://screen/d0uaYAhJ016

- Implemented workaround for crbug.com/963077. The effect of the bug is
  following:
  - Visiting settings causes download of larger profile image.
  - Toolbar's ProfileDataCache receives notification and caches this
    larger image.
  - When user returns to NTP, larger profile image is displayed in
    identity disc.
  The workaround is to remember image size that was requested for Identity disc
  and only update toolbar when image with correct size is received.


BUG=958982
R=twellington@chromium.org

Change-Id: I564f51958bfd473cba30a44baa94f58af1e420d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1612856
Commit-Queue: Pavel Yatsuk <pavely@chromium.org>
Reviewed-by: default avatarTheresa <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664351}
parent 174f0d08
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
chrome/browser/unified_consent/unified_consent_service_factory.cc has to be chrome/browser/unified_consent/unified_consent_service_factory.cc has to be
updated accordingly. --> updated accordingly. -->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory
android:key="user_category"
android:title="@string/user"/>
<org.chromium.chrome.browser.preferences.SignInPreference <org.chromium.chrome.browser.preferences.SignInPreference
android:key="sign_in" android:key="sign_in"
android:title="@string/sign_in_to_chrome"/> android:title="@string/sign_in_to_chrome"/>
......
...@@ -36,6 +36,7 @@ import org.chromium.base.VisibleForTesting; ...@@ -36,6 +36,7 @@ import org.chromium.base.VisibleForTesting;
import org.chromium.base.metrics.RecordUserAction; import org.chromium.base.metrics.RecordUserAction;
import org.chromium.base.task.PostTask; import org.chromium.base.task.PostTask;
import org.chromium.chrome.R; import org.chromium.chrome.R;
import org.chromium.chrome.browser.ChromeFeatureList;
import org.chromium.chrome.browser.contextualsearch.ContextualSearchFieldTrial; import org.chromium.chrome.browser.contextualsearch.ContextualSearchFieldTrial;
import org.chromium.chrome.browser.help.HelpAndFeedback; import org.chromium.chrome.browser.help.HelpAndFeedback;
import org.chromium.chrome.browser.invalidation.InvalidationController; import org.chromium.chrome.browser.invalidation.InvalidationController;
...@@ -72,6 +73,7 @@ public class SyncAndServicesPreferences extends PreferenceFragment ...@@ -72,6 +73,7 @@ public class SyncAndServicesPreferences extends PreferenceFragment
public static final String FRAGMENT_ENTER_PASSPHRASE = "enter_password"; public static final String FRAGMENT_ENTER_PASSPHRASE = "enter_password";
private static final String FRAGMENT_CANCEL_SYNC = "cancel_sync_dialog"; private static final String FRAGMENT_CANCEL_SYNC = "cancel_sync_dialog";
private static final String PREF_USER_CATEGORY = "user_category";
private static final String PREF_SIGNIN = "sign_in"; private static final String PREF_SIGNIN = "sign_in";
private static final String PREF_MANAGE_YOUR_GOOGLE_ACCOUNT = "manage_your_google_account"; private static final String PREF_MANAGE_YOUR_GOOGLE_ACCOUNT = "manage_your_google_account";
...@@ -159,6 +161,9 @@ public class SyncAndServicesPreferences extends PreferenceFragment ...@@ -159,6 +161,9 @@ public class SyncAndServicesPreferences extends PreferenceFragment
PreferenceUtils.addPreferencesFromResource(this, R.xml.sync_and_services_preferences); PreferenceUtils.addPreferencesFromResource(this, R.xml.sync_and_services_preferences);
if (!ChromeFeatureList.isEnabled(ChromeFeatureList.IDENTITY_DISC)) {
getPreferenceScreen().removePreference(findPreference(PREF_USER_CATEGORY));
}
mSigninPreference = (SignInPreference) findPreference(PREF_SIGNIN); mSigninPreference = (SignInPreference) findPreference(PREF_SIGNIN);
mSigninPreference.setPersonalizedPromoEnabled(false); mSigninPreference.setPersonalizedPromoEnabled(false);
mManageYourGoogleAccount = findPreference(PREF_MANAGE_YOUR_GOOGLE_ACCOUNT); mManageYourGoogleAccount = findPreference(PREF_MANAGE_YOUR_GOOGLE_ACCOUNT);
......
...@@ -257,6 +257,9 @@ CHAR-LIMIT guidelines: ...@@ -257,6 +257,9 @@ CHAR-LIMIT guidelines:
<message name="IDS_SHOW" desc="Label for a show button. Used in multiple contexts. [CHAR-LIMIT=20]"> <message name="IDS_SHOW" desc="Label for a show button. Used in multiple contexts. [CHAR-LIMIT=20]">
Show Show
</message> </message>
<message name="IDS_USER" desc="Generic label for UI elements with information about user.">
User
</message>
<!-- Main Preferences --> <!-- Main Preferences -->
<message name="IDS_PREFERENCES" desc="Title for Chrome's Settings."> <message name="IDS_PREFERENCES" desc="Title for Chrome's Settings.">
...@@ -346,7 +349,7 @@ CHAR-LIMIT guidelines: ...@@ -346,7 +349,7 @@ CHAR-LIMIT guidelines:
Sync is on Sync is on
</message> </message>
<message name="IDS_SIGN_IN_TO_CHROME_DISABLED_SUMMARY" desc="A descriptive line of text that appears under the 'Sign in to Chrome' option, in Chrome Settings on Android. The text explains why 'Sign in to Chrome' is disabled. 'Administrator' refers to the IT administrator of the company/organization that owns the user’s device."> <message name="IDS_SIGN_IN_TO_CHROME_DISABLED_SUMMARY" desc="A descriptive line of text that appears under the 'Sign in to Chrome' option, in Chrome Settings on Android. The text explains why 'Sign in to Chrome' is disabled. 'Administrator' refers to the IT administrator of the company/organization that owns the user’s device.">
Disabled by the administrator of this device Disabled by the administrator of this device
</message> </message>
<message name="IDS_SIGN_IN_GOOGLE_ACTIVITY_CONTROLS_LEGACY" desc="Title of Google activity controls preference in signed in accounts settings screen"> <message name="IDS_SIGN_IN_GOOGLE_ACTIVITY_CONTROLS_LEGACY" desc="Title of Google activity controls preference in signed in accounts settings screen">
Google Activity Controls Google Activity Controls
......
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