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

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: Respond to comments, and fix a possible race in displaying error page Created 4 years, 7 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 int WebRestrictionsClientResult::GetInt(int column) const {
16 return Java_WebRestrictionsClientResult_getInt(
17 base::android::AttachCurrentThread(), jresult_.obj(), column);
18 }
19
20 std::string WebRestrictionsClientResult::GetString(int column) const {
21 JNIEnv* env = base::android::AttachCurrentThread();
22 return base::android::ConvertJavaStringToUTF8(
23 env,
24 Java_WebRestrictionsClientResult_getString(env, jresult_.obj(), column));
25 }
26
27 std::string WebRestrictionsClientResult::GetColumnName(int column) const {
28 JNIEnv* env = base::android::AttachCurrentThread();
29 return base::android::ConvertJavaStringToUTF8(
30 env, Java_WebRestrictionsClientResult_getColumnName(env, jresult_.obj(),
31 column));
32 }
33
34 bool WebRestrictionsClientResult::ShouldProceed() const {
35 return Java_WebRestrictionsClientResult_shouldProceed(
36 base::android::AttachCurrentThread(), jresult_.obj());
37 }
38
39 int web_restrictions::WebRestrictionsClientResult::GetColumnCount() const {
40 return Java_WebRestrictionsClientResult_getColumnCount(
41 base::android::AttachCurrentThread(), jresult_.obj());
42 }
43
44 bool web_restrictions::WebRestrictionsClientResult::IsString(int column) const {
45 return Java_WebRestrictionsClientResult_isString(
46 base::android::AttachCurrentThread(), jresult_.obj(), column);
47 }
48
49 bool WebRestrictionsClientResult::Register(JNIEnv* env) { // static
50 return RegisterNativesImpl(env);
51 }
52
53 } // namespace web_restrictions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698