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 #include "chrome/browser/android/compositor/layer/tab_layer.h" | 5 #include "chrome/browser/android/compositor/layer/tab_layer.h" |
6 | 6 |
7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "cc/layers/layer.h" | 9 #include "cc/layers/layer.h" |
10 #include "cc/layers/layer_collections.h" | 10 #include "cc/layers/layer_collections.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 transform.Translate(padding_rect.x() + content_position.x(), | 87 transform.Translate(padding_rect.x() + content_position.x(), |
88 padding_rect.y() + content_position.y()); | 88 padding_rect.y() + content_position.y()); |
89 transform.Translate(descaled_local_content_area.x(), | 89 transform.Translate(descaled_local_content_area.x(), |
90 descaled_local_content_area.y()); | 90 descaled_local_content_area.y()); |
91 padding_layer->SetTransformOrigin(gfx::Point3F(0.f, 0.f, 0.f)); | 91 padding_layer->SetTransformOrigin(gfx::Point3F(0.f, 0.f, 0.f)); |
92 padding_layer->SetTransform(transform); | 92 padding_layer->SetTransform(transform); |
93 } | 93 } |
94 | 94 |
95 void TabLayer::SetProperties(int id, | 95 void TabLayer::SetProperties(int id, |
96 bool can_use_live_layer, | 96 bool can_use_live_layer, |
| 97 bool can_use_static_layer, |
97 bool browser_controls_at_bottom, | 98 bool browser_controls_at_bottom, |
98 int toolbar_resource_id, | 99 int toolbar_resource_id, |
99 int close_button_resource_id, | 100 int close_button_resource_id, |
100 int shadow_resource_id, | 101 int shadow_resource_id, |
101 int contour_resource_id, | 102 int contour_resource_id, |
102 int back_logo_resource_id, | 103 int back_logo_resource_id, |
103 int border_resource_id, | 104 int border_resource_id, |
104 int border_inner_shadow_resource_id, | 105 int border_inner_shadow_resource_id, |
105 int default_background_color, | 106 int default_background_color, |
106 int back_logo_color, | 107 int back_logo_color, |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 | 447 |
447 close_button_->SetUIResourceId(close_btn_resource->ui_resource()->id()); | 448 close_button_->SetUIResourceId(close_btn_resource->ui_resource()->id()); |
448 | 449 |
449 if (!back_visible) { | 450 if (!back_visible) { |
450 gfx::Rect rounded_descaled_content_area( | 451 gfx::Rect rounded_descaled_content_area( |
451 round(descaled_local_content_area.x()), | 452 round(descaled_local_content_area.x()), |
452 round(descaled_local_content_area.y()), | 453 round(descaled_local_content_area.y()), |
453 round(desired_content_size.width()), | 454 round(desired_content_size.width()), |
454 round(desired_content_size.height())); | 455 round(desired_content_size.height())); |
455 | 456 |
456 content_->SetProperties(id, can_use_live_layer, static_to_view_blend, | 457 content_->SetProperties(id, can_use_live_layer, can_use_static_layer, |
457 true, alpha, saturation, | 458 static_to_view_blend, true, alpha, saturation, true, |
458 true, rounded_descaled_content_area); | 459 rounded_descaled_content_area); |
459 } else if (back_logo_resource) { | 460 } else if (back_logo_resource) { |
460 back_logo_->SetUIResourceId(back_logo_resource->ui_resource()->id()); | 461 back_logo_->SetUIResourceId(back_logo_resource->ui_resource()->id()); |
461 } | 462 } |
462 | 463 |
463 //---------------------------------------------------------------------------- | 464 //---------------------------------------------------------------------------- |
464 // Push Size, Position, Alpha and Transformations to Layers | 465 // Push Size, Position, Alpha and Transformations to Layers |
465 //---------------------------------------------------------------------------- | 466 //---------------------------------------------------------------------------- |
466 shadow_->SetHideLayerAndSubtree(!shadow_visible); | 467 shadow_->SetHideLayerAndSubtree(!shadow_visible); |
467 if (shadow_visible) { | 468 if (shadow_visible) { |
468 shadow_->SetPosition(shadow_position); | 469 shadow_->SetPosition(shadow_position); |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 title_->RemoveAllChildren(); | 683 title_->RemoveAllChildren(); |
683 title_->AddChild(layer); | 684 title_->AddChild(layer); |
684 } | 685 } |
685 } | 686 } |
686 | 687 |
687 if (title) | 688 if (title) |
688 title->SetUIResourceIds(); | 689 title->SetUIResourceIds(); |
689 } | 690 } |
690 | 691 |
691 } // namespace android | 692 } // namespace android |
OLD | NEW |