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/wm/maximize_mode/workspace_backdrop_delegate.h" | 5 #include "ash/wm/maximize_mode/workspace_backdrop_delegate.h" |
6 | 6 |
7 #include "ash/wm/window_animations.h" | 7 #include "ash/wm/window_animations.h" |
8 #include "ash/wm/window_util.h" | 8 #include "ash/wm/window_util.h" |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 void WorkspaceBackdropDelegate::OnWindowStackingChanged(aura::Window* window) { | 84 void WorkspaceBackdropDelegate::OnWindowStackingChanged(aura::Window* window) { |
85 RestackBackdrop(); | 85 RestackBackdrop(); |
86 } | 86 } |
87 | 87 |
88 void WorkspaceBackdropDelegate::OnPostWindowStateTypeChange( | 88 void WorkspaceBackdropDelegate::OnPostWindowStateTypeChange( |
89 wm::WindowState* window_state, | 89 wm::WindowState* window_state, |
90 wm::WindowStateType old_type) { | 90 wm::WindowStateType old_type) { |
91 RestackBackdrop(); | 91 RestackBackdrop(); |
92 } | 92 } |
93 | 93 |
| 94 void WorkspaceBackdropDelegate::OnDisplayWorkAreaInsetsChanged() { |
| 95 AdjustToContainerBounds(); |
| 96 } |
| 97 |
94 void WorkspaceBackdropDelegate::RestackBackdrop() { | 98 void WorkspaceBackdropDelegate::RestackBackdrop() { |
95 // Avoid recursive calls. | 99 // Avoid recursive calls. |
96 if (in_restacking_) | 100 if (in_restacking_) |
97 return; | 101 return; |
98 | 102 |
99 aura::Window* window = GetCurrentTopWindow(); | 103 aura::Window* window = GetCurrentTopWindow(); |
100 if (!window) { | 104 if (!window) { |
101 // Hide backdrop since no suitable window was found. | 105 // Hide backdrop since no suitable window was found. |
102 background_->Hide(); | 106 background_->Hide(); |
103 return; | 107 return; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 | 151 |
148 void WorkspaceBackdropDelegate::Show() { | 152 void WorkspaceBackdropDelegate::Show() { |
149 background_->GetNativeView()->layer()->SetOpacity(0.0f); | 153 background_->GetNativeView()->layer()->SetOpacity(0.0f); |
150 background_->Show(); | 154 background_->Show(); |
151 ui::ScopedLayerAnimationSettings settings( | 155 ui::ScopedLayerAnimationSettings settings( |
152 background_->GetNativeView()->layer()->GetAnimator()); | 156 background_->GetNativeView()->layer()->GetAnimator()); |
153 background_->GetNativeView()->layer()->SetOpacity(kBackdropOpacity); | 157 background_->GetNativeView()->layer()->SetOpacity(kBackdropOpacity); |
154 } | 158 } |
155 | 159 |
156 } // namespace ash | 160 } // namespace ash |
OLD | NEW |