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

Unified 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 side-by-side diff with in-line comments
Download patch
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..6eab3d5beb9d761a25531aae5edca3262e069a55
--- /dev/null
+++ b/components/web_restrictions/browser/web_restrictions_client_result.cc
@@ -0,0 +1,54 @@
+// 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_restrictions_client_result.h"
+#include "jni/WebRestrictionsClientResult_jni.h"
+
+namespace web_restrictions {
+
+WebRestrictionsClientResult::WebRestrictionsClientResult(
+ base::android::ScopedJavaGlobalRef<jobject>& jresult)
+ : jresult_(jresult) {}
+
+WebRestrictionsClientResult::~WebRestrictionsClientResult() = default;
+
+WebRestrictionsClientResult::WebRestrictionsClientResult(
+ const WebRestrictionsClientResult& other) = default;
+
+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);
+}
+
+} // namespace web_restrictions

Powered by Google App Engine
This is Rietveld 408576698