Index: ui/android/resources/resource_manager.h |
diff --git a/ui/android/resources/resource_manager.h b/ui/android/resources/resource_manager.h |
index 730d4dc5afcf594d58527a768207bc3c249c3fea..c11e0580e955eb833058f74aa29bfb20c437974a 100644 |
--- a/ui/android/resources/resource_manager.h |
+++ b/ui/android/resources/resource_manager.h |
@@ -5,19 +5,19 @@ |
#ifndef UI_ANDROID_RESOURCES_RESOURCE_MANAGER_H_ |
#define UI_ANDROID_RESOURCES_RESOURCE_MANAGER_H_ |
+#include <string> |
+ |
#include "base/android/jni_android.h" |
#include "base/id_map.h" |
#include "cc/resources/ui_resource_client.h" |
#include "ui/android/ui_android_export.h" |
+#include "ui/base/android/system_ui_resource_type.h" |
#include "ui/gfx/geometry/rect.h" |
-namespace content { |
-class UIResourceProvider; |
-} |
- |
namespace ui { |
class UIResourceAndroid; |
+class UIResourceProvider; |
// A Java counterpart will be generated for this enum. |
// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.ui.resources |
@@ -32,6 +32,7 @@ enum AndroidResourceType { |
ANDROID_RESOURCE_TYPE_LAST = ANDROID_RESOURCE_TYPE_SYSTEM, |
}; |
+// TODO(jdduke): Make ResourceManager a pure interface, crbug/426939. |
class UI_ANDROID_EXPORT ResourceManager { |
public: |
struct Resource { |
@@ -49,14 +50,16 @@ class UI_ANDROID_EXPORT ResourceManager { |
static ResourceManager* FromJavaObject(jobject jobj); |
- explicit ResourceManager(content::UIResourceProvider* ui_resource_provider); |
+ explicit ResourceManager(ui::UIResourceProvider* ui_resource_provider); |
virtual ~ResourceManager(); |
base::android::ScopedJavaLocalRef<jobject> GetJavaObject(JNIEnv* env); |
+ virtual cc::UIResourceId GetUIResourceId(AndroidResourceType res_type, |
+ int res_id); |
ResourceManager::Resource* GetResource(AndroidResourceType res_type, |
int res_id); |
- void PreloadResource(AndroidResourceType res_type, int res_id); |
+ virtual void PreloadResource(AndroidResourceType res_type, int res_id); |
// Called from Java ---------------------------------------------------------- |
void OnResourceReady(JNIEnv* env, |
@@ -76,9 +79,17 @@ class UI_ANDROID_EXPORT ResourceManager { |
static bool RegisterResourceManager(JNIEnv* env); |
private: |
+ friend class TestResourceManager; |
+ |
+ // Start loading the resource. virtual for testing. |
+ virtual void PreloadResourceFromJava(AndroidResourceType res_type, |
+ int res_id); |
+ virtual void RequestResourceFromJava(AndroidResourceType res_type, |
+ int res_id); |
+ |
typedef IDMap<Resource, IDMapOwnPointer> ResourceMap; |
- content::UIResourceProvider* ui_resource_provider_; |
+ ui::UIResourceProvider* ui_resource_provider_; |
ResourceMap resources_[ANDROID_RESOURCE_TYPE_COUNT]; |
base::android::ScopedJavaGlobalRef<jobject> java_obj_; |