| 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 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 back_logo_->SetTransformOrigin(gfx::Point3F(0.f, 0.f, 0.f)); | 547 back_logo_->SetTransformOrigin(gfx::Point3F(0.f, 0.f, 0.f)); |
| 548 back_logo_->SetTransform(transform); | 548 back_logo_->SetTransform(transform); |
| 549 // TODO: Set back logo alpha on leaf. | 549 // TODO: Set back logo alpha on leaf. |
| 550 } | 550 } |
| 551 } | 551 } |
| 552 | 552 |
| 553 { | 553 { |
| 554 // padding_ Transform | 554 // padding_ Transform |
| 555 gfx::Size content_bounds; | 555 gfx::Size content_bounds; |
| 556 if (!back_visible) | 556 if (!back_visible) |
| 557 content_bounds = content_->layer()->bounds(); | 557 content_bounds = content_->ComputeSize(id); |
| 558 | 558 |
| 559 gfx::Rect side_padding_rect; | 559 gfx::Rect side_padding_rect; |
| 560 gfx::Rect bottom_padding_rect; | 560 gfx::Rect bottom_padding_rect; |
| 561 if (content_bounds.width() == 0 || content_bounds.height() == 0) { | 561 if (content_bounds.width() == 0 || content_bounds.height() == 0) { |
| 562 // If content_ has 0 width or height, use the side padding to fill | 562 // If content_ has 0 width or height, use the side padding to fill |
| 563 // the desired_content_size. | 563 // the desired_content_size. |
| 564 side_padding_rect.set_size(desired_content_size); | 564 side_padding_rect.set_size(desired_content_size); |
| 565 } else { | 565 } else { |
| 566 ComputePaddingPositions(content_bounds, desired_content_size, | 566 ComputePaddingPositions(content_bounds, desired_content_size, |
| 567 &side_padding_rect, &bottom_padding_rect); | 567 &side_padding_rect, &bottom_padding_rect); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 title_->RemoveAllChildren(); | 681 title_->RemoveAllChildren(); |
| 682 title_->AddChild(layer); | 682 title_->AddChild(layer); |
| 683 } | 683 } |
| 684 } | 684 } |
| 685 | 685 |
| 686 if (title) | 686 if (title) |
| 687 title->SetUIResourceIds(); | 687 title->SetUIResourceIds(); |
| 688 } | 688 } |
| 689 | 689 |
| 690 } // namespace android | 690 } // namespace android |
| OLD | NEW |