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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 j_icon_url.obj()); | 55 j_icon_url.obj()); |
56 } | 56 } |
57 | 57 |
58 } // namespace | 58 } // namespace |
59 | 59 |
60 static jlong Init(JNIEnv* env, jclass clazz) { | 60 static jlong Init(JNIEnv* env, jclass clazz) { |
61 return reinterpret_cast<intptr_t>(new FaviconHelper()); | 61 return reinterpret_cast<intptr_t>(new FaviconHelper()); |
62 } | 62 } |
63 | 63 |
64 FaviconHelper::FaviconHelper() { | 64 FaviconHelper::FaviconHelper() { |
65 cancelable_task_tracker_.reset(new CancelableTaskTracker()); | 65 cancelable_task_tracker_.reset(new base::CancelableTaskTracker()); |
66 } | 66 } |
67 | 67 |
68 void FaviconHelper::Destroy(JNIEnv* env, jobject obj) { | 68 void FaviconHelper::Destroy(JNIEnv* env, jobject obj) { |
69 delete this; | 69 delete this; |
70 } | 70 } |
71 | 71 |
72 jboolean FaviconHelper::GetLocalFaviconImageForURL( | 72 jboolean FaviconHelper::GetLocalFaviconImageForURL( |
73 JNIEnv* env, | 73 JNIEnv* env, |
74 jobject obj, | 74 jobject obj, |
75 jobject j_profile, | 75 jobject j_profile, |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 return color_utils::CalculateKMeanColorOfPNG( | 157 return color_utils::CalculateKMeanColorOfPNG( |
158 png_data, min_darkness, max_brightness, &sampler); | 158 png_data, min_darkness, max_brightness, &sampler); |
159 } | 159 } |
160 | 160 |
161 FaviconHelper::~FaviconHelper() {} | 161 FaviconHelper::~FaviconHelper() {} |
162 | 162 |
163 // static | 163 // static |
164 bool FaviconHelper::RegisterFaviconHelper(JNIEnv* env) { | 164 bool FaviconHelper::RegisterFaviconHelper(JNIEnv* env) { |
165 return RegisterNativesImpl(env); | 165 return RegisterNativesImpl(env); |
166 } | 166 } |
OLD | NEW |