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

Unified Diff: base/android/jni_map.h

Issue 12255042: [Android] Introduce a Java wrapper for TemplateUrlService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/android/jni_generator/jni_generator.py ('k') | base/android/jni_map.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/jni_map.h
diff --git a/base/android/jni_map.h b/base/android/jni_map.h
new file mode 100644
index 0000000000000000000000000000000000000000..59bfb69c80ef4d5e1e4fcd9b008fd5bcaebf5a59
--- /dev/null
+++ b/base/android/jni_map.h
@@ -0,0 +1,34 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_ANDROID_JNI_MAP_H_
+#define BASE_ANDROID_JNI_MAP_H_
+
+#include <jni.h>
+#include <map>
+#include <string>
+
+#include "base/android/scoped_java_ref.h"
+#include "base/base_export.h"
+#include "base/string16.h"
+
+namespace base {
+namespace android {
+
+// Convert a std::map<std::string, string16> to a Java HashMap<String, String>
+BASE_EXPORT ScopedJavaLocalRef<jobject> ConvertMapToJavaMap(
bulach 2013/02/22 12:49:25 ..ToJavaHashMap (and below) ? also, this is conve
+ JNIEnv* env,
+ const std::map<std::string, string16>& cmap);
+
+// Convert a Java subclass of map to std::map. Assumes values are string16.
+// Any null key/values are dropped.
+BASE_EXPORT std::map<std::string, string16> ConvertJavaMapToMap(JNIEnv* env,
+ jobject jmap);
+
+bool RegisterMap(JNIEnv* env);
+
+} // namespace android
+} // namespace base
+
+#endif // BASE_ANDROID_JNI_MAP_H_
« no previous file with comments | « base/android/jni_generator/jni_generator.py ('k') | base/android/jni_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698