Chromium Code Reviews| 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..9d0fcb1610c6211375b9345b5e9bed47af0fb837 |
| --- /dev/null |
| +++ b/content/browser/android/resource_manager_impl.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_IMPL_H_ |
| +#define CONTENT_BROWSER_ANDROID_RESOURCE_MANAGER_IMPL_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" |
|
jdduke (slow)
2014/11/19 18:26:48
Looks like both gfx::Rect and SkBitmap are unused
Jaekyun Seok (inactive)
2014/11/21 12:35:33
Done.
|
| +#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); |
|
jdduke (slow)
2014/11/19 18:26:48
Nit: explicit.
Jaekyun Seok (inactive)
2014/11/21 12:35:33
Done.
|
| + virtual ~ResourceManagerImpl() override; |
| + |
| + base::android::ScopedJavaLocalRef<jobject> GetJavaObject( |
| + JNIEnv* env) override; |
| + |
| + ResourceManager::Resource* GetResource(AndroidResourceType res_type, |
| + int res_id) override; |
| + void PreloadResource(AndroidResourceType 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_[ANDROID_RESOURCE_TYPE_COUNT]; |
| + |
| + base::android::ScopedJavaGlobalRef<jobject> java_obj_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ResourceManagerImpl); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_BROWSER_ANDROID_RESOURCE_MANAGER_IMPL_H_ |