| 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 #include "chrome/browser/ui/android/infobars/account_chooser_infobar.h" | 5 #include "chrome/browser/ui/android/infobars/account_chooser_infobar.h" |
| 6 | 6 |
| 7 #include "base/android/scoped_java_ref.h" | 7 #include "base/android/scoped_java_ref.h" |
| 8 #include "chrome/browser/bitmap_fetcher/bitmap_fetcher.h" | 8 #include "chrome/browser/bitmap_fetcher/bitmap_fetcher.h" |
| 9 #include "chrome/browser/infobars/infobar_service.h" | 9 #include "chrome/browser/infobars/infobar_service.h" |
| 10 #include "chrome/browser/password_manager/account_chooser_infobar_delegate_andro
id.h" | 10 #include "chrome/browser/password_manager/account_chooser_infobar_delegate_andro
id.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 } | 71 } |
| 72 delete this; | 72 delete this; |
| 73 } | 73 } |
| 74 | 74 |
| 75 void FetchAvatars( | 75 void FetchAvatars( |
| 76 const base::android::ScopedJavaGlobalRef<jobject>& java_infobar, | 76 const base::android::ScopedJavaGlobalRef<jobject>& java_infobar, |
| 77 const std::vector<const autofill::PasswordForm*>& password_forms, | 77 const std::vector<const autofill::PasswordForm*>& password_forms, |
| 78 int index, | 78 int index, |
| 79 net::URLRequestContextGetter* request_context) { | 79 net::URLRequestContextGetter* request_context) { |
| 80 for (auto password_form : password_forms) { | 80 for (auto password_form : password_forms) { |
| 81 if (!password_form->avatar_url.is_valid()) | 81 if (!password_form->icon_url.is_valid()) |
| 82 continue; | 82 continue; |
| 83 // Fetcher deletes itself once fetching is finished. | 83 // Fetcher deletes itself once fetching is finished. |
| 84 auto fetcher = new AvatarFetcherAndroid(password_form->avatar_url, index, | 84 auto fetcher = new AvatarFetcherAndroid(password_form->icon_url, index, |
| 85 java_infobar); | 85 java_infobar); |
| 86 fetcher->Start(request_context); | 86 fetcher->Start(request_context); |
| 87 ++index; | 87 ++index; |
| 88 } | 88 } |
| 89 } | 89 } |
| 90 | 90 |
| 91 }; // namespace | 91 }; // namespace |
| 92 | 92 |
| 93 AccountChooserInfoBar::AccountChooserInfoBar( | 93 AccountChooserInfoBar::AccountChooserInfoBar( |
| 94 scoped_ptr<AccountChooserInfoBarDelegateAndroid> delegate) | 94 scoped_ptr<AccountChooserInfoBarDelegateAndroid> delegate) |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 const base::android::JavaRef<jobject>& java_info_bar) { | 156 const base::android::JavaRef<jobject>& java_info_bar) { |
| 157 InfoBarAndroid::SetJavaInfoBar(java_info_bar); | 157 InfoBarAndroid::SetJavaInfoBar(java_info_bar); |
| 158 JNIEnv* env = base::android::AttachCurrentThread(); | 158 JNIEnv* env = base::android::AttachCurrentThread(); |
| 159 Java_AccountChooserInfoBar_setNativePtr(env, java_info_bar.obj(), | 159 Java_AccountChooserInfoBar_setNativePtr(env, java_info_bar.obj(), |
| 160 reinterpret_cast<intptr_t>(this)); | 160 reinterpret_cast<intptr_t>(this)); |
| 161 } | 161 } |
| 162 | 162 |
| 163 bool RegisterAccountChooserInfoBar(JNIEnv* env) { | 163 bool RegisterAccountChooserInfoBar(JNIEnv* env) { |
| 164 return RegisterNativesImpl(env); | 164 return RegisterNativesImpl(env); |
| 165 } | 165 } |
| OLD | NEW |