| 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/logo_bridge.h" | 5 #include "chrome/browser/android/logo_bridge.h" |
| 6 | 6 |
| 7 #include <jni.h> | 7 #include <jni.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
| 11 #include "base/android/jni_array.h" | 11 #include "base/android/jni_array.h" |
| 12 #include "base/android/jni_string.h" | 12 #include "base/android/jni_string.h" |
| 13 #include "base/android/scoped_java_ref.h" | 13 #include "base/android/scoped_java_ref.h" |
| 14 #include "base/metrics/histogram_macros.h" | 14 #include "base/metrics/histogram_macros.h" |
| 15 #include "chrome/browser/android/logo_service.h" | 15 #include "chrome/browser/android/logo_service.h" |
| 16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| 17 #include "chrome/browser/profiles/profile_android.h" | 17 #include "chrome/browser/profiles/profile_android.h" |
| 18 #include "components/search_provider_logos/logo_tracker.h" | 18 #include "components/search_provider_logos/logo_tracker.h" |
| 19 #include "jni/LogoBridge_jni.h" | 19 #include "jni/LogoBridge_jni.h" |
| 20 #include "net/url_request/url_fetcher.h" | 20 #include "net/url_request/url_fetcher.h" |
| 21 #include "net/url_request/url_request_context_getter.h" | 21 #include "net/url_request/url_request_context_getter.h" |
| 22 #include "net/url_request/url_request_status.h" | 22 #include "net/url_request/url_request_status.h" |
| 23 #include "third_party/skia/include/core/SkBitmap.h" | 23 #include "third_party/skia/include/core/SkBitmap.h" |
| 24 #include "ui/gfx/android/java_bitmap.h" | 24 #include "ui/gfx/android/java_bitmap.h" |
| 25 | 25 |
| 26 using base::android::ConvertJavaStringToUTF8; | 26 using base::android::ConvertJavaStringToUTF8; |
| 27 using base::android::ConvertUTF8ToJavaString; | 27 using base::android::ConvertUTF8ToJavaString; |
| 28 using base::android::JavaParamRef; |
| 28 using base::android::ScopedJavaLocalRef; | 29 using base::android::ScopedJavaLocalRef; |
| 29 using base::android::ToJavaByteArray; | 30 using base::android::ToJavaByteArray; |
| 30 | 31 |
| 31 namespace { | 32 namespace { |
| 32 | 33 |
| 33 // Converts a C++ Logo to a Java Logo. | 34 // Converts a C++ Logo to a Java Logo. |
| 34 ScopedJavaLocalRef<jobject> ConvertLogoToJavaObject( | 35 ScopedJavaLocalRef<jobject> ConvertLogoToJavaObject( |
| 35 JNIEnv* env, | 36 JNIEnv* env, |
| 36 const search_provider_logos::Logo* logo) { | 37 const search_provider_logos::Logo* logo) { |
| 37 if (!logo) | 38 if (!logo) |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 | 172 |
| 172 void LogoBridge::ClearFetcher() { | 173 void LogoBridge::ClearFetcher() { |
| 173 fetcher_.reset(); | 174 fetcher_.reset(); |
| 174 j_callback_.Reset(); | 175 j_callback_.Reset(); |
| 175 } | 176 } |
| 176 | 177 |
| 177 // static | 178 // static |
| 178 bool RegisterLogoBridge(JNIEnv* env) { | 179 bool RegisterLogoBridge(JNIEnv* env) { |
| 179 return RegisterNativesImpl(env); | 180 return RegisterNativesImpl(env); |
| 180 } | 181 } |
| OLD | NEW |