| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 * Initiate fetching the user accounts data (images and the full name). | 87 * Initiate fetching the user accounts data (images and the full name). |
| 88 * Fetched data will be sent to observers of ProfileDownloader. | 88 * Fetched data will be sent to observers of ProfileDownloader. |
| 89 */ | 89 */ |
| 90 public void update() { | 90 public void update() { |
| 91 if (mProfile == null) return; | 91 if (mProfile == null) return; |
| 92 | 92 |
| 93 Account[] accounts = AccountManagerHelper.get(mContext).getGoogleAccount
s(); | 93 Account[] accounts = AccountManagerHelper.get(mContext).getGoogleAccount
s(); |
| 94 for (int i = 0; i < accounts.length; i++) { | 94 for (int i = 0; i < accounts.length; i++) { |
| 95 if (mCacheEntries.get(accounts[i].name) == null) { | 95 if (mCacheEntries.get(accounts[i].name) == null) { |
| 96 ProfileDownloader.startFetchingAccountInfoFor( | 96 ProfileDownloader.startFetchingAccountInfoFor( |
| 97 mProfile, accounts[i].name, mImageSizePx, true); | 97 mContext, mProfile, accounts[i].name, mImageSizePx, true
); |
| 98 } | 98 } |
| 99 } | 99 } |
| 100 } | 100 } |
| 101 | 101 |
| 102 /** | 102 /** |
| 103 * @param accountId Google account ID for the image that is requested. | 103 * @param accountId Google account ID for the image that is requested. |
| 104 * @return Returns the profile image for a given Google account ID if it's i
n | 104 * @return Returns the profile image for a given Google account ID if it's i
n |
| 105 * the cache, otherwise returns a placeholder image. | 105 * the cache, otherwise returns a placeholder image. |
| 106 */ | 106 */ |
| 107 public Bitmap getImage(String accountId) { | 107 public Bitmap getImage(String accountId) { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 return output; | 172 return output; |
| 173 } | 173 } |
| 174 | 174 |
| 175 /** | 175 /** |
| 176 * @param observer Observer that should be notified when new profile images
are available. | 176 * @param observer Observer that should be notified when new profile images
are available. |
| 177 */ | 177 */ |
| 178 public void setObserver(Observer observer) { | 178 public void setObserver(Observer observer) { |
| 179 mObserver = observer; | 179 mObserver = observer; |
| 180 } | 180 } |
| 181 } | 181 } |
| OLD | NEW |