Chromium Code Reviews| Index: ui/android/java/src/org/chromium/ui/resources/ResourceManager.java |
| diff --git a/ui/android/java/src/org/chromium/ui/resources/ResourceManager.java b/ui/android/java/src/org/chromium/ui/resources/ResourceManager.java |
| index d58bddacddde6f35bddbf11b20a3bcb6470034b3..293b8c5f29110ca12cbd2f5ab29060d55374e77b 100644 |
| --- a/ui/android/java/src/org/chromium/ui/resources/ResourceManager.java |
| +++ b/ui/android/java/src/org/chromium/ui/resources/ResourceManager.java |
| @@ -12,6 +12,7 @@ import android.util.SparseArray; |
| import org.chromium.base.annotations.CalledByNative; |
| import org.chromium.base.annotations.JNINamespace; |
| +import org.chromium.ui.base.WindowAndroid; |
| import org.chromium.ui.resources.ResourceLoader.ResourceLoaderCallback; |
| import org.chromium.ui.resources.dynamics.DynamicResource; |
| import org.chromium.ui.resources.dynamics.DynamicResourceLoader; |
| @@ -51,12 +52,25 @@ public class ResourceManager implements ResourceLoaderCallback { |
| /** |
| * Creates an instance of a {@link ResourceManager}. This will |
| + * @param windowAndroid A {@link WindowAndroid} instance to fetch a {@link Context} |
| + * from which we can use to grab {@link Resources} from. |
| + * @param staticResourceManagerPtr A pointer to the native component of this class. |
| + * @return A new instance of a {@link ResourceManager}. |
| + */ |
| + @CalledByNative |
| + private static ResourceManager create( |
| + WindowAndroid windowAndroid, long staticResourceManagerPtr) { |
|
jdduke (slow)
2015/10/23 16:47:27
It's not really clear why we need both of these me
gsennton
2015/10/23 17:01:06
Right, so if we use the getter from the java side
boliu
2015/10/23 17:06:33
Hmm, looks like native getter is better in this ca
|
| + return new ResourceManager(windowAndroid.getDisplayContext(), staticResourceManagerPtr); |
| + } |
| + |
| + /** |
| + * Creates an instance of a {@link ResourceManager}. This will |
| * @param context A {@link Context} instance to grab {@link Resources} from. |
| * @param staticResourceManagerPtr A pointer to the native component of this class. |
| * @return A new instance of a {@link ResourceManager}. |
| */ |
| @CalledByNative |
| - private static ResourceManager create(Context context, long staticResourceManagerPtr) { |
| + private static ResourceManager createForTests(Context context, long staticResourceManagerPtr) { |
| return new ResourceManager(context, staticResourceManagerPtr); |
| } |