Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Side by Side Diff: components/offline_items_collection/core/android/offline_item_visuals_bridge.cc

Issue 2811803006: Add support for pulling icons for OfflineItems (Closed)
Patch Set: More findbugs Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "components/offline_items_collection/core/android/offline_item_visuals_ bridge.h"
6
7 #include "components/offline_items_collection/core/offline_item.h"
8 #include "jni/OfflineItemVisualsBridge_jni.h"
9 #include "ui/gfx/android/java_bitmap.h"
10 #include "ui/gfx/image/image.h"
11
12 using base::android::ScopedJavaLocalRef;
13
14 namespace offline_items_collection {
15 namespace android {
16
17 // static
18 ScopedJavaLocalRef<jobject> OfflineItemVisualsBridge::CreateOfflineItemVisuals(
19 JNIEnv* env,
20 const OfflineItemVisuals* const visuals) {
21 if (!visuals)
22 return nullptr;
23
24 base::android::ScopedJavaLocalRef<jobject> j_icon;
25
26 if (!visuals->icon.IsEmpty())
27 j_icon = gfx::ConvertToJavaBitmap(visuals->icon.ToSkBitmap());
28
29 return Java_OfflineItemVisualsBridge_createOfflineItemVisuals(env, j_icon);
30 }
31
32 } // namespace android
33 } // namespace offline_items_collection
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698