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

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwResource.java

Issue 155653003: [Android WebView] Add AwResource.setResources() and setErrorPageResources(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 10 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
« no previous file with comments | « no previous file | android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellResourceProvider.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/java/src/org/chromium/android_webview/AwResource.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwResource.java b/android_webview/java/src/org/chromium/android_webview/AwResource.java
index 829f243b11a4c3f60f88b1a4ad29f4d0c90c1dc7..7051acbcd4dbcfa787c4040a88085b24e8d5d9fe 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwResource.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwResource.java
@@ -17,6 +17,10 @@ import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Scanner;
+/**
+ * A class that defines a set of resource IDs and functionality to resolve
+ * those IDs to concrete resources.
+ */
@JNINamespace("android_webview::AwResource")
public class AwResource {
// The following resource ID's must be initialized by the embedder.
@@ -47,6 +51,15 @@ public class AwResource {
sResourceCache = new HashMap<Integer, SoftReference<String> >();
}
+ public static void setErrorPageResources(int loaderror, int nodomain) {
+ RAW_LOAD_ERROR = loaderror;
+ RAW_NO_DOMAIN = nodomain;
+ }
+
+ public static void setDefaultTextEncoding(int encoding) {
+ STRING_DEFAULT_TEXT_ENCODING = encoding;
+ }
+
@CalledByNative
public static String getDefaultTextEncoding() {
return getResource(STRING_DEFAULT_TEXT_ENCODING, TYPE_STRING);
@@ -109,6 +122,7 @@ public class AwResource {
isr.close();
}
} catch (IOException e) {
+ // Nothing to do if close() fails.
}
}
return result;
« no previous file with comments | « no previous file | android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellResourceProvider.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698