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 CHROME_BROWSER_ANDROID_COMPOSITOR_TAB_CONTENT_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_COMPOSITOR_TAB_CONTENT_MANAGER_H_ |
6 #define CHROME_BROWSER_ANDROID_COMPOSITOR_TAB_CONTENT_MANAGER_H_ | 6 #define CHROME_BROWSER_ANDROID_COMPOSITOR_TAB_CONTENT_MANAGER_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 | 9 |
10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
11 #include "base/android/jni_weak_ref.h" | 11 #include "base/android/jni_weak_ref.h" |
12 #include "base/containers/hash_tables.h" | 12 #include "base/containers/hash_tables.h" |
13 #include "base/containers/scoped_ptr_hash_map.h" | 13 #include "base/containers/scoped_ptr_hash_map.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "cc/layers/ui_resource_layer.h" | 15 #include "cc/layers/ui_resource_layer.h" |
16 #include "chrome/browser/android/thumbnail/thumbnail_store.h" | 16 #include "chrome/browser/android/thumbnail/thumbnail_store.h" |
17 | 17 |
18 using base::android::ScopedJavaLocalRef; | 18 using base::android::ScopedJavaLocalRef; |
19 | 19 |
20 namespace cc { | 20 namespace cc { |
21 class CopyOutputResult; | 21 class CopyOutputResult; |
22 class Layer; | 22 class Layer; |
23 } | 23 } |
24 | 24 |
25 namespace content { | 25 namespace ui { |
26 class UIResourceProvider; | 26 class UIResourceProvider; |
27 } | 27 } |
28 | 28 |
29 namespace chrome { | 29 namespace chrome { |
30 namespace android { | 30 namespace android { |
31 | 31 |
32 class ThumbnailLayer; | 32 class ThumbnailLayer; |
33 | 33 |
34 // A native component of the Java TabContentManager class. | 34 // A native component of the Java TabContentManager class. |
35 class TabContentManager : public ThumbnailStoreObserver { | 35 class TabContentManager : public ThumbnailStoreObserver { |
36 public: | 36 public: |
37 static TabContentManager* FromJavaObject(jobject jobj); | 37 static TabContentManager* FromJavaObject(jobject jobj); |
38 | 38 |
39 TabContentManager(JNIEnv* env, | 39 TabContentManager(JNIEnv* env, |
40 jobject obj, | 40 jobject obj, |
41 jstring disk_cache_path, | 41 jstring disk_cache_path, |
42 jint default_cache_size, | 42 jint default_cache_size, |
43 jint approximation_cache_size, | 43 jint approximation_cache_size, |
44 jint compression_queue_max_size, | 44 jint compression_queue_max_size, |
45 jint write_queue_max_size, | 45 jint write_queue_max_size, |
46 jboolean use_approximation_thumbnail); | 46 jboolean use_approximation_thumbnail); |
47 | 47 |
48 virtual ~TabContentManager(); | 48 virtual ~TabContentManager(); |
49 | 49 |
50 void Destroy(JNIEnv* env, jobject obj); | 50 void Destroy(JNIEnv* env, jobject obj); |
51 | 51 |
52 void SetUIResourceProvider(JNIEnv* env, | 52 void SetUIResourceProvider(JNIEnv* env, |
53 jobject obj, | 53 jobject obj, |
54 jlong ui_resource_provider_ptr); | 54 jlong ui_resource_provider_ptr); |
55 void SetUIResourceProvider(content::UIResourceProvider* ui_resource_provider); | 55 void SetUIResourceProvider(ui::UIResourceProvider* ui_resource_provider); |
56 | 56 |
57 // Get the live layer from the cache. | 57 // Get the live layer from the cache. |
58 scoped_refptr<cc::Layer> GetLiveLayer(int tab_id); | 58 scoped_refptr<cc::Layer> GetLiveLayer(int tab_id); |
59 | 59 |
60 // Get the static thumbnail from the cache, or the NTP. | 60 // Get the static thumbnail from the cache, or the NTP. |
61 scoped_refptr<ThumbnailLayer> GetStaticLayer(int tab_id, | 61 scoped_refptr<ThumbnailLayer> GetStaticLayer(int tab_id, |
62 bool force_disk_read); | 62 bool force_disk_read); |
63 | 63 |
64 // Should be called when a tab gets a new live layer that should be served | 64 // Should be called when a tab gets a new live layer that should be served |
65 // by the cache to the CompositorView. | 65 // by the cache to the CompositorView. |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 | 120 |
121 DISALLOW_COPY_AND_ASSIGN(TabContentManager); | 121 DISALLOW_COPY_AND_ASSIGN(TabContentManager); |
122 }; | 122 }; |
123 | 123 |
124 bool RegisterTabContentManager(JNIEnv* env); | 124 bool RegisterTabContentManager(JNIEnv* env); |
125 | 125 |
126 } // namespace android | 126 } // namespace android |
127 } // namespace chrome | 127 } // namespace chrome |
128 | 128 |
129 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_TAB_CONTENT_MANAGER_H_ | 129 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_TAB_CONTENT_MANAGER_H_ |
OLD | NEW |