Index: content/public/browser/android/resource_manager.h |
diff --git a/content/public/browser/android/resource_manager.h b/content/public/browser/android/resource_manager.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f842511382d24573cce44f95f1023f517168cb51 |
--- /dev/null |
+++ b/content/public/browser/android/resource_manager.h |
@@ -0,0 +1,63 @@ |
+// 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_H_ |
+#define CONTENT_BROWSER_ANDROID_RESOURCE_MANAGER_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/common/content_export.h" |
+#include "content/public/browser/android/ui_resource_android.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 UIResourceAndroid; |
+ |
+// A Java counterpart will be generated for this enum. |
+// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.content_public.resources |
+enum ResourceKind { |
David Trainor- moved to gerrit
2014/11/18 18:53:53
Why use Kind instead of Type?
Jaekyun Seok (inactive)
2014/11/18 23:34:02
Because ResourceType is already being used in http
David Trainor- moved to gerrit
2014/11/19 00:47:53
Ah good point! Can we use ANDROID_RESOURCE_TYPE t
Jaekyun Seok (inactive)
2014/11/19 02:41:37
Done.
|
+ RESOURCE_KIND_STATIC = 0, |
+ RESOURCE_KIND_DYNAMIC, |
+ RESOURCE_KIND_DYNAMIC_BITMAP, |
+ RESOURCE_KIND_SYSTEM, |
+ |
+ RESOURCE_KIND_COUNT, |
+ RESOURCE_KIND_FIRST = RESOURCE_KIND_STATIC, |
+ RESOURCE_KIND_LAST = RESOURCE_KIND_SYSTEM, |
+}; |
+ |
+class CONTENT_EXPORT ResourceManager { |
+ public: |
+ struct Resource { |
+ public: |
+ Resource(); |
+ ~Resource(); |
+ gfx::Rect Border(const gfx::Size& bounds); |
+ gfx::Rect Border(const gfx::Size& bounds, const gfx::InsetsF& scale); |
+ |
+ scoped_ptr<UIResourceAndroid> ui_resource; |
+ gfx::Size size; |
+ gfx::Rect padding; |
+ gfx::Rect aperture; |
+ }; |
+ |
+ virtual ~ResourceManager() {} |
+ |
+ virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject( |
+ JNIEnv* env) = 0; |
+ |
+ virtual ResourceManager::Resource* GetResource(ResourceKind res_type, |
+ int res_id) = 0; |
+ virtual void PreloadResource(ResourceKind res_type, int res_id) = 0; |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_BROWSER_ANDROID_RESOURCE_MANAGER_H_ |