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

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: Fix final nits Created 4 years, 4 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_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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698