[Android] Introduce a Java wrapper for TemplateUrlService.

The idea here is to move model/native logic from the Android
downstream port into chromium and instead provide a Java API, exposing
any necessary functions for consumption by the app. This also brings the
Android code closer to other ports so it's easier for OWNERS to both
see and review changes.

Aside: includes a small change to jni generator to support generating bindings for interfaces.

BUG=169106
TBR=sky

Review URL: https://chromiumcodereview.appspot.com/12255042

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184724 0039d316-1c4b-4281-b951-d872f2087c98


CrOS-Libchrome-Original-Commit: 63d9abc9e3a915fae5b36a4d9344a48d2d97fdf9
diff --git a/base/android/jni_generator/jni_generator.py b/base/android/jni_generator/jni_generator.py
index d57662e..2c6394a 100755
--- a/base/android/jni_generator/jni_generator.py
+++ b/base/android/jni_generator/jni_generator.py
@@ -423,8 +423,9 @@
   def __init__(self, contents, namespace):
     self.contents = contents
     self.namespace = namespace
-    self.fully_qualified_class = re.match('.*?class (?P<class_name>.*?) ',
-                                          contents[1]).group('class_name')
+    self.fully_qualified_class = re.match(
+        '.*?(class|interface) (?P<class_name>.*?)( |{)',
+        contents[1]).group('class_name')
     self.fully_qualified_class = self.fully_qualified_class.replace('.', '/')
     JniParams.SetFullyQualifiedClass(self.fully_qualified_class)
     self.java_class_name = self.fully_qualified_class.split('/')[-1]