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

Side by Side Diff: components/web_restrictions/browser/web_restrictions_client_result.cc

Issue 1890203002: Implement Web Restrictions in WebView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 unified diff | Download patch
OLDNEW
(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_restictions_client_result.h"
7 #include "jni/WebRestrictionsClientResult_jni.h"
8
9 namespace web_restrictions {
10
11 WebRestrictionsClientResult::WebRestrictionsClientResult() {}
12
13 WebRestrictionsClientResult::WebRestrictionsClientResult(
14 base::android::ScopedJavaGlobalRef<jobject>& jresult)
15 : jresult_(jresult) {}
16
17 int WebRestrictionsClientResult::GetInt(int column) const {
18 return Java_WebRestrictionsClientResult_getInt(
19 base::android::AttachCurrentThread(), jresult_.obj(), column);
20 }
21
22 std::string WebRestrictionsClientResult::GetString(int column) const {
23 JNIEnv* env = base::android::AttachCurrentThread();
24 return base::android::ConvertJavaStringToUTF8(
25 env,
26 Java_WebRestrictionsClientResult_getString(env, jresult_.obj(), column));
27 }
28
29 std::string WebRestrictionsClientResult::GetColumnName(int column) const {
30 JNIEnv* env = base::android::AttachCurrentThread();
31 return base::android::ConvertJavaStringToUTF8(
32 env, Java_WebRestrictionsClientResult_getColumnName(env, jresult_.obj(),
33 column));
34 }
35
36 bool WebRestrictionsClientResult::ShouldProceed() const {
37 return Java_WebRestrictionsClientResult_shouldProceed(
38 base::android::AttachCurrentThread(), jresult_.obj());
39 }
40
41 int web_restrictions::WebRestrictionsClientResult::GetColumnCount() const {
42 return Java_WebRestrictionsClientResult_getColumnCount(
43 base::android::AttachCurrentThread(), jresult_.obj());
44 }
45
46 bool web_restrictions::WebRestrictionsClientResult::IsString(int column) const {
47 return Java_WebRestrictionsClientResult_isString(
48 base::android::AttachCurrentThread(), jresult_.obj(), column);
49 }
50
51 bool WebRestrictionsClientResult::Register(JNIEnv* env) { // static
52 return RegisterNativesImpl(env);
53 }
54
55 } // namespace web_restrictions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698