OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_BROWSER_ANDROID_RESOURCE_MANAGER_H_ | |
6 #define CONTENT_BROWSER_ANDROID_RESOURCE_MANAGER_H_ | |
7 | |
8 #include <android/bitmap.h> | |
jdduke (slow)
2014/11/19 00:09:16
Can we get away with not including these headers?
Jaekyun Seok (inactive)
2014/11/19 02:41:38
Done.
| |
9 #include <jni.h> | |
10 #include "base/android/jni_android.h" | |
11 #include "base/id_map.h" | |
jdduke (slow)
2014/11/19 00:09:16
id_map.h looks unused.
Jaekyun Seok (inactive)
2014/11/19 02:41:38
Done.
| |
12 #include "cc/resources/ui_resource_client.h" | |
13 #include "content/common/content_export.h" | |
14 #include "content/public/browser/android/ui_resource_android.h" | |
jdduke (slow)
2014/11/19 00:09:16
Also, UIResourceAndroid is forward declared, so do
Jaekyun Seok (inactive)
2014/11/19 02:41:38
Done.
| |
15 #include "third_party/skia/include/core/SkBitmap.h" | |
jdduke (slow)
2014/11/19 00:09:16
I don't see SkBitmap used here.
Jaekyun Seok (inactive)
2014/11/19 02:41:38
Done.
| |
16 #include "ui/gfx/geometry/insets_f.h" | |
17 #include "ui/gfx/geometry/rect.h" | |
18 | |
19 namespace content { | |
20 | |
21 class UIResourceAndroid; | |
22 | |
23 // A Java counterpart will be generated for this enum. | |
24 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.content_public.resources | |
25 enum ResourceKind { | |
26 RESOURCE_KIND_STATIC = 0, | |
27 RESOURCE_KIND_DYNAMIC, | |
28 RESOURCE_KIND_DYNAMIC_BITMAP, | |
29 RESOURCE_KIND_SYSTEM, | |
30 | |
31 RESOURCE_KIND_COUNT, | |
32 RESOURCE_KIND_FIRST = RESOURCE_KIND_STATIC, | |
33 RESOURCE_KIND_LAST = RESOURCE_KIND_SYSTEM, | |
34 }; | |
35 | |
36 class CONTENT_EXPORT ResourceManager { | |
37 public: | |
38 struct Resource { | |
39 public: | |
40 Resource(); | |
41 ~Resource(); | |
42 gfx::Rect Border(const gfx::Size& bounds); | |
43 gfx::Rect Border(const gfx::Size& bounds, const gfx::InsetsF& scale); | |
44 | |
45 scoped_ptr<UIResourceAndroid> ui_resource; | |
46 gfx::Size size; | |
47 gfx::Rect padding; | |
48 gfx::Rect aperture; | |
49 }; | |
50 | |
51 virtual ~ResourceManager() {} | |
52 | |
53 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject( | |
54 JNIEnv* env) = 0; | |
55 | |
56 virtual ResourceManager::Resource* GetResource(ResourceKind res_type, | |
57 int res_id) = 0; | |
58 virtual void PreloadResource(ResourceKind res_type, int res_id) = 0; | |
59 }; | |
60 | |
61 } // namespace content | |
62 | |
63 #endif // CONTENT_BROWSER_ANDROID_RESOURCE_MANAGER_H_ | |
OLD | NEW |