OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/large_icon_bridge.h" | 5 #include "chrome/browser/android/large_icon_bridge.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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 result.bitmap.bitmap_data->size(), | 45 result.bitmap.bitmap_data->size(), |
46 &bitmap); | 46 &bitmap); |
47 if (!bitmap.isNull()) | 47 if (!bitmap.isNull()) |
48 j_bitmap = gfx::ConvertToJavaBitmap(&bitmap); | 48 j_bitmap = gfx::ConvertToJavaBitmap(&bitmap); |
49 } | 49 } |
50 | 50 |
51 jint background_color = kDefaultBackgroundColor; | 51 jint background_color = kDefaultBackgroundColor; |
52 if (result.fallback_icon_style) | 52 if (result.fallback_icon_style) |
53 background_color = result.fallback_icon_style->background_color; | 53 background_color = result.fallback_icon_style->background_color; |
54 | 54 |
55 Java_LargeIconCallback_onLargeIconAvailable(env, | 55 Java_LargeIconCallback_onLargeIconAvailable(env, j_callback->obj(), j_bitmap, |
56 j_callback->obj(), | |
57 j_bitmap.obj(), | |
58 background_color); | 56 background_color); |
59 } | 57 } |
60 | 58 |
61 } // namespace | 59 } // namespace |
62 | 60 |
63 static jlong Init(JNIEnv* env, const JavaParamRef<jclass>& clazz) { | 61 static jlong Init(JNIEnv* env, const JavaParamRef<jclass>& clazz) { |
64 return reinterpret_cast<intptr_t>(new LargeIconBridge()); | 62 return reinterpret_cast<intptr_t>(new LargeIconBridge()); |
65 } | 63 } |
66 | 64 |
67 LargeIconBridge::LargeIconBridge() { | 65 LargeIconBridge::LargeIconBridge() { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 callback_runner, | 102 callback_runner, |
105 &cancelable_task_tracker_); | 103 &cancelable_task_tracker_); |
106 | 104 |
107 return true; | 105 return true; |
108 } | 106 } |
109 | 107 |
110 // static | 108 // static |
111 bool LargeIconBridge::RegisterLargeIconBridge(JNIEnv* env) { | 109 bool LargeIconBridge::RegisterLargeIconBridge(JNIEnv* env) { |
112 return RegisterNativesImpl(env); | 110 return RegisterNativesImpl(env); |
113 } | 111 } |
OLD | NEW |