Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 #include "chrome/browser/android/compositor/scene_layer/tab_list_scene_layer.h" | 5 #include "chrome/browser/android/compositor/scene_layer/tab_list_scene_layer.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "chrome/browser/android/compositor/layer/content_layer.h" | 8 #include "chrome/browser/android/compositor/layer/content_layer.h" |
| 9 #include "chrome/browser/android/compositor/layer/tab_layer.h" | 9 #include "chrome/browser/android/compositor/layer/tab_layer.h" |
| 10 #include "chrome/browser/android/compositor/layer_title_cache.h" | 10 #include "chrome/browser/android/compositor/layer_title_cache.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 79 if (!tab_content_manager_) { | 79 if (!tab_content_manager_) { |
| 80 tab_content_manager_ = | 80 tab_content_manager_ = |
| 81 TabContentManager::FromJavaObject(jtab_content_manager); | 81 TabContentManager::FromJavaObject(jtab_content_manager); |
| 82 } | 82 } |
| 83 | 83 |
| 84 background_color_ = background_color; | 84 background_color_ = background_color; |
| 85 own_tree_->SetPosition(gfx::PointF(viewport_x, viewport_y)); | 85 own_tree_->SetPosition(gfx::PointF(viewport_x, viewport_y)); |
| 86 own_tree_->SetBounds(gfx::Size(viewport_width, viewport_height)); | 86 own_tree_->SetBounds(gfx::Size(viewport_width, viewport_height)); |
| 87 } | 87 } |
| 88 | 88 |
| 89 void TabListSceneLayer::PutTabLayer( | 89 void TabListSceneLayer::PutTabLayer(JNIEnv* env, |
| 90 JNIEnv* env, | 90 const JavaParamRef<jobject>& jobj, |
|
aelias_OOO_until_Jul13
2017/06/22 02:52:05
Now that you no longer need to touch these files,
steimel
2017/06/29 00:38:51
Done.
| |
| 91 const JavaParamRef<jobject>& jobj, | 91 jint id, |
| 92 jint id, | 92 jint toolbar_resource_id, |
| 93 jint toolbar_resource_id, | 93 jint close_button_resource_id, |
| 94 jint close_button_resource_id, | 94 jint shadow_resource_id, |
| 95 jint shadow_resource_id, | 95 jint contour_resource_id, |
| 96 jint contour_resource_id, | 96 jint back_logo_resource_id, |
| 97 jint back_logo_resource_id, | 97 jint border_resource_id, |
| 98 jint border_resource_id, | 98 jint border_inner_shadow_resource_id, |
| 99 jint border_inner_shadow_resource_id, | 99 jboolean can_use_live_layer, |
| 100 jboolean can_use_live_layer, | 100 jboolean browser_controls_at_bottom, |
| 101 jboolean browser_controls_at_bottom, | 101 jint tab_background_color, |
| 102 jint tab_background_color, | 102 jint back_logo_color, |
| 103 jint back_logo_color, | 103 jboolean incognito, |
| 104 jboolean incognito, | 104 jboolean is_portrait, |
| 105 jboolean is_portrait, | 105 jfloat x, |
| 106 jfloat x, | 106 jfloat y, |
| 107 jfloat y, | 107 jfloat width, |
| 108 jfloat width, | 108 jfloat height, |
| 109 jfloat height, | 109 jfloat content_width, |
| 110 jfloat content_width, | 110 jfloat content_height, |
| 111 jfloat content_height, | 111 jfloat visible_content_height, |
| 112 jfloat visible_content_height, | 112 jfloat shadow_x, |
| 113 jfloat shadow_x, | 113 jfloat shadow_y, |
| 114 jfloat shadow_y, | 114 jfloat shadow_width, |
| 115 jfloat shadow_width, | 115 jfloat shadow_height, |
| 116 jfloat shadow_height, | 116 jfloat pivot_x, |
| 117 jfloat pivot_x, | 117 jfloat pivot_y, |
| 118 jfloat pivot_y, | 118 jfloat rotation_x, |
| 119 jfloat rotation_x, | 119 jfloat rotation_y, |
| 120 jfloat rotation_y, | 120 jfloat alpha, |
| 121 jfloat alpha, | 121 jfloat border_alpha, |
| 122 jfloat border_alpha, | 122 jfloat border_inner_shadow_alpha, |
| 123 jfloat border_inner_shadow_alpha, | 123 jfloat contour_alpha, |
| 124 jfloat contour_alpha, | 124 jfloat shadow_alpha, |
| 125 jfloat shadow_alpha, | 125 jfloat close_alpha, |
| 126 jfloat close_alpha, | 126 jfloat close_btn_width, |
| 127 jfloat close_btn_width, | 127 jfloat static_to_view_blend, |
| 128 jfloat static_to_view_blend, | 128 jfloat border_scale, |
| 129 jfloat border_scale, | 129 jfloat saturation, |
| 130 jfloat saturation, | 130 jfloat brightness, |
| 131 jfloat brightness, | 131 jboolean show_toolbar, |
| 132 jboolean show_toolbar, | 132 jint default_theme_color, |
| 133 jint default_theme_color, | 133 jint toolbar_background_color, |
| 134 jint toolbar_background_color, | 134 jint close_button_color, |
| 135 jint close_button_color, | 135 jboolean anonymize_toolbar, |
| 136 jboolean anonymize_toolbar, | 136 jboolean show_tab_title, |
| 137 jboolean show_tab_title, | 137 jint toolbar_textbox_resource_id, |
| 138 jint toolbar_textbox_resource_id, | 138 jint toolbar_textbox_background_color, |
| 139 jint toolbar_textbox_background_color, | 139 jfloat toolbar_textbox_alpha, |
| 140 jfloat toolbar_textbox_alpha, | 140 jfloat toolbar_alpha, |
| 141 jfloat toolbar_alpha, | 141 jfloat toolbar_y_offset, |
| 142 jfloat toolbar_y_offset, | 142 jfloat side_border_scale, |
| 143 jfloat side_border_scale, | 143 jboolean inset_border) { |
| 144 jboolean inset_border) { | |
| 145 scoped_refptr<TabLayer> layer; | 144 scoped_refptr<TabLayer> layer; |
| 146 auto iter = tab_map_.find(id); | 145 auto iter = tab_map_.find(id); |
| 147 if (iter != tab_map_.end()) { | 146 if (iter != tab_map_.end()) { |
| 148 layer = iter->second; | 147 layer = iter->second; |
| 149 } else { | 148 } else { |
| 150 layer = TabLayer::Create(incognito, resource_manager_, layer_title_cache_, | 149 layer = TabLayer::Create(incognito, resource_manager_, layer_title_cache_, |
| 151 tab_content_manager_); | 150 tab_content_manager_); |
| 152 tab_map_.insert(TabMap::value_type(id, layer)); | 151 tab_map_.insert(TabMap::value_type(id, layer)); |
| 153 } | 152 } |
| 154 own_tree_->AddChild(layer->layer()); | 153 own_tree_->AddChild(layer->layer()); |
| 155 visible_tabs_this_frame_.insert(id); | 154 visible_tabs_this_frame_.insert(id); |
| 156 | 155 |
| 157 // Add the tints for the border asset and close icon to the list that was | 156 // Add the tints for the border asset and close icon to the list that was |
| 158 // used for this frame. | 157 // used for this frame. |
| 159 used_tints_.insert(toolbar_background_color); | 158 used_tints_.insert(toolbar_background_color); |
| 160 used_tints_.insert(close_button_color); | 159 used_tints_.insert(close_button_color); |
| 161 | 160 |
| 162 DCHECK(layer); | 161 DCHECK(layer); |
| 163 if (layer) { | 162 if (layer) { |
| 164 layer->SetProperties( | 163 layer->SetProperties( |
| 165 id, can_use_live_layer, browser_controls_at_bottom, | 164 id, can_use_live_layer, browser_controls_at_bottom, toolbar_resource_id, |
| 166 toolbar_resource_id, close_button_resource_id, | 165 close_button_resource_id, shadow_resource_id, contour_resource_id, |
| 167 shadow_resource_id, contour_resource_id, back_logo_resource_id, | 166 back_logo_resource_id, border_resource_id, |
| 168 border_resource_id, border_inner_shadow_resource_id, | 167 border_inner_shadow_resource_id, tab_background_color, back_logo_color, |
| 169 tab_background_color, back_logo_color, is_portrait, x, y, width, height, | 168 is_portrait, x, y, width, height, shadow_x, shadow_y, shadow_width, |
| 170 shadow_x, shadow_y, shadow_width, shadow_height, pivot_x, pivot_y, | 169 shadow_height, pivot_x, pivot_y, rotation_x, rotation_y, alpha, |
| 171 rotation_x, rotation_y, alpha, border_alpha, border_inner_shadow_alpha, | 170 border_alpha, border_inner_shadow_alpha, contour_alpha, shadow_alpha, |
| 172 contour_alpha, shadow_alpha, close_alpha, border_scale, saturation, | 171 close_alpha, border_scale, saturation, brightness, close_btn_width, |
| 173 brightness, close_btn_width, static_to_view_blend, content_width, | 172 static_to_view_blend, content_width, content_height, content_width, |
| 174 content_height, content_width, visible_content_height, show_toolbar, | 173 visible_content_height, show_toolbar, default_theme_color, |
| 175 default_theme_color, toolbar_background_color, | 174 toolbar_background_color, close_button_color, anonymize_toolbar, |
| 176 close_button_color, anonymize_toolbar, show_tab_title, | 175 show_tab_title, toolbar_textbox_resource_id, |
| 177 toolbar_textbox_resource_id, toolbar_textbox_background_color, | 176 toolbar_textbox_background_color, toolbar_textbox_alpha, toolbar_alpha, |
| 178 toolbar_textbox_alpha, toolbar_alpha, toolbar_y_offset, | 177 toolbar_y_offset, side_border_scale, inset_border); |
| 179 side_border_scale, inset_border); | |
| 180 } | 178 } |
| 181 | 179 |
| 182 gfx::RectF self(own_tree_->position(), gfx::SizeF(own_tree_->bounds())); | 180 gfx::RectF self(own_tree_->position(), gfx::SizeF(own_tree_->bounds())); |
| 183 gfx::RectF content(x, y, width, height); | 181 gfx::RectF content(x, y, width, height); |
| 184 | 182 |
| 185 content_obscures_self_ |= content.Contains(self); | 183 content_obscures_self_ |= content.Contains(self); |
| 186 } | 184 } |
| 187 | 185 |
| 188 base::android::ScopedJavaLocalRef<jobject> TabListSceneLayer::GetJavaObject( | 186 base::android::ScopedJavaLocalRef<jobject> TabListSceneLayer::GetJavaObject( |
| 189 JNIEnv* env) { | 187 JNIEnv* env) { |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 209 // This will automatically bind to the Java object and pass ownership there. | 207 // This will automatically bind to the Java object and pass ownership there. |
| 210 TabListSceneLayer* scene_layer = new TabListSceneLayer(env, jobj); | 208 TabListSceneLayer* scene_layer = new TabListSceneLayer(env, jobj); |
| 211 return reinterpret_cast<intptr_t>(scene_layer); | 209 return reinterpret_cast<intptr_t>(scene_layer); |
| 212 } | 210 } |
| 213 | 211 |
| 214 bool RegisterTabListSceneLayer(JNIEnv* env) { | 212 bool RegisterTabListSceneLayer(JNIEnv* env) { |
| 215 return RegisterNativesImpl(env); | 213 return RegisterNativesImpl(env); |
| 216 } | 214 } |
| 217 | 215 |
| 218 } // namespace android | 216 } // namespace android |
| OLD | NEW |