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 "ash/common/wm/overview/window_grid.h" | 5 #include "ash/common/wm/overview/window_grid.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
(...skipping 26 matching lines...) Expand all Loading... |
37 #include "ui/gfx/canvas.h" | 37 #include "ui/gfx/canvas.h" |
38 #include "ui/gfx/geometry/safe_integer_conversions.h" | 38 #include "ui/gfx/geometry/safe_integer_conversions.h" |
39 #include "ui/gfx/geometry/vector2d.h" | 39 #include "ui/gfx/geometry/vector2d.h" |
40 #include "ui/gfx/scoped_canvas.h" | 40 #include "ui/gfx/scoped_canvas.h" |
41 #include "ui/views/background.h" | 41 #include "ui/views/background.h" |
42 #include "ui/views/border.h" | 42 #include "ui/views/border.h" |
43 #include "ui/views/painter.h" | 43 #include "ui/views/painter.h" |
44 #include "ui/views/view.h" | 44 #include "ui/views/view.h" |
45 #include "ui/views/widget/widget.h" | 45 #include "ui/views/widget/widget.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_animations.h" | 48 #include "ui/wm/core/window_animations.h" |
48 | 49 |
49 namespace ash { | 50 namespace ash { |
50 namespace { | 51 namespace { |
51 | 52 |
52 using Windows = std::vector<WmWindow*>; | 53 using Windows = std::vector<WmWindow*>; |
53 | 54 |
54 // A comparator for locating a given target window. | 55 // A comparator for locating a given target window. |
55 struct WindowSelectorItemComparator { | 56 struct WindowSelectorItemComparator { |
56 explicit WindowSelectorItemComparator(const WmWindow* target_window) | 57 explicit WindowSelectorItemComparator(const WmWindow* target_window) |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 WmWindow* widget_window = | 669 WmWindow* widget_window = |
669 WmLookup::Get()->GetWindowForWidget(selection_widget_.get()); | 670 WmLookup::Get()->GetWindowForWidget(selection_widget_.get()); |
670 const gfx::Rect target_bounds = | 671 const gfx::Rect target_bounds = |
671 root_window_->ConvertRectFromScreen(SelectedWindow()->target_bounds()); | 672 root_window_->ConvertRectFromScreen(SelectedWindow()->target_bounds()); |
672 gfx::Vector2d fade_out_direction = | 673 gfx::Vector2d fade_out_direction = |
673 GetSlideVectorForFadeIn(direction, target_bounds); | 674 GetSlideVectorForFadeIn(direction, target_bounds); |
674 widget_window->SetBounds(target_bounds - fade_out_direction); | 675 widget_window->SetBounds(target_bounds - fade_out_direction); |
675 widget_window->SetName("OverviewModeSelector"); | 676 widget_window->SetName("OverviewModeSelector"); |
676 | 677 |
677 selector_shadow_.reset(new ::wm::Shadow()); | 678 selector_shadow_.reset(new ::wm::Shadow()); |
678 selector_shadow_->Init(::wm::Shadow::STYLE_ACTIVE); | 679 selector_shadow_->Init(::wm::ShadowElevation::LARGE); |
679 selector_shadow_->layer()->SetVisible(true); | 680 selector_shadow_->layer()->SetVisible(true); |
680 selection_widget_->GetLayer()->SetMasksToBounds(false); | 681 selection_widget_->GetLayer()->SetMasksToBounds(false); |
681 selection_widget_->GetLayer()->Add(selector_shadow_->layer()); | 682 selection_widget_->GetLayer()->Add(selector_shadow_->layer()); |
682 selector_shadow_->SetContentBounds(gfx::Rect(target_bounds.size())); | 683 selector_shadow_->SetContentBounds(gfx::Rect(target_bounds.size())); |
683 } | 684 } |
684 | 685 |
685 void WindowGrid::MoveSelectionWidget(WindowSelector::Direction direction, | 686 void WindowGrid::MoveSelectionWidget(WindowSelector::Direction direction, |
686 bool recreate_selection_widget, | 687 bool recreate_selection_widget, |
687 bool out_of_bounds, | 688 bool out_of_bounds, |
688 bool animate) { | 689 bool animate) { |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 *min_right = left; | 833 *min_right = left; |
833 if (*max_right < left) | 834 if (*max_right < left) |
834 *max_right = left; | 835 *max_right = left; |
835 } | 836 } |
836 *max_bottom = top + height; | 837 *max_bottom = top + height; |
837 } | 838 } |
838 return windows_fit; | 839 return windows_fit; |
839 } | 840 } |
840 | 841 |
841 } // namespace ash | 842 } // namespace ash |
OLD | NEW |