| 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 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 screen_rect, target_bounds, top_view_inset, title_height); | 464 screen_rect, target_bounds, top_view_inset, title_height); |
| 465 gfx::Transform transform = ScopedTransformOverviewWindow::GetTransformForRect( | 465 gfx::Transform transform = ScopedTransformOverviewWindow::GetTransformForRect( |
| 466 screen_rect, selector_item_bounds); | 466 screen_rect, selector_item_bounds); |
| 467 ScopedTransformOverviewWindow::ScopedAnimationSettings animation_settings; | 467 ScopedTransformOverviewWindow::ScopedAnimationSettings animation_settings; |
| 468 transform_window_.BeginScopedAnimation(animation_type, &animation_settings); | 468 transform_window_.BeginScopedAnimation(animation_type, &animation_settings); |
| 469 // Rounded corners are achieved by using a mask layer on the original window | 469 // Rounded corners are achieved by using a mask layer on the original window |
| 470 // before the transform. Dividing by scale factor obtains the corner radius | 470 // before the transform. Dividing by scale factor obtains the corner radius |
| 471 // which when scaled will yield |kLabelBackgroundRadius|. | 471 // which when scaled will yield |kLabelBackgroundRadius|. |
| 472 transform_window_.SetTransform( | 472 transform_window_.SetTransform( |
| 473 root_window_, transform, | 473 root_window_, transform, |
| 474 gfx::ToFlooredInt(kLabelBackgroundRadius / | 474 (kLabelBackgroundRadius / GetItemScale(target_bounds.size()))); |
| 475 GetItemScale(target_bounds.size()))); | |
| 476 transform_window_.set_overview_transform(transform); | 475 transform_window_.set_overview_transform(transform); |
| 477 } | 476 } |
| 478 | 477 |
| 479 void WindowSelectorItem::SetOpacity(float opacity) { | 478 void WindowSelectorItem::SetOpacity(float opacity) { |
| 480 window_label_->SetOpacity(opacity); | 479 window_label_->SetOpacity(opacity); |
| 481 if (!ash::MaterialDesignController::IsOverviewMaterial()) | 480 if (!ash::MaterialDesignController::IsOverviewMaterial()) |
| 482 close_button_widget_->SetOpacity(opacity); | 481 close_button_widget_->SetOpacity(opacity); |
| 483 | 482 |
| 484 transform_window_.SetOpacity(opacity); | 483 transform_window_.SetOpacity(opacity); |
| 485 } | 484 } |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 window_label_selector_window->SetOpacity(opacity); | 639 window_label_selector_window->SetOpacity(opacity); |
| 641 } | 640 } |
| 642 | 641 |
| 643 void WindowSelectorItem::UpdateCloseButtonAccessibilityName() { | 642 void WindowSelectorItem::UpdateCloseButtonAccessibilityName() { |
| 644 close_button_->SetAccessibleName(l10n_util::GetStringFUTF16( | 643 close_button_->SetAccessibleName(l10n_util::GetStringFUTF16( |
| 645 IDS_ASH_OVERVIEW_CLOSE_ITEM_BUTTON_ACCESSIBLE_NAME, | 644 IDS_ASH_OVERVIEW_CLOSE_ITEM_BUTTON_ACCESSIBLE_NAME, |
| 646 GetWindow()->GetTitle())); | 645 GetWindow()->GetTitle())); |
| 647 } | 646 } |
| 648 | 647 |
| 649 } // namespace ash | 648 } // namespace ash |
| OLD | NEW |