diff options
author | Ben Murdoch <benm@google.com> | 2011-07-19 16:53:23 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-07-21 18:18:52 +0100 |
commit | bb958596648e7394f6cd9dcbd264ef9931655764 (patch) | |
tree | fb831f85088bd18727a650cdeda594b29ffc6be9 /android | |
parent | 74b084c38a376b8c8ee24cadcc3e65bfb4b47160 (diff) | |
download | external_chromium-bb958596648e7394f6cd9dcbd264ef9931655764.zip external_chromium-bb958596648e7394f6cd9dcbd264ef9931655764.tar.gz external_chromium-bb958596648e7394f6cd9dcbd264ef9931655764.tar.bz2 |
Query the platform for the Autofill server URL.
The URL to use to make autofill requests is now configured by the
platform. Add a JNI call to retrieve it.
See also frameworks/base change I0aa85c5bef834b1120baaabdc2dd2e4e607a63b6
Bug: 4515820
Change-Id: I3a22ae42402f52207eee2d0d9df64700cb7c9f45
Diffstat (limited to 'android')
-rw-r--r-- | android/jni/autofill_request_url.cc | 22 | ||||
-rw-r--r-- | android/jni/autofill_request_url.h | 22 |
2 files changed, 44 insertions, 0 deletions
diff --git a/android/jni/autofill_request_url.cc b/android/jni/autofill_request_url.cc new file mode 100644 index 0000000..e272798 --- /dev/null +++ b/android/jni/autofill_request_url.cc @@ -0,0 +1,22 @@ +// Copyright (c) 2011 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. + +#include "android/jni/autofill_request_url.h" +#include "android/jni/jni_utils.h" + +namespace android { + +std::string AutofillRequestUrl::GetQueryUrl() { + JNIEnv* env = android::GetJNIEnv(); + jclass bridgeClass = env->FindClass("android/webkit/JniUtil"); + jmethodID method = env->GetStaticMethodID(bridgeClass, "getAutofillQueryUrl", "()Ljava/lang/String;"); + jstring autofill_query_url = static_cast<jstring>(env->CallStaticObjectMethod(bridgeClass, method)); + std::string request_url = android::JstringToStdString(env, autofill_query_url); + env->DeleteLocalRef(autofill_query_url); + env->DeleteLocalRef(bridgeClass); + + return request_url; +} + +} // namespace android diff --git a/android/jni/autofill_request_url.h b/android/jni/autofill_request_url.h new file mode 100644 index 0000000..56cc4b2 --- /dev/null +++ b/android/jni/autofill_request_url.h @@ -0,0 +1,22 @@ +// Copyright (c) 2011 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 ANDROID_JNI_AUTOFILLREQUESTURL_H +#define ANDROID_JNI_AUTOFILLREQUESTURL_H + +#include "base/basictypes.h" +#include <string> + +namespace android { + +class AutofillRequestUrl { + public: + static std::string GetQueryUrl(); + private: + DISALLOW_IMPLICIT_CONSTRUCTORS(AutofillRequestUrl); +}; + +} // namespace android + +#endif |