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

Unified Diff: ui/android/java/src/org/chromium/ui/resources/statics/StaticResourceLoader.java

Issue 731133002: Upstream ResourceManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename namespace Created 6 years, 1 month 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: ui/android/java/src/org/chromium/ui/resources/statics/StaticResourceLoader.java
diff --git a/ui/android/java/src/org/chromium/ui/resources/statics/StaticResourceLoader.java b/ui/android/java/src/org/chromium/ui/resources/statics/StaticResourceLoader.java
new file mode 100644
index 0000000000000000000000000000000000000000..3444188f4da9d0b4fa4a0d9449b0c4dd7e715e7c
--- /dev/null
+++ b/ui/android/java/src/org/chromium/ui/resources/statics/StaticResourceLoader.java
@@ -0,0 +1,32 @@
+// Copyright 2014 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.
+
+package org.chromium.ui.resources.statics;
+
+import android.content.res.Resources;
+
+import org.chromium.ui.resources.Resource;
+import org.chromium.ui.resources.async.AsyncPreloadResourceLoader;
+
+/**
+ * Handles loading Android resources from disk asynchronously and synchronously.
+ */
+public class StaticResourceLoader extends AsyncPreloadResourceLoader {
+ /**
+ * Creates a {@link StaticResourceLoader}.
+ * @param resourceType The resource type this loader is responsible for loading.
+ * @param callback The {@link ResourceLoaderCallback} to notify when a {@link Resource} is
+ * done loading.
+ * @param resources The {@link Resources} instance to load Android resources from.
+ */
+ public StaticResourceLoader(int resourceType, ResourceLoaderCallback callback,
+ final Resources resources) {
+ super(resourceType, callback, new ResourceCreator() {
+ @Override
+ public Resource create(int resId) {
+ return StaticResource.create(resources, resId, 0, 0);
+ }
+ });
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698