Chromium Code Reviews| 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..93c390461efadf4e7bad7c8220bb35c1ff703943 |
| --- /dev/null |
| +++ b/content/public/browser/android/resource_manager.h |
| @@ -0,0 +1,57 @@ |
| +// 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 "base/android/jni_android.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "content/common/content_export.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 AndroidResourceType { |
| + ANDROID_RESOURCE_TYPE_STATIC = 0, |
| + ANDROID_RESOURCE_TYPE_DYNAMIC, |
| + ANDROID_RESOURCE_TYPE_DYNAMIC_BITMAP, |
| + ANDROID_RESOURCE_TYPE_SYSTEM, |
| + |
| + ANDROID_RESOURCE_TYPE_COUNT, |
| + ANDROID_RESOURCE_TYPE_FIRST = ANDROID_RESOURCE_TYPE_STATIC, |
| + ANDROID_RESOURCE_TYPE_LAST = ANDROID_RESOURCE_TYPE_SYSTEM, |
| +}; |
| + |
| +class CONTENT_EXPORT ResourceManager { |
| + public: |
| + struct Resource { |
| + public: |
| + Resource(); |
| + ~Resource(); |
| + 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
|
| + 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(AndroidResourceType res_type, |
| + int res_id) = 0; |
| + virtual void PreloadResource(AndroidResourceType res_type, int res_id) = 0; |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_BROWSER_ANDROID_RESOURCE_MANAGER_H_ |