Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2012 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 CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_TITLE_CACHE_H_ | |
| 6 #define CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_TITLE_CACHE_H_ | |
| 7 | |
| 8 #include <jni.h> | |
| 9 | |
| 10 #include "base/android/jni_android.h" | |
| 11 #include "base/android/jni_weak_ref.h" | |
| 12 #include "base/bind.h" | |
| 13 #include "base/id_map.h" | |
| 14 #include "cc/resources/ui_resource_client.h" | |
| 15 #include "third_party/skia/include/core/SkBitmap.h" | |
| 16 #include "ui/gfx/size.h" | |
| 17 #include "ui/gfx/transform.h" | |
| 18 | |
| 19 namespace cc { | |
| 20 class Layer; | |
| 21 class UIResourceLayer; | |
| 22 } | |
| 23 | |
| 24 namespace content { | |
| 25 class UIResourceProvider; | |
|
Jaekyun Seok (inactive)
2014/12/11 01:31:04
This isn't used. Please remove it.
Changwan Ryu
2014/12/11 04:12:33
Done.
| |
| 26 } | |
| 27 | |
| 28 namespace ui { | |
| 29 class ResourceManager; | |
| 30 } | |
| 31 | |
| 32 namespace chrome { | |
| 33 namespace android { | |
| 34 | |
| 35 class DecorationTitle; | |
| 36 | |
| 37 // A native component of the Java LayerTitleCache class. This class | |
| 38 // will build and maintain layers that represent the cached titles in | |
| 39 // the Java class. | |
| 40 class LayerTitleCache { | |
| 41 public: | |
| 42 static LayerTitleCache* FromJavaObject(jobject jobj); | |
| 43 | |
| 44 LayerTitleCache(JNIEnv* env, | |
| 45 jobject jobj, | |
| 46 jint fade_width, | |
| 47 jint favicon_start_padding, | |
| 48 jint favicon_end_padding, | |
| 49 jint spinner_resource_id, | |
| 50 jint spinner_incognito_resource_id); | |
| 51 void Destroy(JNIEnv* env, jobject obj); | |
| 52 | |
| 53 // Called from Java, updates a native cc::Layer based on the new texture | |
| 54 // information. | |
| 55 void UpdateLayer(JNIEnv* env, | |
| 56 jobject obj, | |
| 57 jint tab_id, | |
| 58 jint title_resource_id, | |
| 59 jint favicon_resource_id, | |
| 60 bool is_incognito, | |
| 61 bool is_rtl); | |
| 62 | |
| 63 void ClearExcept(JNIEnv* env, jobject obj, jint except_id); | |
| 64 | |
| 65 // Returns the layer that represents the title of tab of tab_id. | |
| 66 // Returns NULL if no layer can be found. | |
| 67 DecorationTitle* GetTitleLayer(int tab_id); | |
| 68 | |
| 69 void SetResourceManager(ui::ResourceManager* resource_manager); | |
| 70 | |
| 71 private: | |
| 72 ~LayerTitleCache(); | |
| 73 | |
| 74 IDMap<DecorationTitle, IDMapOwnPointer> layer_cache_; | |
| 75 | |
| 76 JavaObjectWeakGlobalRef weak_java_title_cache_; | |
| 77 int fade_width_; | |
| 78 int favicon_start_padding_; | |
| 79 int favicon_end_padding_; | |
| 80 | |
| 81 int spinner_resource_id_; | |
| 82 int spinner_incognito_resource_id_; | |
| 83 | |
| 84 ui::ResourceManager* resource_manager_; | |
| 85 | |
| 86 DISALLOW_COPY_AND_ASSIGN(LayerTitleCache); | |
| 87 }; | |
| 88 | |
| 89 bool RegisterLayerTitleCache(JNIEnv* env); | |
| 90 | |
| 91 } // namespace android | |
| 92 } // namespace chrome | |
| 93 | |
| 94 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_TITLE_CACHE_H_ | |
| OLD | NEW |