OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "content/common/android/media_metadata_android.h" | 5 #include "content/common/android/media_metadata_android.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
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 "content/public/common/media_metadata.h" | 12 #include "content/public/common/media_metadata.h" |
13 #include "jni/MediaMetadata_jni.h" | 13 #include "jni/MediaMetadata_jni.h" |
14 | 14 |
| 15 using base::android::ScopedJavaLocalRef; |
| 16 |
15 namespace content { | 17 namespace content { |
16 | 18 |
17 namespace { | 19 namespace { |
18 | 20 |
19 std::vector<int> GetFlattenedSizeArray(const std::vector<gfx::Size>& sizes) { | 21 std::vector<int> GetFlattenedSizeArray(const std::vector<gfx::Size>& sizes) { |
20 std::vector<int> flattened_array; | 22 std::vector<int> flattened_array; |
21 flattened_array.reserve(2 * sizes.size()); | 23 flattened_array.reserve(2 * sizes.size()); |
22 for (const auto& size : sizes) { | 24 for (const auto& size : sizes) { |
23 flattened_array.push_back(size.width()); | 25 flattened_array.push_back(size.width()); |
24 flattened_array.push_back(size.height()); | 26 flattened_array.push_back(size.height()); |
(...skipping 30 matching lines...) Expand all Loading... |
55 env, GetFlattenedSizeArray(artwork.sizes))); | 57 env, GetFlattenedSizeArray(artwork.sizes))); |
56 | 58 |
57 Java_MediaMetadata_createAndAddArtwork( | 59 Java_MediaMetadata_createAndAddArtwork( |
58 env, j_metadata.obj(), j_src.obj(), j_type.obj(), j_sizes.obj()); | 60 env, j_metadata.obj(), j_src.obj(), j_type.obj(), j_sizes.obj()); |
59 } | 61 } |
60 | 62 |
61 return j_metadata; | 63 return j_metadata; |
62 } | 64 } |
63 | 65 |
64 } // namespace content | 66 } // namespace content |
OLD | NEW |