| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/favicon_helper.h" | 5 #include "chrome/browser/android/favicon_helper.h" |
| 6 | 6 |
| 7 #include <jni.h> | 7 #include <jni.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" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 | 51 |
| 52 // Call java side OnLocalFaviconAvailable method. | 52 // Call java side OnLocalFaviconAvailable method. |
| 53 Java_FaviconImageCallback_onFaviconAvailable(env, | 53 Java_FaviconImageCallback_onFaviconAvailable(env, |
| 54 j_favicon_image_callback->obj(), | 54 j_favicon_image_callback->obj(), |
| 55 j_favicon_bitmap.obj(), | 55 j_favicon_bitmap.obj(), |
| 56 j_icon_url.obj()); | 56 j_icon_url.obj()); |
| 57 } | 57 } |
| 58 | 58 |
| 59 } // namespace | 59 } // namespace |
| 60 | 60 |
| 61 static jint Init(JNIEnv* env, jclass clazz) { | 61 static jlong Init(JNIEnv* env, jclass clazz) { |
| 62 return reinterpret_cast<jint>(new FaviconHelper()); | 62 return reinterpret_cast<intptr_t>(new FaviconHelper()); |
| 63 } | 63 } |
| 64 | 64 |
| 65 FaviconHelper::FaviconHelper() { | 65 FaviconHelper::FaviconHelper() { |
| 66 cancelable_task_tracker_.reset(new CancelableTaskTracker()); | 66 cancelable_task_tracker_.reset(new CancelableTaskTracker()); |
| 67 } | 67 } |
| 68 | 68 |
| 69 void FaviconHelper::Destroy(JNIEnv* env, jobject obj) { | 69 void FaviconHelper::Destroy(JNIEnv* env, jobject obj) { |
| 70 delete this; | 70 delete this; |
| 71 } | 71 } |
| 72 | 72 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 return color_utils::CalculateKMeanColorOfPNG( | 159 return color_utils::CalculateKMeanColorOfPNG( |
| 160 png_data, min_darkness, max_brightness, &sampler); | 160 png_data, min_darkness, max_brightness, &sampler); |
| 161 } | 161 } |
| 162 | 162 |
| 163 FaviconHelper::~FaviconHelper() {} | 163 FaviconHelper::~FaviconHelper() {} |
| 164 | 164 |
| 165 // static | 165 // static |
| 166 bool FaviconHelper::RegisterFaviconHelper(JNIEnv* env) { | 166 bool FaviconHelper::RegisterFaviconHelper(JNIEnv* env) { |
| 167 return RegisterNativesImpl(env); | 167 return RegisterNativesImpl(env); |
| 168 } | 168 } |
| OLD | NEW |