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

Unified Diff: components/web_restrictions/browser/java/src/org/chromium/components/webrestrictions/browser/WebRestrictionsContentProvider.java

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 side-by-side diff with in-line comments
Download patch
Index: components/web_restrictions/browser/java/src/org/chromium/components/webrestrictions/browser/WebRestrictionsContentProvider.java
diff --git a/components/web_restrictions/browser/java/src/org/chromium/components/webrestrictions/WebRestrictionsContentProvider.java b/components/web_restrictions/browser/java/src/org/chromium/components/webrestrictions/browser/WebRestrictionsContentProvider.java
similarity index 95%
rename from components/web_restrictions/browser/java/src/org/chromium/components/webrestrictions/WebRestrictionsContentProvider.java
rename to components/web_restrictions/browser/java/src/org/chromium/components/webrestrictions/browser/WebRestrictionsContentProvider.java
index 869ff7220d53cae90cc139e8fc3f8009d915b94c..963c221413508b80794466013a3d1b0641b1d265 100644
--- a/components/web_restrictions/browser/java/src/org/chromium/components/webrestrictions/WebRestrictionsContentProvider.java
+++ b/components/web_restrictions/browser/java/src/org/chromium/components/webrestrictions/browser/WebRestrictionsContentProvider.java
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-package org.chromium.components.webrestrictions;
+package org.chromium.components.webrestrictions.browser;
import android.content.ContentProvider;
import android.content.ContentValues;
@@ -42,8 +42,8 @@ public abstract class WebRestrictionsContentProvider extends ContentProvider {
private final int mErrorInts[];
private final String mErrorStrings[];
- public WebRestrictionsResult(boolean shouldProceed, final int[] errorInts,
- final String[] errorStrings) {
+ public WebRestrictionsResult(
+ boolean shouldProceed, final int[] errorInts, final String[] errorStrings) {
assert !shouldProceed || errorInts == null;
assert !shouldProceed || errorStrings == null;
mShouldProceed = shouldProceed;
@@ -145,11 +145,16 @@ public abstract class WebRestrictionsContentProvider extends ContentProvider {
@Override
public short getShort(int column) {
- return 0;
+ return (short) getLong(column);
}
@Override
public int getInt(int column) {
+ return (int) getLong(column);
+ }
+
+ @Override
+ public long getLong(int column) {
if (column == 0) return result.shouldProceed() ? PROCEED : BLOCKED;
// The column order is:
// result,
@@ -164,11 +169,6 @@ public abstract class WebRestrictionsContentProvider extends ContentProvider {
}
@Override
- public long getLong(int column) {
- return 0;
- }
-
- @Override
public float getFloat(int column) {
return 0;
}
@@ -191,6 +191,11 @@ public abstract class WebRestrictionsContentProvider extends ContentProvider {
}
return FIELD_TYPE_NULL;
}
+
+ @Override
+ public int getColumnCount() {
+ return result.errorIntCount() + result.errorStringCount() + 1;
+ }
};
}

Powered by Google App Engine
This is Rietveld 408576698