| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/views/widget/native_widget_aura.h" | 5 #include "ui/views/widget/native_widget_aura.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 if (window_) | 441 if (window_) |
| 442 window_->parent()->StackChildAtTop(window_); | 442 window_->parent()->StackChildAtTop(window_); |
| 443 } | 443 } |
| 444 | 444 |
| 445 void NativeWidgetAura::StackBelow(gfx::NativeView native_view) { | 445 void NativeWidgetAura::StackBelow(gfx::NativeView native_view) { |
| 446 if (window_ && window_->parent() && | 446 if (window_ && window_->parent() && |
| 447 window_->parent() == native_view->parent()) | 447 window_->parent() == native_view->parent()) |
| 448 window_->parent()->StackChildBelow(window_, native_view); | 448 window_->parent()->StackChildBelow(window_, native_view); |
| 449 } | 449 } |
| 450 | 450 |
| 451 void NativeWidgetAura::SetShape(SkRegion* region) { | 451 void NativeWidgetAura::SetShape(std::unique_ptr<SkRegion> region) { |
| 452 if (window_) | 452 if (window_) |
| 453 window_->layer()->SetAlphaShape(base::WrapUnique(region)); | 453 window_->layer()->SetAlphaShape(std::move(region)); |
| 454 else | |
| 455 delete region; | |
| 456 } | 454 } |
| 457 | 455 |
| 458 void NativeWidgetAura::Close() { | 456 void NativeWidgetAura::Close() { |
| 459 // |window_| may already be deleted by parent window. This can happen | 457 // |window_| may already be deleted by parent window. This can happen |
| 460 // when this widget is child widget or has transient parent | 458 // when this widget is child widget or has transient parent |
| 461 // and ownership is WIDGET_OWNS_NATIVE_WIDGET. | 459 // and ownership is WIDGET_OWNS_NATIVE_WIDGET. |
| 462 DCHECK(window_ || | 460 DCHECK(window_ || |
| 463 ownership_ == Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET); | 461 ownership_ == Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET); |
| 464 if (window_) { | 462 if (window_) { |
| 465 window_->SuppressPaint(); | 463 window_->SuppressPaint(); |
| (...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1198 gfx::NativeView native_view) { | 1196 gfx::NativeView native_view) { |
| 1199 aura::client::CaptureClient* capture_client = | 1197 aura::client::CaptureClient* capture_client = |
| 1200 aura::client::GetCaptureClient(native_view->GetRootWindow()); | 1198 aura::client::GetCaptureClient(native_view->GetRootWindow()); |
| 1201 if (!capture_client) | 1199 if (!capture_client) |
| 1202 return nullptr; | 1200 return nullptr; |
| 1203 return capture_client->GetGlobalCaptureWindow(); | 1201 return capture_client->GetGlobalCaptureWindow(); |
| 1204 } | 1202 } |
| 1205 | 1203 |
| 1206 } // namespace internal | 1204 } // namespace internal |
| 1207 } // namespace views | 1205 } // namespace views |
| OLD | NEW |