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 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "content/public/browser/web_contents.h" | 28 #include "content/public/browser/web_contents.h" |
29 #include "jni/FaviconHelper_jni.h" | 29 #include "jni/FaviconHelper_jni.h" |
30 #include "third_party/skia/include/core/SkBitmap.h" | 30 #include "third_party/skia/include/core/SkBitmap.h" |
31 #include "ui/gfx/android/java_bitmap.h" | 31 #include "ui/gfx/android/java_bitmap.h" |
32 #include "ui/gfx/codec/png_codec.h" | 32 #include "ui/gfx/codec/png_codec.h" |
33 #include "ui/gfx/color_analysis.h" | 33 #include "ui/gfx/color_analysis.h" |
34 #include "ui/gfx/color_utils.h" | 34 #include "ui/gfx/color_utils.h" |
35 #include "ui/gfx/image/image_skia.h" | 35 #include "ui/gfx/image/image_skia.h" |
36 #include "ui/gfx/image/image_skia_rep.h" | 36 #include "ui/gfx/image/image_skia_rep.h" |
37 | 37 |
| 38 using base::android::JavaParamRef; |
38 using base::android::ScopedJavaGlobalRef; | 39 using base::android::ScopedJavaGlobalRef; |
39 using base::android::ScopedJavaLocalRef; | 40 using base::android::ScopedJavaLocalRef; |
40 using base::android::AttachCurrentThread; | 41 using base::android::AttachCurrentThread; |
41 using base::android::ConvertJavaStringToUTF16; | 42 using base::android::ConvertJavaStringToUTF16; |
42 using base::android::ConvertJavaStringToUTF8; | 43 using base::android::ConvertJavaStringToUTF8; |
43 using base::android::ConvertUTF8ToJavaString; | 44 using base::android::ConvertUTF8ToJavaString; |
44 | 45 |
45 namespace { | 46 namespace { |
46 | 47 |
47 void OnLocalFaviconAvailable( | 48 void OnLocalFaviconAvailable( |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 | 260 |
260 gfx::JavaBitmap bitmap_lock(bitmap); | 261 gfx::JavaBitmap bitmap_lock(bitmap); |
261 SkBitmap skbitmap = gfx::CreateSkBitmapFromJavaBitmap(bitmap_lock); | 262 SkBitmap skbitmap = gfx::CreateSkBitmapFromJavaBitmap(bitmap_lock); |
262 return color_utils::CalculateKMeanColorOfBitmap(skbitmap); | 263 return color_utils::CalculateKMeanColorOfBitmap(skbitmap); |
263 } | 264 } |
264 | 265 |
265 // static | 266 // static |
266 bool FaviconHelper::RegisterFaviconHelper(JNIEnv* env) { | 267 bool FaviconHelper::RegisterFaviconHelper(JNIEnv* env) { |
267 return RegisterNativesImpl(env); | 268 return RegisterNativesImpl(env); |
268 } | 269 } |
OLD | NEW |