| 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 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 846 ->GetBackgroundType() == SHELF_BACKGROUND_MAXIMIZED) | 846 ->GetBackgroundType() == SHELF_BACKGROUND_MAXIMIZED) |
| 847 ? 1.f | 847 ? 1.f |
| 848 : 0.f; | 848 : 0.f; |
| 849 shield_widget_.reset(CreateBackgroundWidget( | 849 shield_widget_.reset(CreateBackgroundWidget( |
| 850 root_window_, kShieldColor, 0, 0, SK_ColorTRANSPARENT, initial_opacity)); | 850 root_window_, kShieldColor, 0, 0, SK_ColorTRANSPARENT, initial_opacity)); |
| 851 | 851 |
| 852 WmWindow* widget_window = | 852 WmWindow* widget_window = |
| 853 WmLookup::Get()->GetWindowForWidget(shield_widget_.get()); | 853 WmLookup::Get()->GetWindowForWidget(shield_widget_.get()); |
| 854 const gfx::Rect bounds = widget_window->GetParent()->GetBounds(); | 854 const gfx::Rect bounds = widget_window->GetParent()->GetBounds(); |
| 855 widget_window->SetBounds(bounds); | 855 widget_window->SetBounds(bounds); |
| 856 widget_window->SetName("OverviewModeShield"); |
| 856 | 857 |
| 857 ui::ScopedLayerAnimationSettings animation_settings( | 858 ui::ScopedLayerAnimationSettings animation_settings( |
| 858 widget_window->GetLayer()->GetAnimator()); | 859 widget_window->GetLayer()->GetAnimator()); |
| 859 animation_settings.SetTransitionDuration(base::TimeDelta::FromMilliseconds( | 860 animation_settings.SetTransitionDuration(base::TimeDelta::FromMilliseconds( |
| 860 kOverviewSelectorTransitionMilliseconds)); | 861 kOverviewSelectorTransitionMilliseconds)); |
| 861 animation_settings.SetTweenType(gfx::Tween::LINEAR_OUT_SLOW_IN); | 862 animation_settings.SetTweenType(gfx::Tween::LINEAR_OUT_SLOW_IN); |
| 862 animation_settings.SetPreemptionStrategy( | 863 animation_settings.SetPreemptionStrategy( |
| 863 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); | 864 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); |
| 864 shield_widget_->SetOpacity(kShieldOpacity); | 865 shield_widget_->SetOpacity(kShieldOpacity); |
| 865 } | 866 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 877 selection_widget_.reset( | 878 selection_widget_.reset( |
| 878 CreateBackgroundWidget(root_window_, selection_color, border_thickness, | 879 CreateBackgroundWidget(root_window_, selection_color, border_thickness, |
| 879 border_radius, border_color, 0.f)); | 880 border_radius, border_color, 0.f)); |
| 880 WmWindow* widget_window = | 881 WmWindow* widget_window = |
| 881 WmLookup::Get()->GetWindowForWidget(selection_widget_.get()); | 882 WmLookup::Get()->GetWindowForWidget(selection_widget_.get()); |
| 882 const gfx::Rect target_bounds = | 883 const gfx::Rect target_bounds = |
| 883 root_window_->ConvertRectFromScreen(SelectedWindow()->target_bounds()); | 884 root_window_->ConvertRectFromScreen(SelectedWindow()->target_bounds()); |
| 884 gfx::Vector2d fade_out_direction = | 885 gfx::Vector2d fade_out_direction = |
| 885 GetSlideVectorForFadeIn(direction, target_bounds); | 886 GetSlideVectorForFadeIn(direction, target_bounds); |
| 886 widget_window->SetBounds(target_bounds - fade_out_direction); | 887 widget_window->SetBounds(target_bounds - fade_out_direction); |
| 888 widget_window->SetName("OverviewModeSelector"); |
| 887 | 889 |
| 888 if (material) { | 890 if (material) { |
| 889 selector_shadow_.reset(new ::wm::Shadow()); | 891 selector_shadow_.reset(new ::wm::Shadow()); |
| 890 selector_shadow_->Init(::wm::Shadow::STYLE_ACTIVE); | 892 selector_shadow_->Init(::wm::Shadow::STYLE_ACTIVE); |
| 891 selector_shadow_->layer()->SetVisible(true); | 893 selector_shadow_->layer()->SetVisible(true); |
| 892 selection_widget_->GetLayer()->SetMasksToBounds(false); | 894 selection_widget_->GetLayer()->SetMasksToBounds(false); |
| 893 selection_widget_->GetLayer()->Add(selector_shadow_->layer()); | 895 selection_widget_->GetLayer()->Add(selector_shadow_->layer()); |
| 894 selector_shadow_->SetContentBounds(gfx::Rect(target_bounds.size())); | 896 selector_shadow_->SetContentBounds(gfx::Rect(target_bounds.size())); |
| 895 } | 897 } |
| 896 } | 898 } |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1051 *min_right = left; | 1053 *min_right = left; |
| 1052 if (*max_right < left) | 1054 if (*max_right < left) |
| 1053 *max_right = left; | 1055 *max_right = left; |
| 1054 } | 1056 } |
| 1055 *max_bottom = top + height; | 1057 *max_bottom = top + height; |
| 1056 } | 1058 } |
| 1057 return windows_fit; | 1059 return windows_fit; |
| 1058 } | 1060 } |
| 1059 | 1061 |
| 1060 } // namespace ash | 1062 } // namespace ash |
| OLD | NEW |