OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "base/android/jni_string.h" |
| 6 #include "components/web_restrictions/browser/web_restrictions_client_result.h" |
| 7 #include "jni/WebRestrictionsClientResult_jni.h" |
| 8 |
| 9 namespace web_restrictions { |
| 10 |
| 11 WebRestrictionsClientResult::WebRestrictionsClientResult( |
| 12 base::android::ScopedJavaGlobalRef<jobject>& jresult) |
| 13 : jresult_(jresult) {} |
| 14 |
| 15 WebRestrictionsClientResult::~WebRestrictionsClientResult() = default; |
| 16 |
| 17 WebRestrictionsClientResult::WebRestrictionsClientResult( |
| 18 const WebRestrictionsClientResult& other) = default; |
| 19 |
| 20 int WebRestrictionsClientResult::GetInt(int column) const { |
| 21 return Java_WebRestrictionsClientResult_getInt( |
| 22 base::android::AttachCurrentThread(), jresult_.obj(), column); |
| 23 } |
| 24 |
| 25 std::string WebRestrictionsClientResult::GetString(int column) const { |
| 26 JNIEnv* env = base::android::AttachCurrentThread(); |
| 27 return base::android::ConvertJavaStringToUTF8( |
| 28 env, |
| 29 Java_WebRestrictionsClientResult_getString(env, jresult_.obj(), column)); |
| 30 } |
| 31 |
| 32 std::string WebRestrictionsClientResult::GetColumnName(int column) const { |
| 33 JNIEnv* env = base::android::AttachCurrentThread(); |
| 34 return base::android::ConvertJavaStringToUTF8( |
| 35 env, Java_WebRestrictionsClientResult_getColumnName(env, jresult_.obj(), |
| 36 column)); |
| 37 } |
| 38 |
| 39 bool WebRestrictionsClientResult::ShouldProceed() const { |
| 40 return Java_WebRestrictionsClientResult_shouldProceed( |
| 41 base::android::AttachCurrentThread(), jresult_.obj()); |
| 42 } |
| 43 |
| 44 int web_restrictions::WebRestrictionsClientResult::GetColumnCount() const { |
| 45 return Java_WebRestrictionsClientResult_getColumnCount( |
| 46 base::android::AttachCurrentThread(), jresult_.obj()); |
| 47 } |
| 48 |
| 49 bool web_restrictions::WebRestrictionsClientResult::IsString(int column) const { |
| 50 return Java_WebRestrictionsClientResult_isString( |
| 51 base::android::AttachCurrentThread(), jresult_.obj(), column); |
| 52 } |
| 53 |
| 54 } // namespace web_restrictions |
OLD | NEW |