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; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 } | 75 } |
76 } | 76 } |
77 | 77 |
78 return false; | 78 return false; |
79 } | 79 } |
80 | 80 |
81 /** | 81 /** |
82 * Return a short summary of the current sync status. | 82 * Return a short summary of the current sync status. |
83 */ | 83 */ |
84 static String getSyncStatusSummary(Context context) { | 84 static String getSyncStatusSummary(Context context) { |
85 if (!ChromeSigninController.get(context).isSignedIn()) return ""; | 85 if (!ChromeSigninController.get().isSignedIn()) return ""; |
86 | 86 |
87 ProfileSyncService profileSyncService = ProfileSyncService.get(); | 87 ProfileSyncService profileSyncService = ProfileSyncService.get(); |
88 Resources res = context.getResources(); | 88 Resources res = context.getResources(); |
89 | 89 |
90 if (!AndroidSyncSettings.isMasterSyncEnabled(context)) { | 90 if (!AndroidSyncSettings.isMasterSyncEnabled(context)) { |
91 return res.getString(R.string.sync_android_master_sync_disabled); | 91 return res.getString(R.string.sync_android_master_sync_disabled); |
92 } | 92 } |
93 | 93 |
94 if (profileSyncService == null) { | 94 if (profileSyncService == null) { |
95 return res.getString(R.string.sync_is_disabled); | 95 return res.getString(R.string.sync_is_disabled); |
(...skipping 16 matching lines...) Expand all Loading... |
112 | 112 |
113 if (syncEnabled) { | 113 if (syncEnabled) { |
114 if (!profileSyncService.isSyncActive()) { | 114 if (!profileSyncService.isSyncActive()) { |
115 return res.getString(R.string.sync_setup_progress); | 115 return res.getString(R.string.sync_setup_progress); |
116 } | 116 } |
117 | 117 |
118 if (profileSyncService.isPassphraseRequiredForDecryption()) { | 118 if (profileSyncService.isPassphraseRequiredForDecryption()) { |
119 return res.getString(R.string.sync_need_passphrase); | 119 return res.getString(R.string.sync_need_passphrase); |
120 } | 120 } |
121 | 121 |
122 Account account = ChromeSigninController.get(context).getSignedInUse
r(); | 122 Account account = ChromeSigninController.get().getSignedInUser(); |
123 return String.format( | 123 return String.format( |
124 context.getString(R.string.account_management_sync_summary),
account.name); | 124 context.getString(R.string.account_management_sync_summary),
account.name); |
125 } | 125 } |
126 | 126 |
127 return context.getString(R.string.sync_is_disabled); | 127 return context.getString(R.string.sync_is_disabled); |
128 } | 128 } |
129 } | 129 } |
OLD | NEW |