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_array.h" | 10 #include "base/android/jni_array.h" |
11 #include "base/android/jni_string.h" | 11 #include "base/android/jni_string.h" |
12 #include "base/android/scoped_java_ref.h" | 12 #include "base/android/scoped_java_ref.h" |
13 #include "base/bind.h" | 13 #include "base/bind.h" |
14 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
16 #include "chrome/browser/favicon/favicon_service.h" | |
17 #include "chrome/browser/favicon/favicon_service_factory.h" | 16 #include "chrome/browser/favicon/favicon_service_factory.h" |
18 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
19 #include "chrome/browser/profiles/profile_android.h" | 18 #include "chrome/browser/profiles/profile_android.h" |
20 #include "chrome/browser/sync/open_tabs_ui_delegate.h" | 19 #include "chrome/browser/sync/open_tabs_ui_delegate.h" |
21 #include "chrome/browser/sync/profile_sync_service.h" | 20 #include "chrome/browser/sync/profile_sync_service.h" |
22 #include "chrome/browser/sync/profile_sync_service_factory.h" | 21 #include "chrome/browser/sync/profile_sync_service_factory.h" |
23 #include "chrome/browser/sync/profile_sync_service_factory.h" | 22 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 23 #include "components/favicon/core/browser/favicon_service.h" |
24 #include "jni/FaviconHelper_jni.h" | 24 #include "jni/FaviconHelper_jni.h" |
25 #include "third_party/skia/include/core/SkBitmap.h" | 25 #include "third_party/skia/include/core/SkBitmap.h" |
26 #include "ui/gfx/android/java_bitmap.h" | 26 #include "ui/gfx/android/java_bitmap.h" |
27 #include "ui/gfx/codec/png_codec.h" | 27 #include "ui/gfx/codec/png_codec.h" |
28 #include "ui/gfx/color_analysis.h" | 28 #include "ui/gfx/color_analysis.h" |
29 #include "ui/gfx/color_utils.h" | 29 #include "ui/gfx/color_utils.h" |
30 | 30 |
31 using base::android::ScopedJavaGlobalRef; | 31 using base::android::ScopedJavaGlobalRef; |
32 using base::android::ScopedJavaLocalRef; | 32 using base::android::ScopedJavaLocalRef; |
33 using base::android::AttachCurrentThread; | 33 using base::android::AttachCurrentThread; |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 | 218 |
219 gfx::JavaBitmap bitmap_lock(bitmap); | 219 gfx::JavaBitmap bitmap_lock(bitmap); |
220 SkBitmap skbitmap = gfx::CreateSkBitmapFromJavaBitmap(bitmap_lock); | 220 SkBitmap skbitmap = gfx::CreateSkBitmapFromJavaBitmap(bitmap_lock); |
221 return color_utils::CalculateKMeanColorOfBitmap(skbitmap); | 221 return color_utils::CalculateKMeanColorOfBitmap(skbitmap); |
222 } | 222 } |
223 | 223 |
224 // static | 224 // static |
225 bool FaviconHelper::RegisterFaviconHelper(JNIEnv* env) { | 225 bool FaviconHelper::RegisterFaviconHelper(JNIEnv* env) { |
226 return RegisterNativesImpl(env); | 226 return RegisterNativesImpl(env); |
227 } | 227 } |
OLD | NEW |