| 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/maximize_mode/workspace_backdrop_delegate.h" | 5 #include "ash/common/wm/maximize_mode/workspace_backdrop_delegate.h" |
| 6 | 6 |
| 7 #include "ash/common/wm/workspace/workspace_layout_manager_backdrop_delegate.h" | 7 #include "ash/common/wm/workspace/workspace_layout_manager_backdrop_delegate.h" |
| 8 #include "ash/common/wm_lookup.h" | |
| 9 #include "ash/common/wm_window.h" | 8 #include "ash/common/wm_window.h" |
| 10 #include "ash/public/cpp/shell_window_ids.h" | 9 #include "ash/public/cpp/shell_window_ids.h" |
| 11 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
| 12 #include "base/auto_reset.h" | 11 #include "base/auto_reset.h" |
| 13 #include "ui/aura/window_observer.h" | 12 #include "ui/aura/window_observer.h" |
| 14 #include "ui/compositor/layer.h" | 13 #include "ui/compositor/layer.h" |
| 15 #include "ui/compositor/scoped_layer_animation_settings.h" | 14 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 16 #include "ui/views/background.h" | 15 #include "ui/views/background.h" |
| 17 #include "ui/views/widget/widget.h" | 16 #include "ui/views/widget/widget.h" |
| 18 #include "ui/wm/core/window_animations.h" | 17 #include "ui/wm/core/window_animations.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 params.bounds = container_->GetBoundsInScreen(); | 56 params.bounds = container_->GetBoundsInScreen(); |
| 58 params.layer_type = ui::LAYER_SOLID_COLOR; | 57 params.layer_type = ui::LAYER_SOLID_COLOR; |
| 59 params.name = "WorkspaceBackdropDelegate"; | 58 params.name = "WorkspaceBackdropDelegate"; |
| 60 // To disallow the MRU list from picking this window up it should not be | 59 // To disallow the MRU list from picking this window up it should not be |
| 61 // activateable. | 60 // activateable. |
| 62 params.activatable = views::Widget::InitParams::ACTIVATABLE_NO; | 61 params.activatable = views::Widget::InitParams::ACTIVATABLE_NO; |
| 63 DCHECK_NE(kShellWindowId_Invalid, container_->GetShellWindowId()); | 62 DCHECK_NE(kShellWindowId_Invalid, container_->GetShellWindowId()); |
| 64 container_->GetRootWindowController()->ConfigureWidgetInitParamsForContainer( | 63 container_->GetRootWindowController()->ConfigureWidgetInitParamsForContainer( |
| 65 background_, container_->GetShellWindowId(), ¶ms); | 64 background_, container_->GetShellWindowId(), ¶ms); |
| 66 background_->Init(params); | 65 background_->Init(params); |
| 67 background_window_ = WmLookup::Get()->GetWindowForWidget(background_); | 66 background_window_ = WmWindow::Get(background_->GetNativeWindow()); |
| 68 // Do not use the animation system. We don't want the bounds animation and | 67 // Do not use the animation system. We don't want the bounds animation and |
| 69 // opacity needs to get set to |kBackdropOpacity|. | 68 // opacity needs to get set to |kBackdropOpacity|. |
| 70 background_window_->SetVisibilityAnimationTransition(::wm::ANIMATE_NONE); | 69 background_window_->SetVisibilityAnimationTransition(::wm::ANIMATE_NONE); |
| 71 background_window_->GetLayer()->SetColor(SK_ColorBLACK); | 70 background_window_->GetLayer()->SetColor(SK_ColorBLACK); |
| 72 // Make sure that the layer covers visibly everything - including the shelf. | 71 // Make sure that the layer covers visibly everything - including the shelf. |
| 73 background_window_->GetLayer()->SetBounds(params.bounds); | 72 background_window_->GetLayer()->SetBounds(params.bounds); |
| 74 DCHECK(background_window_->GetBounds() == params.bounds); | 73 DCHECK(background_window_->GetBounds() == params.bounds); |
| 75 Show(); | 74 Show(); |
| 76 RestackBackdrop(); | 75 RestackBackdrop(); |
| 77 container_->aura_window()->AddObserver(container_observer_.get()); | 76 container_->aura_window()->AddObserver(container_observer_.get()); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 | 168 |
| 170 void WorkspaceBackdropDelegate::Show() { | 169 void WorkspaceBackdropDelegate::Show() { |
| 171 background_window_->GetLayer()->SetOpacity(0.0f); | 170 background_window_->GetLayer()->SetOpacity(0.0f); |
| 172 background_->Show(); | 171 background_->Show(); |
| 173 ui::ScopedLayerAnimationSettings settings( | 172 ui::ScopedLayerAnimationSettings settings( |
| 174 background_window_->GetLayer()->GetAnimator()); | 173 background_window_->GetLayer()->GetAnimator()); |
| 175 background_window_->GetLayer()->SetOpacity(kBackdropOpacity); | 174 background_window_->GetLayer()->SetOpacity(kBackdropOpacity); |
| 176 } | 175 } |
| 177 | 176 |
| 178 } // namespace ash | 177 } // namespace ash |
| OLD | NEW |