| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ash/common/wm/overview/window_selector_item.h" | 5 #include "ash/common/wm/overview/window_selector_item.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/common/material_design/material_design_controller.h" | 10 #include "ash/common/material_design/material_design_controller.h" |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 screen_rect, target_bounds, top_view_inset, title_height); | 470 screen_rect, target_bounds, top_view_inset, title_height); |
| 471 gfx::Transform transform = ScopedTransformOverviewWindow::GetTransformForRect( | 471 gfx::Transform transform = ScopedTransformOverviewWindow::GetTransformForRect( |
| 472 screen_rect, selector_item_bounds); | 472 screen_rect, selector_item_bounds); |
| 473 ScopedTransformOverviewWindow::ScopedAnimationSettings animation_settings; | 473 ScopedTransformOverviewWindow::ScopedAnimationSettings animation_settings; |
| 474 transform_window_.BeginScopedAnimation(animation_type, &animation_settings); | 474 transform_window_.BeginScopedAnimation(animation_type, &animation_settings); |
| 475 // Rounded corners are achieved by using a mask layer on the original window | 475 // Rounded corners are achieved by using a mask layer on the original window |
| 476 // before the transform. Dividing by scale factor obtains the corner radius | 476 // before the transform. Dividing by scale factor obtains the corner radius |
| 477 // which when scaled will yield |kLabelBackgroundRadius|. | 477 // which when scaled will yield |kLabelBackgroundRadius|. |
| 478 transform_window_.SetTransform( | 478 transform_window_.SetTransform( |
| 479 root_window_, transform, | 479 root_window_, transform, |
| 480 gfx::ToFlooredInt(kLabelBackgroundRadius / | 480 (kLabelBackgroundRadius / GetItemScale(target_bounds.size()))); |
| 481 GetItemScale(target_bounds.size()))); | |
| 482 transform_window_.set_overview_transform(transform); | 481 transform_window_.set_overview_transform(transform); |
| 483 } | 482 } |
| 484 | 483 |
| 485 void WindowSelectorItem::SetOpacity(float opacity) { | 484 void WindowSelectorItem::SetOpacity(float opacity) { |
| 486 window_label_->SetOpacity(opacity); | 485 window_label_->SetOpacity(opacity); |
| 487 if (!ash::MaterialDesignController::IsOverviewMaterial()) | 486 if (!ash::MaterialDesignController::IsOverviewMaterial()) |
| 488 close_button_widget_->SetOpacity(opacity); | 487 close_button_widget_->SetOpacity(opacity); |
| 489 | 488 |
| 490 transform_window_.SetOpacity(opacity); | 489 transform_window_.SetOpacity(opacity); |
| 491 } | 490 } |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 window_label_selector_window->SetOpacity(opacity); | 645 window_label_selector_window->SetOpacity(opacity); |
| 647 } | 646 } |
| 648 | 647 |
| 649 void WindowSelectorItem::UpdateCloseButtonAccessibilityName() { | 648 void WindowSelectorItem::UpdateCloseButtonAccessibilityName() { |
| 650 close_button_->SetAccessibleName(l10n_util::GetStringFUTF16( | 649 close_button_->SetAccessibleName(l10n_util::GetStringFUTF16( |
| 651 IDS_ASH_OVERVIEW_CLOSE_ITEM_BUTTON_ACCESSIBLE_NAME, | 650 IDS_ASH_OVERVIEW_CLOSE_ITEM_BUTTON_ACCESSIBLE_NAME, |
| 652 GetWindow()->GetTitle())); | 651 GetWindow()->GetTitle())); |
| 653 } | 652 } |
| 654 | 653 |
| 655 } // namespace ash | 654 } // namespace ash |
| OLD | NEW |