OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_ANDROID_RESOURCES_RESOURCE_MANAGER_IMPL_H_ | 5 #ifndef UI_ANDROID_RESOURCES_RESOURCE_MANAGER_IMPL_H_ |
6 #define UI_ANDROID_RESOURCES_RESOURCE_MANAGER_IMPL_H_ | 6 #define UI_ANDROID_RESOURCES_RESOURCE_MANAGER_IMPL_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
| 10 #include "base/android/scoped_java_ref.h" |
10 #include "base/macros.h" | 11 #include "base/macros.h" |
11 #include "base/trace_event/memory_dump_provider.h" | 12 #include "base/trace_event/memory_dump_provider.h" |
12 #include "third_party/skia/include/core/SkColor.h" | 13 #include "third_party/skia/include/core/SkColor.h" |
13 #include "ui/android/resources/resource_manager.h" | 14 #include "ui/android/resources/resource_manager.h" |
14 #include "ui/android/ui_android_export.h" | 15 #include "ui/android/ui_android_export.h" |
15 #include "ui/gfx/geometry/rect.h" | 16 #include "ui/gfx/geometry/rect.h" |
16 #include "ui/gfx/native_widget_types.h" | 17 #include "ui/gfx/native_widget_types.h" |
17 | 18 |
18 namespace cc { | 19 namespace cc { |
19 class UIResourceManager; | 20 class UIResourceManager; |
20 } // namespace cc | 21 } // namespace cc |
21 | 22 |
22 namespace ui { | 23 namespace ui { |
23 | 24 |
24 class UI_ANDROID_EXPORT ResourceManagerImpl | 25 class UI_ANDROID_EXPORT ResourceManagerImpl |
25 : public ResourceManager, | 26 : public ResourceManager, |
26 public base::trace_event::MemoryDumpProvider { | 27 public base::trace_event::MemoryDumpProvider { |
27 public: | 28 public: |
28 static ResourceManagerImpl* FromJavaObject(jobject jobj); | 29 static ResourceManagerImpl* FromJavaObject( |
| 30 const base::android::JavaRef<jobject>& jobj); |
29 | 31 |
30 explicit ResourceManagerImpl(gfx::NativeWindow native_window); | 32 explicit ResourceManagerImpl(gfx::NativeWindow native_window); |
31 ~ResourceManagerImpl() override; | 33 ~ResourceManagerImpl() override; |
32 | 34 |
33 void Init(cc::UIResourceManager* ui_resource_manager); | 35 void Init(cc::UIResourceManager* ui_resource_manager); |
34 | 36 |
35 // ResourceManager implementation. | 37 // ResourceManager implementation. |
36 base::android::ScopedJavaLocalRef<jobject> GetJavaObject() override; | 38 base::android::ScopedJavaLocalRef<jobject> GetJavaObject() override; |
37 Resource* GetResource(AndroidResourceType res_type, int res_id) override; | 39 Resource* GetResource(AndroidResourceType res_type, int res_id) override; |
38 Resource* GetStaticResourceWithTint( | 40 Resource* GetStaticResourceWithTint( |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 TintedResourceMap tinted_resources_; | 111 TintedResourceMap tinted_resources_; |
110 | 112 |
111 base::android::ScopedJavaGlobalRef<jobject> java_obj_; | 113 base::android::ScopedJavaGlobalRef<jobject> java_obj_; |
112 | 114 |
113 DISALLOW_COPY_AND_ASSIGN(ResourceManagerImpl); | 115 DISALLOW_COPY_AND_ASSIGN(ResourceManagerImpl); |
114 }; | 116 }; |
115 | 117 |
116 } // namespace ui | 118 } // namespace ui |
117 | 119 |
118 #endif // UI_ANDROID_RESOURCES_RESOURCE_MANAGER_IMPL_H_ | 120 #endif // UI_ANDROID_RESOURCES_RESOURCE_MANAGER_IMPL_H_ |
OLD | NEW |