| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/renderer_host/java/java_bound_object.h" | 5 #include "content/browser/renderer_host/java/java_bound_object.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
| 9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
| 10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 using WebKit::WebBindings; | 23 using WebKit::WebBindings; |
| 24 | 24 |
| 25 // The conversion between JavaScript and Java types is based on the Live | 25 // The conversion between JavaScript and Java types is based on the Live |
| 26 // Connect 2 spec. See | 26 // Connect 2 spec. See |
| 27 // http://jdk6.java.net/plugin2/liveconnect/#JS_JAVA_CONVERSIONS. | 27 // http://jdk6.java.net/plugin2/liveconnect/#JS_JAVA_CONVERSIONS. |
| 28 | 28 |
| 29 // Note that in some cases, we differ from from the spec in order to maintain | 29 // Note that in some cases, we differ from from the spec in order to maintain |
| 30 // existing behavior. These areas are marked LIVECONNECT_COMPLIANCE. We may | 30 // existing behavior. These areas are marked LIVECONNECT_COMPLIANCE. We may |
| 31 // revisit this decision in the future. | 31 // revisit this decision in the future. |
| 32 | 32 |
| 33 namespace content { |
| 33 namespace { | 34 namespace { |
| 34 | 35 |
| 35 const char kJavaLangClass[] = "java/lang/Class"; | 36 const char kJavaLangClass[] = "java/lang/Class"; |
| 36 const char kJavaLangObject[] = "java/lang/Object"; | 37 const char kJavaLangObject[] = "java/lang/Object"; |
| 37 const char kJavaLangReflectMethod[] = "java/lang/reflect/Method"; | 38 const char kJavaLangReflectMethod[] = "java/lang/reflect/Method"; |
| 38 // TODO(dtrainor): Parameterize this so that WebView and Chrome for Android can | 39 // TODO(dtrainor): Parameterize this so that WebView and Chrome for Android can |
| 39 // use different annotations. | 40 // use different annotations. |
| 40 const char kJavaScriptInterfaceAnnotation[] = | 41 const char kJavaScriptInterfaceAnnotation[] = |
| 41 "org/chromium/content/browser/JavascriptInterface"; | 42 "org/chromium/content/browser/JavascriptInterface"; |
| 42 const char kGetClass[] = "getClass"; | 43 const char kGetClass[] = "getClass"; |
| (...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 858 g_safe_annotation_clazz); | 859 g_safe_annotation_clazz); |
| 859 | 860 |
| 860 if (!safe) | 861 if (!safe) |
| 861 continue; | 862 continue; |
| 862 } | 863 } |
| 863 | 864 |
| 864 JavaMethod* method = new JavaMethod(java_method); | 865 JavaMethod* method = new JavaMethod(java_method); |
| 865 methods_.insert(std::make_pair(method->name(), method)); | 866 methods_.insert(std::make_pair(method->name(), method)); |
| 866 } | 867 } |
| 867 } | 868 } |
| 869 |
| 870 } // namespace content |
| OLD | NEW |