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/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "third_party/skia/include/core/SkRegion.h" | 9 #include "third_party/skia/include/core/SkRegion.h" |
10 #include "ui/aura/client/aura_constants.h" | 10 #include "ui/aura/client/aura_constants.h" |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 window_->parent()->StackChildAtTop(window_); | 431 window_->parent()->StackChildAtTop(window_); |
432 } | 432 } |
433 | 433 |
434 void NativeWidgetAura::StackBelow(gfx::NativeView native_view) { | 434 void NativeWidgetAura::StackBelow(gfx::NativeView native_view) { |
435 if (window_ && window_->parent() && | 435 if (window_ && window_->parent() && |
436 window_->parent() == native_view->parent()) | 436 window_->parent() == native_view->parent()) |
437 window_->parent()->StackChildBelow(window_, native_view); | 437 window_->parent()->StackChildBelow(window_, native_view); |
438 } | 438 } |
439 | 439 |
440 void NativeWidgetAura::SetShape(gfx::NativeRegion region) { | 440 void NativeWidgetAura::SetShape(gfx::NativeRegion region) { |
441 // No need for this. Just delete and ignore. | 441 if (window_) |
442 delete region; | 442 window_->layer()->SetAlphaShape(make_scoped_ptr(region)); |
| 443 else |
| 444 delete region; |
443 } | 445 } |
444 | 446 |
445 void NativeWidgetAura::Close() { | 447 void NativeWidgetAura::Close() { |
446 // |window_| may already be deleted by parent window. This can happen | 448 // |window_| may already be deleted by parent window. This can happen |
447 // when this widget is child widget or has transient parent | 449 // when this widget is child widget or has transient parent |
448 // and ownership is WIDGET_OWNS_NATIVE_WIDGET. | 450 // and ownership is WIDGET_OWNS_NATIVE_WIDGET. |
449 DCHECK(window_ || | 451 DCHECK(window_ || |
450 ownership_ == Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET); | 452 ownership_ == Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET); |
451 if (window_) { | 453 if (window_) { |
452 window_->SuppressPaint(); | 454 window_->SuppressPaint(); |
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1152 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); | 1154 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); |
1153 base::win::ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); | 1155 base::win::ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); |
1154 return gfx::FontList(gfx::Font(caption_font)); | 1156 return gfx::FontList(gfx::Font(caption_font)); |
1155 #else | 1157 #else |
1156 return gfx::FontList(); | 1158 return gfx::FontList(); |
1157 #endif | 1159 #endif |
1158 } | 1160 } |
1159 | 1161 |
1160 } // namespace internal | 1162 } // namespace internal |
1161 } // namespace views | 1163 } // namespace views |
OLD | NEW |