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

Unified Diff: content/public/android/java/src/org/chromium/content/common/JavaScriptInterface.java

Issue 10830173: JavaBridge should use Annotation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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
Index: content/public/android/java/src/org/chromium/content/common/JavaScriptInterface.java
diff --git a/base/android/java/src/org/chromium/base/AccessedByNative.java b/content/public/android/java/src/org/chromium/content/common/JavaScriptInterface.java
similarity index 53%
copy from base/android/java/src/org/chromium/base/AccessedByNative.java
copy to content/public/android/java/src/org/chromium/content/common/JavaScriptInterface.java
index 8248cc68eedefd598305f27707f438f0e815df55..21be4882aca6b9f1c48361692fc5519668d13882 100644
--- a/base/android/java/src/org/chromium/base/AccessedByNative.java
+++ b/content/public/android/java/src/org/chromium/content/common/JavaScriptInterface.java
@@ -2,7 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-package org.chromium.base;
+package org.chromium.content.common;
+
+import org.chromium.content.browser.ContentViewCore;
joth 2012/08/04 20:38:28 maybe rather than import, just use the fully quali
David Trainor- moved to gerrit 2012/08/06 23:42:33 Done.
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
@@ -10,11 +12,11 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
- * @AccessedByNative is used to ensure proguard will keep this field, since it's
- * only accessed by native.
+ * Marks a method as being able to be run from JavaScript.
joth 2012/08/04 20:38:28 nit: Marks a method as being safe to be exposed to
Steve Block 2012/08/06 12:12:30 Same comment about using the word 'safe' - I think
David Trainor- moved to gerrit 2012/08/06 23:42:33 Done.
+ * @see {@link ContentViewCore#addJavascriptInterface(Class, String, boolean)}
*/
-@Target(ElementType.FIELD)
+@SuppressWarnings("javadoc")
@Retention(RetentionPolicy.RUNTIME)
-public @interface AccessedByNative {
- public String value() default "";
-}
+@Target({ElementType.METHOD})
+public @interface JavaScriptInterface {
Steve Block 2012/08/06 12:12:30 Hmm, 'JavaScriptInterface' is the correct camel-ca
David Trainor- moved to gerrit 2012/08/06 23:42:33 Will change thanks!
+}

Powered by Google App Engine
This is Rietveld 408576698