Chromium Code Reviews| 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 "base/android/jni_android.h" | |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "content/common/content_export.h" | |
| 11 #include "ui/gfx/geometry/rect.h" | |
| 12 | |
| 13 namespace content { | |
| 14 | |
| 15 class UIResourceAndroid; | |
| 16 | |
| 17 // A Java counterpart will be generated for this enum. | |
| 18 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.content_public.resources | |
| 19 enum AndroidResourceType { | |
| 20 ANDROID_RESOURCE_TYPE_STATIC = 0, | |
| 21 ANDROID_RESOURCE_TYPE_DYNAMIC, | |
| 22 ANDROID_RESOURCE_TYPE_DYNAMIC_BITMAP, | |
| 23 ANDROID_RESOURCE_TYPE_SYSTEM, | |
| 24 | |
| 25 ANDROID_RESOURCE_TYPE_COUNT, | |
| 26 ANDROID_RESOURCE_TYPE_FIRST = ANDROID_RESOURCE_TYPE_STATIC, | |
| 27 ANDROID_RESOURCE_TYPE_LAST = ANDROID_RESOURCE_TYPE_SYSTEM, | |
| 28 }; | |
| 29 | |
| 30 class CONTENT_EXPORT ResourceManager { | |
| 31 public: | |
| 32 struct Resource { | |
| 33 public: | |
| 34 Resource(); | |
| 35 ~Resource(); | |
| 36 gfx::Rect Border(const gfx::Size& bounds); | |
|
jdduke (slow)
2014/11/19 18:26:48
Hmm, it's a little odd to declare this here, but d
Jaekyun Seok (inactive)
2014/11/21 12:35:33
These functions are being called from outside of R
| |
| 37 gfx::Rect Border(const gfx::Size& bounds, const gfx::InsetsF& scale); | |
| 38 | |
| 39 scoped_ptr<UIResourceAndroid> ui_resource; | |
| 40 gfx::Size size; | |
| 41 gfx::Rect padding; | |
| 42 gfx::Rect aperture; | |
| 43 }; | |
| 44 | |
| 45 virtual ~ResourceManager() {} | |
| 46 | |
| 47 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject( | |
| 48 JNIEnv* env) = 0; | |
| 49 | |
| 50 virtual ResourceManager::Resource* GetResource(AndroidResourceType res_type, | |
| 51 int res_id) = 0; | |
| 52 virtual void PreloadResource(AndroidResourceType res_type, int res_id) = 0; | |
| 53 }; | |
| 54 | |
| 55 } // namespace content | |
| 56 | |
| 57 #endif // CONTENT_BROWSER_ANDROID_RESOURCE_MANAGER_H_ | |
| OLD | NEW |