Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/preferences/SyncPreference.java

Issue 2784353002: Android: Remove GetApplicationContext part 2 (Closed)
Patch Set: Fix tests Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698