| Index: components/web_restrictions/browser/web_restrictions_client_result.cc
|
| diff --git a/components/web_restrictions/browser/web_restrictions_client_result.cc b/components/web_restrictions/browser/web_restrictions_client_result.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..59077acff03ad6982fee777babbc3205d693fe6f
|
| --- /dev/null
|
| +++ b/components/web_restrictions/browser/web_restrictions_client_result.cc
|
| @@ -0,0 +1,55 @@
|
| +// Copyright 2016 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 "base/android/jni_string.h"
|
| +#include "components/web_restrictions/browser/web_restictions_client_result.h"
|
| +#include "jni/WebRestrictionsClientResult_jni.h"
|
| +
|
| +namespace web_restrictions {
|
| +
|
| +WebRestrictionsClientResult::WebRestrictionsClientResult() {}
|
| +
|
| +WebRestrictionsClientResult::WebRestrictionsClientResult(
|
| + base::android::ScopedJavaGlobalRef<jobject>& jresult)
|
| + : jresult_(jresult) {}
|
| +
|
| +int WebRestrictionsClientResult::GetInt(int column) const {
|
| + return Java_WebRestrictionsClientResult_getInt(
|
| + base::android::AttachCurrentThread(), jresult_.obj(), column);
|
| +}
|
| +
|
| +std::string WebRestrictionsClientResult::GetString(int column) const {
|
| + JNIEnv* env = base::android::AttachCurrentThread();
|
| + return base::android::ConvertJavaStringToUTF8(
|
| + env,
|
| + Java_WebRestrictionsClientResult_getString(env, jresult_.obj(), column));
|
| +}
|
| +
|
| +std::string WebRestrictionsClientResult::GetColumnName(int column) const {
|
| + JNIEnv* env = base::android::AttachCurrentThread();
|
| + return base::android::ConvertJavaStringToUTF8(
|
| + env, Java_WebRestrictionsClientResult_getColumnName(env, jresult_.obj(),
|
| + column));
|
| +}
|
| +
|
| +bool WebRestrictionsClientResult::ShouldProceed() const {
|
| + return Java_WebRestrictionsClientResult_shouldProceed(
|
| + base::android::AttachCurrentThread(), jresult_.obj());
|
| +}
|
| +
|
| +int web_restrictions::WebRestrictionsClientResult::GetColumnCount() const {
|
| + return Java_WebRestrictionsClientResult_getColumnCount(
|
| + base::android::AttachCurrentThread(), jresult_.obj());
|
| +}
|
| +
|
| +bool web_restrictions::WebRestrictionsClientResult::IsString(int column) const {
|
| + return Java_WebRestrictionsClientResult_isString(
|
| + base::android::AttachCurrentThread(), jresult_.obj(), column);
|
| +}
|
| +
|
| +bool WebRestrictionsClientResult::Register(JNIEnv* env) { // static
|
| + return RegisterNativesImpl(env);
|
| +}
|
| +
|
| +} // namespace web_restrictions
|
|
|