| 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 <unordered_map> | 10 #include <unordered_map> |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 virtual ~TabContentManager(); | 47 virtual ~TabContentManager(); |
| 48 | 48 |
| 49 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); | 49 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); |
| 50 | 50 |
| 51 void SetUIResourceProvider(ui::UIResourceProvider* ui_resource_provider); | 51 void SetUIResourceProvider(ui::UIResourceProvider* ui_resource_provider); |
| 52 | 52 |
| 53 // Get the live layer from the cache. | 53 // Get the live layer from the cache. |
| 54 scoped_refptr<cc::Layer> GetLiveLayer(int tab_id); | 54 scoped_refptr<cc::Layer> GetLiveLayer(int tab_id); |
| 55 | 55 |
| 56 scoped_refptr<ThumbnailLayer> GetStaticLayer(int tab_id); |
| 57 |
| 56 // Get the static thumbnail from the cache, or the NTP. | 58 // Get the static thumbnail from the cache, or the NTP. |
| 57 scoped_refptr<ThumbnailLayer> GetStaticLayer(int tab_id, | 59 scoped_refptr<ThumbnailLayer> GetOrCreateStaticLayer(int tab_id, |
| 58 bool force_disk_read); | 60 bool force_disk_read); |
| 59 | 61 |
| 60 // Should be called when a tab gets a new live layer that should be served | 62 // Should be called when a tab gets a new live layer that should be served |
| 61 // by the cache to the CompositorView. | 63 // by the cache to the CompositorView. |
| 62 void AttachLiveLayer(int tab_id, scoped_refptr<cc::Layer> layer); | 64 void AttachLiveLayer(int tab_id, scoped_refptr<cc::Layer> layer); |
| 63 | 65 |
| 64 // Should be called when a tab removes a live layer because it should no | 66 // Should be called when a tab removes a live layer because it should no |
| 65 // longer be served by the CompositorView. If |layer| is NULL, will | 67 // longer be served by the CompositorView. If |layer| is NULL, will |
| 66 // make sure all live layers are detached. | 68 // make sure all live layers are detached. |
| 67 void DetachLiveLayer(int tab_id, scoped_refptr<cc::Layer> layer); | 69 void DetachLiveLayer(int tab_id, scoped_refptr<cc::Layer> layer); |
| 68 | 70 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 base::WeakPtrFactory<TabContentManager> weak_factory_; | 122 base::WeakPtrFactory<TabContentManager> weak_factory_; |
| 121 | 123 |
| 122 DISALLOW_COPY_AND_ASSIGN(TabContentManager); | 124 DISALLOW_COPY_AND_ASSIGN(TabContentManager); |
| 123 }; | 125 }; |
| 124 | 126 |
| 125 bool RegisterTabContentManager(JNIEnv* env); | 127 bool RegisterTabContentManager(JNIEnv* env); |
| 126 | 128 |
| 127 } // namespace android | 129 } // namespace android |
| 128 | 130 |
| 129 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_TAB_CONTENT_MANAGER_H_ | 131 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_TAB_CONTENT_MANAGER_H_ |
| OLD | NEW |