| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/android/profiles/profile_downloader_android.h" | 5 #include "chrome/browser/android/profiles/profile_downloader_android.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
| 13 #include "chrome/browser/profiles/profile_android.h" | 13 #include "chrome/browser/profiles/profile_android.h" |
| 14 #include "chrome/browser/profiles/profile_attributes_entry.h" | 14 #include "chrome/browser/profiles/profile_attributes_entry.h" |
| 15 #include "chrome/browser/profiles/profile_attributes_storage.h" | 15 #include "chrome/browser/profiles/profile_attributes_storage.h" |
| 16 #include "chrome/browser/profiles/profile_avatar_icon_util.h" | 16 #include "chrome/browser/profiles/profile_avatar_icon_util.h" |
| 17 #include "chrome/browser/profiles/profile_downloader.h" | 17 #include "chrome/browser/profiles/profile_downloader.h" |
| 18 #include "chrome/browser/profiles/profile_downloader_delegate.h" | 18 #include "chrome/browser/profiles/profile_downloader_delegate.h" |
| 19 #include "chrome/browser/profiles/profile_manager.h" | 19 #include "chrome/browser/profiles/profile_manager.h" |
| 20 #include "chrome/browser/signin/account_tracker_service_factory.h" | 20 #include "chrome/browser/signin/account_tracker_service_factory.h" |
| 21 #include "components/signin/core/browser/account_tracker_service.h" | 21 #include "components/signin/core/browser/account_tracker_service.h" |
| 22 #include "google_apis/gaia/gaia_auth_util.h" | 22 #include "google_apis/gaia/gaia_auth_util.h" |
| 23 #include "jni/ProfileDownloader_jni.h" | 23 #include "jni/ProfileDownloader_jni.h" |
| 24 #include "third_party/skia/include/core/SkBitmap.h" | 24 #include "third_party/skia/include/core/SkBitmap.h" |
| 25 #include "ui/gfx/android/java_bitmap.h" | 25 #include "ui/gfx/android/java_bitmap.h" |
| 26 #include "ui/gfx/image/image_skia.h" | 26 #include "ui/gfx/image/image_skia.h" |
| 27 #include "ui/gfx/screen.h" | |
| 28 | 27 |
| 29 namespace { | 28 namespace { |
| 30 | 29 |
| 31 // An account fetcher callback. | 30 // An account fetcher callback. |
| 32 class AccountInfoRetriever : public ProfileDownloaderDelegate { | 31 class AccountInfoRetriever : public ProfileDownloaderDelegate { |
| 33 public: | 32 public: |
| 34 AccountInfoRetriever(Profile* profile, | 33 AccountInfoRetriever(Profile* profile, |
| 35 const std::string& account_id, | 34 const std::string& account_id, |
| 36 const std::string& email, | 35 const std::string& email, |
| 37 const int desired_image_side_pixels, | 36 const int desired_image_side_pixels, |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 profile, | 206 profile, |
| 208 account_tracker_service->FindAccountInfoByEmail(email).account_id, email, | 207 account_tracker_service->FindAccountInfoByEmail(email).account_id, email, |
| 209 image_side_pixels, is_pre_signin); | 208 image_side_pixels, is_pre_signin); |
| 210 retriever->Start(); | 209 retriever->Start(); |
| 211 } | 210 } |
| 212 | 211 |
| 213 // static | 212 // static |
| 214 bool RegisterProfileDownloader(JNIEnv* env) { | 213 bool RegisterProfileDownloader(JNIEnv* env) { |
| 215 return RegisterNativesImpl(env); | 214 return RegisterNativesImpl(env); |
| 216 } | 215 } |
| OLD | NEW |