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 26 matching lines...) Expand all Loading... |
37 #include "ui/gfx/geometry/safe_integer_conversions.h" | 37 #include "ui/gfx/geometry/safe_integer_conversions.h" |
38 #include "ui/gfx/paint_vector_icon.h" | 38 #include "ui/gfx/paint_vector_icon.h" |
39 #include "ui/gfx/transform_util.h" | 39 #include "ui/gfx/transform_util.h" |
40 #include "ui/gfx/vector_icons_public.h" | 40 #include "ui/gfx/vector_icons_public.h" |
41 #include "ui/strings/grit/ui_strings.h" | 41 #include "ui/strings/grit/ui_strings.h" |
42 #include "ui/views/background.h" | 42 #include "ui/views/background.h" |
43 #include "ui/views/border.h" | 43 #include "ui/views/border.h" |
44 #include "ui/views/layout/box_layout.h" | 44 #include "ui/views/layout/box_layout.h" |
45 #include "ui/views/window/non_client_view.h" | 45 #include "ui/views/window/non_client_view.h" |
46 #include "ui/wm/core/shadow.h" | 46 #include "ui/wm/core/shadow.h" |
| 47 #include "ui/wm/core/shadow_types.h" |
47 #include "ui/wm/core/window_util.h" | 48 #include "ui/wm/core/window_util.h" |
48 | 49 |
49 namespace ash { | 50 namespace ash { |
50 | 51 |
51 namespace { | 52 namespace { |
52 | 53 |
53 // In the conceptual overview table, the window margin is the space reserved | 54 // In the conceptual overview table, the window margin is the space reserved |
54 // around the window within the cell. This margin does not overlap so the | 55 // around the window within the cell. This margin does not overlap so the |
55 // closest distance between adjacent windows will be twice this amount. | 56 // closest distance between adjacent windows will be twice this amount. |
56 static const int kWindowMargin = 5; | 57 static const int kWindowMargin = 5; |
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 window_label_->SetOpacity(0); | 660 window_label_->SetOpacity(0); |
660 window_label_->Show(); | 661 window_label_->Show(); |
661 | 662 |
662 // TODO(varkha): Restore shadows when programmatic shadows exist. | 663 // TODO(varkha): Restore shadows when programmatic shadows exist. |
663 // Note: current shadow implementation does not allow proper animation when | 664 // Note: current shadow implementation does not allow proper animation when |
664 // the parent layer bounds change during the animation since | 665 // the parent layer bounds change during the animation since |
665 // Shadow::UpdateLayerBounds() only happens before the animation starts. | 666 // Shadow::UpdateLayerBounds() only happens before the animation starts. |
666 if (ash::MaterialDesignController::GetMode() == | 667 if (ash::MaterialDesignController::GetMode() == |
667 ash::MaterialDesignController::Mode::MATERIAL_EXPERIMENTAL) { | 668 ash::MaterialDesignController::Mode::MATERIAL_EXPERIMENTAL) { |
668 shadow_.reset(new ::wm::Shadow()); | 669 shadow_.reset(new ::wm::Shadow()); |
669 shadow_->Init(::wm::Shadow::STYLE_INACTIVE); | 670 shadow_->Init(::wm::ShadowElevation::MEDIUM); |
670 shadow_->layer()->SetVisible(true); | 671 shadow_->layer()->SetVisible(true); |
671 window_label_->GetLayer()->Add(shadow_->layer()); | 672 window_label_->GetLayer()->Add(shadow_->layer()); |
672 } | 673 } |
673 window_label_->GetLayer()->SetMasksToBounds(false); | 674 window_label_->GetLayer()->SetMasksToBounds(false); |
674 } | 675 } |
675 | 676 |
676 void WindowSelectorItem::UpdateHeaderLayout( | 677 void WindowSelectorItem::UpdateHeaderLayout( |
677 HeaderFadeInMode mode, | 678 HeaderFadeInMode mode, |
678 OverviewAnimationType animation_type) { | 679 OverviewAnimationType animation_type) { |
679 gfx::Rect transformed_window_bounds = root_window_->ConvertRectFromScreen( | 680 gfx::Rect transformed_window_bounds = root_window_->ConvertRectFromScreen( |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
785 | 786 |
786 gfx::SlideAnimation* WindowSelectorItem::GetBackgroundViewAnimation() { | 787 gfx::SlideAnimation* WindowSelectorItem::GetBackgroundViewAnimation() { |
787 return background_view_ ? background_view_->animation() : nullptr; | 788 return background_view_ ? background_view_->animation() : nullptr; |
788 } | 789 } |
789 | 790 |
790 WmWindow* WindowSelectorItem::GetOverviewWindowForMinimizedStateForTest() { | 791 WmWindow* WindowSelectorItem::GetOverviewWindowForMinimizedStateForTest() { |
791 return transform_window_.GetOverviewWindowForMinimizedState(); | 792 return transform_window_.GetOverviewWindowForMinimizedState(); |
792 } | 793 } |
793 | 794 |
794 } // namespace ash | 795 } // namespace ash |
OLD | NEW |