| 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/aura/wm_window_aura.h" | 7 #include "ash/aura/wm_window_aura.h" |
| 8 #include "ash/common/wm/forwarding_layer_delegate.h" | 8 #include "ash/common/wm/forwarding_layer_delegate.h" |
| 9 #include "ash/common/wm/window_state.h" | 9 #include "ash/common/wm/window_state.h" |
| 10 #include "ash/wm/window_state_aura.h" | 10 #include "ash/wm/window_state_aura.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 } | 97 } |
| 98 | 98 |
| 99 Layout(); | 99 Layout(); |
| 100 } | 100 } |
| 101 | 101 |
| 102 ui::Layer* WindowMirrorView::GetMirrorLayer() { | 102 ui::Layer* WindowMirrorView::GetMirrorLayer() { |
| 103 return layer_owner_->root(); | 103 return layer_owner_->root(); |
| 104 } | 104 } |
| 105 | 105 |
| 106 gfx::Rect WindowMirrorView::GetClientAreaBounds() const { | 106 gfx::Rect WindowMirrorView::GetClientAreaBounds() const { |
| 107 // The target window may not have a widget in unit tests. |
| 108 if (!target_->GetInternalWidget()) |
| 109 return gfx::Rect(); |
| 107 views::View* client_view = target_->GetInternalWidget()->client_view(); | 110 views::View* client_view = target_->GetInternalWidget()->client_view(); |
| 108 return client_view->ConvertRectToWidget(client_view->GetLocalBounds()); | 111 return client_view->ConvertRectToWidget(client_view->GetLocalBounds()); |
| 109 } | 112 } |
| 110 | 113 |
| 111 } // namespace wm | 114 } // namespace wm |
| 112 } // namespace ash | 115 } // namespace ash |
| OLD | NEW |