Index: content/browser/android/resource_manager_impl.h |
diff --git a/content/browser/android/resource_manager_impl.h b/content/browser/android/resource_manager_impl.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f3371d683b40e6e109ed0bb704ffddd67d6b7c4b |
--- /dev/null |
+++ b/content/browser/android/resource_manager_impl.h |
@@ -0,0 +1,66 @@ |
+// 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. |
+ |
+#ifndef CONTENT_BROWSER_ANDROID_RESOURCE_MANAGER_IMPL_H_ |
+#define CONTENT_BROWSER_ANDROID_RESOURCE_MANAGER_IMPL_H_ |
+ |
+#include <android/bitmap.h> |
+#include <jni.h> |
+#include "base/android/jni_android.h" |
+#include "base/id_map.h" |
+#include "cc/resources/ui_resource_client.h" |
+#include "content/public/browser/android/resource_manager.h" |
+#include "third_party/skia/include/core/SkBitmap.h" |
+#include "ui/gfx/geometry/insets_f.h" |
+#include "ui/gfx/geometry/rect.h" |
+ |
+namespace content { |
+ |
+class UIResourceProvider; |
+ |
+class ResourceManagerImpl : public ResourceManager { |
+ public: |
+ static ResourceManagerImpl* FromJavaObject(jobject jobj); |
+ |
+ ResourceManagerImpl(UIResourceProvider* ui_resource_provider); |
+ virtual ~ResourceManagerImpl(); |
jdduke (slow)
2014/11/19 00:09:15
Nit: ~ResourceManagerImpl() override;
Jaekyun Seok (inactive)
2014/11/19 02:41:37
Done.
|
+ |
+ base::android::ScopedJavaLocalRef<jobject> GetJavaObject( |
+ JNIEnv* env) override; |
+ |
+ ResourceManager::Resource* GetResource(ResourceKind res_type, |
+ int res_id) override; |
+ void PreloadResource(ResourceKind res_type, int res_id) override; |
+ |
+ // Called from Java ---------------------------------------------------------- |
+ void OnResourceReady(JNIEnv* env, |
+ jobject jobj, |
+ jint res_type, |
+ jint res_id, |
+ jobject bitmap, |
+ jint padding_left, |
+ jint padding_top, |
+ jint padding_right, |
+ jint padding_bottom, |
+ jint aperture_left, |
+ jint aperture_top, |
+ jint aperture_right, |
+ jint aperture_bottom); |
+ |
+ static bool RegisterResourceManager(JNIEnv* env); |
+ |
+ private: |
+ typedef IDMap<Resource, IDMapOwnPointer> ResourceMap; |
+ |
+ content::UIResourceProvider* ui_resource_provider_; |
+ ResourceMap resources_[RESOURCE_KIND_COUNT]; |
+ |
+ base::android::ScopedJavaGlobalRef<jobject> java_obj_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ResourceManagerImpl); |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_BROWSER_ANDROID_RESOURCE_MANAGER_IMPL_H_ |