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/memory/ptr_util.h" |
8 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
9 #include "build/build_config.h" | 10 #include "build/build_config.h" |
10 #include "third_party/skia/include/core/SkRegion.h" | 11 #include "third_party/skia/include/core/SkRegion.h" |
11 #include "ui/aura/client/aura_constants.h" | 12 #include "ui/aura/client/aura_constants.h" |
12 #include "ui/aura/client/cursor_client.h" | 13 #include "ui/aura/client/cursor_client.h" |
13 #include "ui/aura/client/focus_client.h" | 14 #include "ui/aura/client/focus_client.h" |
14 #include "ui/aura/client/screen_position_client.h" | 15 #include "ui/aura/client/screen_position_client.h" |
15 #include "ui/aura/client/window_tree_client.h" | 16 #include "ui/aura/client/window_tree_client.h" |
16 #include "ui/aura/env.h" | 17 #include "ui/aura/env.h" |
17 #include "ui/aura/window.h" | 18 #include "ui/aura/window.h" |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 } | 430 } |
430 | 431 |
431 void NativeWidgetAura::StackBelow(gfx::NativeView native_view) { | 432 void NativeWidgetAura::StackBelow(gfx::NativeView native_view) { |
432 if (window_ && window_->parent() && | 433 if (window_ && window_->parent() && |
433 window_->parent() == native_view->parent()) | 434 window_->parent() == native_view->parent()) |
434 window_->parent()->StackChildBelow(window_, native_view); | 435 window_->parent()->StackChildBelow(window_, native_view); |
435 } | 436 } |
436 | 437 |
437 void NativeWidgetAura::SetShape(SkRegion* region) { | 438 void NativeWidgetAura::SetShape(SkRegion* region) { |
438 if (window_) | 439 if (window_) |
439 window_->layer()->SetAlphaShape(make_scoped_ptr(region)); | 440 window_->layer()->SetAlphaShape(base::WrapUnique(region)); |
440 else | 441 else |
441 delete region; | 442 delete region; |
442 } | 443 } |
443 | 444 |
444 void NativeWidgetAura::Close() { | 445 void NativeWidgetAura::Close() { |
445 // |window_| may already be deleted by parent window. This can happen | 446 // |window_| may already be deleted by parent window. This can happen |
446 // when this widget is child widget or has transient parent | 447 // when this widget is child widget or has transient parent |
447 // and ownership is WIDGET_OWNS_NATIVE_WIDGET. | 448 // and ownership is WIDGET_OWNS_NATIVE_WIDGET. |
448 DCHECK(window_ || | 449 DCHECK(window_ || |
449 ownership_ == Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET); | 450 ownership_ == Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET); |
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1165 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); | 1166 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); |
1166 base::win::ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); | 1167 base::win::ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); |
1167 return gfx::FontList(gfx::Font(caption_font.get())); | 1168 return gfx::FontList(gfx::Font(caption_font.get())); |
1168 #else | 1169 #else |
1169 return gfx::FontList(); | 1170 return gfx::FontList(); |
1170 #endif | 1171 #endif |
1171 } | 1172 } |
1172 | 1173 |
1173 } // namespace internal | 1174 } // namespace internal |
1174 } // namespace views | 1175 } // namespace views |
OLD | NEW |