OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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_SCENE_LAYER_TAB_LIST_SCENE_LAYER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_COMPOSITOR_SCENE_LAYER_TAB_LIST_SCENE_LAYER_H_ |
| 7 |
| 8 #include <vector> |
| 9 |
| 10 #include "base/android/jni_android.h" |
| 11 #include "base/android/jni_weak_ref.h" |
| 12 #include "base/android/scoped_java_ref.h" |
| 13 #include "base/basictypes.h" |
| 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "cc/layers/layer.h" |
| 16 #include "chrome/browser/android/compositor/layer/layer.h" |
| 17 #include "chrome/browser/android/compositor/scene_layer/scene_layer.h" |
| 18 #include "third_party/skia/include/core/SkColor.h" |
| 19 |
| 20 namespace ui { |
| 21 class ResourceManager; |
| 22 } |
| 23 |
| 24 namespace chrome { |
| 25 namespace android { |
| 26 |
| 27 class LayerTitleCache; |
| 28 class TabContentManager; |
| 29 class TabLayer; |
| 30 |
| 31 class TabListSceneLayer : public SceneLayer { |
| 32 public: |
| 33 TabListSceneLayer(JNIEnv* env, jobject jobj); |
| 34 ~TabListSceneLayer() override; |
| 35 |
| 36 // TODO(changwan): remove this once we have refactored |
| 37 // ContextualSearchSupportedLayout into LayoutHelper. |
| 38 void SetContentTree(JNIEnv* env, jobject jobj, jobject jcontent_tree); |
| 39 |
| 40 void BeginBuildingFrame(JNIEnv* env, jobject jobj); |
| 41 void FinishBuildingFrame(JNIEnv* env, jobject jobj); |
| 42 // TODO(dtrainor): This method is ridiculous. Break this apart? |
| 43 void PutLayer(JNIEnv* env, |
| 44 jobject jobj, |
| 45 jint id, |
| 46 jint toolbar_resource_id, |
| 47 jint close_button_resource_id, |
| 48 jint shadow_resource_id, |
| 49 jint contour_resource_id, |
| 50 jint back_logo_resource_id, |
| 51 jint border_resource_id, |
| 52 jboolean can_use_live_layer, |
| 53 jboolean can_use_ntp_fallback, |
| 54 jint tab_background_color, |
| 55 jint background_color, |
| 56 jint back_logo_color, |
| 57 jboolean incognito, |
| 58 jboolean is_portrait, |
| 59 jfloat x, |
| 60 jfloat y, |
| 61 jfloat width, |
| 62 jfloat height, |
| 63 jfloat content_width, |
| 64 jfloat content_height, |
| 65 jfloat visible_content_height, |
| 66 jfloat viewport_x, |
| 67 jfloat viewport_y, |
| 68 jfloat viewport_width, |
| 69 jfloat viewport_height, |
| 70 jfloat shadow_x, |
| 71 jfloat shadow_y, |
| 72 jfloat shadow_width, |
| 73 jfloat shadow_height, |
| 74 jfloat pivot_x, |
| 75 jfloat pivot_y, |
| 76 jfloat rotation_x, |
| 77 jfloat rotation_y, |
| 78 jfloat alpha, |
| 79 jfloat border_alpha, |
| 80 jfloat contour_alpha, |
| 81 jfloat shadow_alpha, |
| 82 jfloat close_alpha, |
| 83 jfloat close_btn_width, |
| 84 jfloat static_to_view_blend, |
| 85 jfloat border_scale, |
| 86 jfloat saturation, |
| 87 jfloat brightness, |
| 88 jboolean show_toolbar, |
| 89 jboolean anonymize_toolbar, |
| 90 jfloat toolbar_alpha, |
| 91 jfloat toolbar_y_offset, |
| 92 jfloat side_border_scale, |
| 93 jboolean attach_content, |
| 94 jboolean inset_border, |
| 95 jobject jlayer_title_cache, |
| 96 jobject jtab_content_manager, |
| 97 jobject jresource_manager); |
| 98 |
| 99 base::android::ScopedJavaLocalRef<jobject> GetJavaObject(JNIEnv* env); |
| 100 |
| 101 void OnDetach() override; |
| 102 bool ShouldShowBackground() override; |
| 103 SkColor GetBackgroundColor() override; |
| 104 |
| 105 private: |
| 106 void RemoveAllRemainingTabLayers(); |
| 107 void RemoveTabLayersInRange(unsigned start_index, unsigned end_index); |
| 108 |
| 109 typedef std::vector<scoped_refptr<TabLayer>> TabLayerList; |
| 110 |
| 111 scoped_refptr<TabLayer> GetNextLayer(bool incognito); |
| 112 |
| 113 base::android::ScopedJavaGlobalRef<jobject> java_obj_; |
| 114 bool content_obscures_self_; |
| 115 unsigned write_index_; |
| 116 ui::ResourceManager* resource_manager_; |
| 117 LayerTitleCache* layer_title_cache_; |
| 118 TabContentManager* tab_content_manager_; |
| 119 TabLayerList layers_; |
| 120 SkColor background_color_; |
| 121 |
| 122 // We need to make sure that content_tree_ is always in front of own_tree_. |
| 123 scoped_refptr<cc::Layer> own_tree_; |
| 124 scoped_refptr<cc::Layer> content_tree_; |
| 125 |
| 126 DISALLOW_COPY_AND_ASSIGN(TabListSceneLayer); |
| 127 }; |
| 128 |
| 129 bool RegisterTabListSceneLayer(JNIEnv* env); |
| 130 |
| 131 } // namespace android |
| 132 } // namespace chrome |
| 133 |
| 134 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_SCENE_LAYER_TAB_LIST_SCENE_LAYER_H_ |
OLD | NEW |