OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/window_mirror_view.h" | 5 #include "ash/wm/window_mirror_view.h" |
6 | 6 |
7 #include "ash/common/wm/window_state.h" | 7 #include "ash/common/wm/window_state.h" |
8 #include "ash/common/wm_window.h" | 8 #include "ash/common/wm_window.h" |
9 #include "ash/common/wm_window_property.h" | 9 #include "ash/common/wm_window_property.h" |
10 #include "ash/wm/window_state_aura.h" | 10 #include "ash/wm/window_state_aura.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 void WindowMirrorView::InitLayerOwner() { | 80 void WindowMirrorView::InitLayerOwner() { |
81 if (!layer_owner_) { | 81 if (!layer_owner_) { |
82 target_->aura_window()->SetProperty(aura::client::kMirroringEnabledKey, | 82 target_->aura_window()->SetProperty(aura::client::kMirroringEnabledKey, |
83 true); | 83 true); |
84 } | 84 } |
85 | 85 |
86 layer_owner_ = | 86 layer_owner_ = |
87 ::wm::MirrorLayers(target_->aura_window(), false /* sync_bounds */); | 87 ::wm::MirrorLayers(target_->aura_window(), false /* sync_bounds */); |
88 | 88 |
89 SetPaintToLayer(true); | 89 SetPaintToLayer(); |
90 layer()->Add(GetMirrorLayer()); | 90 layer()->Add(GetMirrorLayer()); |
91 // This causes us to clip the non-client areas of the window. | 91 // This causes us to clip the non-client areas of the window. |
92 layer()->SetMasksToBounds(true); | 92 layer()->SetMasksToBounds(true); |
93 | 93 |
94 // Some extra work is needed when the target window is minimized. | 94 // Some extra work is needed when the target window is minimized. |
95 if (target_->GetWindowState()->IsMinimized()) { | 95 if (target_->GetWindowState()->IsMinimized()) { |
96 GetMirrorLayer()->SetOpacity(1); | 96 GetMirrorLayer()->SetOpacity(1); |
97 EnsureAllChildrenAreVisible(GetMirrorLayer()); | 97 EnsureAllChildrenAreVisible(GetMirrorLayer()); |
98 } | 98 } |
99 | 99 |
(...skipping 13 matching lines...) Expand all Loading... |
113 } | 113 } |
114 // The target window may not have a widget in unit tests. | 114 // The target window may not have a widget in unit tests. |
115 if (!target_->GetInternalWidget()) | 115 if (!target_->GetInternalWidget()) |
116 return gfx::Rect(); | 116 return gfx::Rect(); |
117 views::View* client_view = target_->GetInternalWidget()->client_view(); | 117 views::View* client_view = target_->GetInternalWidget()->client_view(); |
118 return client_view->ConvertRectToWidget(client_view->GetLocalBounds()); | 118 return client_view->ConvertRectToWidget(client_view->GetLocalBounds()); |
119 } | 119 } |
120 | 120 |
121 } // namespace wm | 121 } // namespace wm |
122 } // namespace ash | 122 } // namespace ash |
OLD | NEW |