| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 package org.chromium.chrome.browser.preferences; | 4 package org.chromium.chrome.browser.preferences; |
| 5 | 5 |
| 6 import android.accounts.Account; | 6 import android.accounts.Account; |
| 7 import android.content.Context; | 7 import android.content.Context; |
| 8 import android.content.res.Resources; | 8 import android.content.res.Resources; |
| 9 import android.graphics.PorterDuff; | 9 import android.graphics.PorterDuff; |
| 10 import android.graphics.drawable.Drawable; | 10 import android.graphics.drawable.Drawable; |
| 11 import android.preference.Preference; | 11 import android.preference.Preference; |
| 12 import android.util.AttributeSet; | 12 import android.util.AttributeSet; |
| 13 | 13 |
| 14 import org.chromium.base.ApiCompatibilityUtils; | 14 import org.chromium.base.ApiCompatibilityUtils; |
| 15 import org.chromium.chrome.R; | 15 import org.chromium.chrome.R; |
| 16 import org.chromium.chrome.browser.childaccounts.ChildAccountService; | 16 import org.chromium.chrome.browser.childaccounts.ChildAccountService; |
| 17 import org.chromium.chrome.browser.sync.GoogleServiceAuthError; | 17 import org.chromium.chrome.browser.sync.GoogleServiceAuthError; |
| 18 import org.chromium.chrome.browser.sync.ProfileSyncService; | 18 import org.chromium.chrome.browser.sync.ProfileSyncService; |
| 19 import org.chromium.sync.AndroidSyncSettings; | 19 import org.chromium.components.sync.AndroidSyncSettings; |
| 20 import org.chromium.sync.signin.ChromeSigninController; | 20 import org.chromium.components.sync.signin.ChromeSigninController; |
| 21 | 21 |
| 22 /** | 22 /** |
| 23 * A preference that displays the current sync account and status (enabled, erro
r, needs passphrase, | 23 * A preference that displays the current sync account and status (enabled, erro
r, needs passphrase, |
| 24 * etc). | 24 * etc). |
| 25 */ | 25 */ |
| 26 public class SyncPreference extends Preference { | 26 public class SyncPreference extends Preference { |
| 27 public SyncPreference(Context context, AttributeSet attrs) { | 27 public SyncPreference(Context context, AttributeSet attrs) { |
| 28 super(context, attrs); | 28 super(context, attrs); |
| 29 updateSyncSummaryAndIcon(); | 29 updateSyncSummaryAndIcon(); |
| 30 } | 30 } |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 } | 117 } |
| 118 | 118 |
| 119 Account account = ChromeSigninController.get(context).getSignedInUse
r(); | 119 Account account = ChromeSigninController.get(context).getSignedInUse
r(); |
| 120 return String.format( | 120 return String.format( |
| 121 context.getString(R.string.account_management_sync_summary),
account.name); | 121 context.getString(R.string.account_management_sync_summary),
account.name); |
| 122 } | 122 } |
| 123 | 123 |
| 124 return context.getString(R.string.sync_is_disabled); | 124 return context.getString(R.string.sync_is_disabled); |
| 125 } | 125 } |
| 126 } | 126 } |
| OLD | NEW |