Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(723)

Side by Side Diff: ui/android/resources/resource_manager_impl.h

Issue 1419843002: Hold a reference to any kind of context in WindowAndroid. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/id_map.h" 8 #include "base/id_map.h"
9 #include "ui/android/resources/resource_manager.h" 9 #include "ui/android/resources/resource_manager.h"
10 #include "ui/android/ui_android_export.h" 10 #include "ui/android/ui_android_export.h"
11 #include "ui/gfx/geometry/rect.h" 11 #include "ui/gfx/geometry/rect.h"
12 12
13 namespace ui { 13 namespace ui {
14 14
15 class UI_ANDROID_EXPORT ResourceManagerImpl : public ResourceManager { 15 class UI_ANDROID_EXPORT ResourceManagerImpl : public ResourceManager {
16 public: 16 public:
17 static ResourceManagerImpl* FromJavaObject(jobject jobj); 17 static ResourceManagerImpl* FromJavaObject(jobject jobj);
18 18
19 ResourceManagerImpl(); 19 explicit ResourceManagerImpl(jobject context);
20 ~ResourceManagerImpl() override; 20 ~ResourceManagerImpl() override;
21 21
22 void Init(cc::LayerTreeHost* host); 22 void Init(cc::LayerTreeHost* host);
23 23
24 // ResourceManager implementation. 24 // ResourceManager implementation.
25 base::android::ScopedJavaLocalRef<jobject> GetJavaObject() override; 25 base::android::ScopedJavaLocalRef<jobject> GetJavaObject() override;
26 Resource* GetResource(AndroidResourceType res_type, int res_id) override; 26 Resource* GetResource(AndroidResourceType res_type, int res_id) override;
27 void PreloadResource(AndroidResourceType res_type, int res_id) override; 27 void PreloadResource(AndroidResourceType res_type, int res_id) override;
28 28
29 // Called from Java 29 // Called from Java
(...skipping 29 matching lines...) Expand all
59 ResourceMap resources_[ANDROID_RESOURCE_TYPE_COUNT]; 59 ResourceMap resources_[ANDROID_RESOURCE_TYPE_COUNT];
60 60
61 base::android::ScopedJavaGlobalRef<jobject> java_obj_; 61 base::android::ScopedJavaGlobalRef<jobject> java_obj_;
62 62
63 DISALLOW_COPY_AND_ASSIGN(ResourceManagerImpl); 63 DISALLOW_COPY_AND_ASSIGN(ResourceManagerImpl);
64 }; 64 };
65 65
66 } // namespace ui 66 } // namespace ui
67 67
68 #endif // UI_ANDROID_RESOURCES_RESOURCE_MANAGER_IMPL_H_ 68 #endif // UI_ANDROID_RESOURCES_RESOURCE_MANAGER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698