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_IMPL_H_ | |
| 6 #define CONTENT_BROWSER_ANDROID_RESOURCE_MANAGER_IMPL_H_ | |
| 7 | |
| 8 #include "base/android/jni_android.h" | |
| 9 #include "base/id_map.h" | |
| 10 #include "cc/resources/ui_resource_client.h" | |
| 11 #include "content/public/browser/android/resource_manager.h" | |
| 12 #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.
| |
| 13 #include "ui/gfx/geometry/rect.h" | |
| 14 | |
| 15 namespace content { | |
| 16 | |
| 17 class UIResourceProvider; | |
| 18 | |
| 19 class ResourceManagerImpl : public ResourceManager { | |
| 20 public: | |
| 21 static ResourceManagerImpl* FromJavaObject(jobject jobj); | |
| 22 | |
| 23 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.
| |
| 24 virtual ~ResourceManagerImpl() override; | |
| 25 | |
| 26 base::android::ScopedJavaLocalRef<jobject> GetJavaObject( | |
| 27 JNIEnv* env) override; | |
| 28 | |
| 29 ResourceManager::Resource* GetResource(AndroidResourceType res_type, | |
| 30 int res_id) override; | |
| 31 void PreloadResource(AndroidResourceType res_type, int res_id) override; | |
| 32 | |
| 33 // Called from Java ---------------------------------------------------------- | |
| 34 void OnResourceReady(JNIEnv* env, | |
| 35 jobject jobj, | |
| 36 jint res_type, | |
| 37 jint res_id, | |
| 38 jobject bitmap, | |
| 39 jint padding_left, | |
| 40 jint padding_top, | |
| 41 jint padding_right, | |
| 42 jint padding_bottom, | |
| 43 jint aperture_left, | |
| 44 jint aperture_top, | |
| 45 jint aperture_right, | |
| 46 jint aperture_bottom); | |
| 47 | |
| 48 static bool RegisterResourceManager(JNIEnv* env); | |
| 49 | |
| 50 private: | |
| 51 typedef IDMap<Resource, IDMapOwnPointer> ResourceMap; | |
| 52 | |
| 53 content::UIResourceProvider* ui_resource_provider_; | |
| 54 ResourceMap resources_[ANDROID_RESOURCE_TYPE_COUNT]; | |
| 55 | |
| 56 base::android::ScopedJavaGlobalRef<jobject> java_obj_; | |
| 57 | |
| 58 DISALLOW_COPY_AND_ASSIGN(ResourceManagerImpl); | |
| 59 }; | |
| 60 | |
| 61 } // namespace content | |
| 62 | |
| 63 #endif // CONTENT_BROWSER_ANDROID_RESOURCE_MANAGER_IMPL_H_ | |
| OLD | NEW |