Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2716)

Side by Side Diff: ash/wm/window_mirror_view.cc

Issue 2257763002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/wm/overview/scoped_overview_animation_settings_factory_aura.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 void WindowMirrorView::OnVisibleBoundsChanged() { 67 void WindowMirrorView::OnVisibleBoundsChanged() {
68 if (!layer_owner_ && !GetVisibleBounds().IsEmpty()) 68 if (!layer_owner_ && !GetVisibleBounds().IsEmpty())
69 InitLayerOwner(); 69 InitLayerOwner();
70 } 70 }
71 71
72 ui::LayerDelegate* WindowMirrorView::CreateDelegate( 72 ui::LayerDelegate* WindowMirrorView::CreateDelegate(
73 ui::LayerDelegate* delegate) { 73 ui::LayerDelegate* delegate) {
74 if (!delegate) 74 if (!delegate)
75 return nullptr; 75 return nullptr;
76 delegates_.push_back( 76 delegates_.push_back(
77 base::WrapUnique(new ForwardingLayerDelegate(target_, delegate))); 77 base::MakeUnique<ForwardingLayerDelegate>(target_, delegate));
78 78
79 return delegates_.back().get(); 79 return delegates_.back().get();
80 } 80 }
81 81
82 void WindowMirrorView::InitLayerOwner() { 82 void WindowMirrorView::InitLayerOwner() {
83 SetPaintToLayer(true); 83 SetPaintToLayer(true);
84 84
85 layer_owner_ = ::wm::RecreateLayers(target_->aura_window(), this); 85 layer_owner_ = ::wm::RecreateLayers(target_->aura_window(), this);
86 86
87 GetMirrorLayer()->parent()->Remove(GetMirrorLayer()); 87 GetMirrorLayer()->parent()->Remove(GetMirrorLayer());
(...skipping 18 matching lines...) Expand all
106 gfx::Rect WindowMirrorView::GetClientAreaBounds() const { 106 gfx::Rect WindowMirrorView::GetClientAreaBounds() const {
107 // The target window may not have a widget in unit tests. 107 // The target window may not have a widget in unit tests.
108 if (!target_->GetInternalWidget()) 108 if (!target_->GetInternalWidget())
109 return gfx::Rect(); 109 return gfx::Rect();
110 views::View* client_view = target_->GetInternalWidget()->client_view(); 110 views::View* client_view = target_->GetInternalWidget()->client_view();
111 return client_view->ConvertRectToWidget(client_view->GetLocalBounds()); 111 return client_view->ConvertRectToWidget(client_view->GetLocalBounds());
112 } 112 }
113 113
114 } // namespace wm 114 } // namespace wm
115 } // namespace ash 115 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/overview/scoped_overview_animation_settings_factory_aura.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698