OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 | 4 |
5 package org.chromium.chrome.browser.firstrun; | 5 package org.chromium.chrome.browser.firstrun; |
6 | 6 |
7 import android.accounts.Account; | 7 import android.accounts.Account; |
8 import android.content.Context; | 8 import android.content.Context; |
9 import android.graphics.Bitmap; | 9 import android.graphics.Bitmap; |
10 import android.graphics.Bitmap.Config; | 10 import android.graphics.Bitmap.Config; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 update(); | 84 update(); |
85 } | 85 } |
86 | 86 |
87 /** | 87 /** |
88 * Initiate fetching the user accounts data (images and the full name). | 88 * Initiate fetching the user accounts data (images and the full name). |
89 * Fetched data will be sent to observers of ProfileDownloader. | 89 * Fetched data will be sent to observers of ProfileDownloader. |
90 */ | 90 */ |
91 public void update() { | 91 public void update() { |
92 if (mProfile == null) return; | 92 if (mProfile == null) return; |
93 | 93 |
94 Account[] accounts = AccountManagerHelper.get(mContext).getGoogleAccount
s(); | 94 Account[] accounts = AccountManagerHelper.get().getGoogleAccounts(); |
95 for (int i = 0; i < accounts.length; i++) { | 95 for (int i = 0; i < accounts.length; i++) { |
96 if (mCacheEntries.get(accounts[i].name) == null) { | 96 if (mCacheEntries.get(accounts[i].name) == null) { |
97 ProfileDownloader.startFetchingAccountInfoFor( | 97 ProfileDownloader.startFetchingAccountInfoFor( |
98 mContext, mProfile, accounts[i].name, mImageSizePx, true
); | 98 mContext, mProfile, accounts[i].name, mImageSizePx, true
); |
99 } | 99 } |
100 } | 100 } |
101 } | 101 } |
102 | 102 |
103 /** | 103 /** |
104 * @param accountId Google account ID for the image that is requested. | 104 * @param accountId Google account ID for the image that is requested. |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 return output; | 173 return output; |
174 } | 174 } |
175 | 175 |
176 /** | 176 /** |
177 * @param observer Observer that should be notified when new profile images
are available. | 177 * @param observer Observer that should be notified when new profile images
are available. |
178 */ | 178 */ |
179 public void setObserver(Observer observer) { | 179 public void setObserver(Observer observer) { |
180 mObserver = observer; | 180 mObserver = observer; |
181 } | 181 } |
182 } | 182 } |
OLD | NEW |