| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 // This has to be before any other includes, else default is picked up. | 5 // This has to be before any other includes, else default is picked up. |
| 6 // See base/logging for details on this. | 6 // See base/logging for details on this. |
| 7 #define NOTIMPLEMENTED_POLICY 5 | 7 #define NOTIMPLEMENTED_POLICY 5 |
| 8 | 8 |
| 9 #include "ui/views/mus/native_widget_mus.h" | 9 #include "ui/views/mus/native_widget_mus.h" |
| 10 | 10 |
| (...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 768 | 768 |
| 769 content_->SetType(ui::wm::WINDOW_TYPE_NORMAL); | 769 content_->SetType(ui::wm::WINDOW_TYPE_NORMAL); |
| 770 content_->Init(params.layer_type); | 770 content_->Init(params.layer_type); |
| 771 if (window_->visible()) | 771 if (window_->visible()) |
| 772 content_->Show(); | 772 content_->Show(); |
| 773 content_->SetTransparent(true); | 773 content_->SetTransparent(true); |
| 774 content_->SetFillsBoundsCompletely(false); | 774 content_->SetFillsBoundsCompletely(false); |
| 775 content_->set_ignore_events(!params.accept_events); | 775 content_->set_ignore_events(!params.accept_events); |
| 776 hosted_window->AddChild(content_); | 776 hosted_window->AddChild(content_); |
| 777 | 777 |
| 778 ui::Window* parent_mus = params.parent_mus; |
| 779 |
| 778 // Set-up transiency if appropriate. | 780 // Set-up transiency if appropriate. |
| 779 if (params.parent && !params.child) { | 781 if (params.parent && !params.child) { |
| 780 aura::Window* parent_root = params.parent->GetRootWindow(); | 782 aura::Window* parent_root_aura = params.parent->GetRootWindow(); |
| 781 ui::Window* parent_mus = parent_root->GetProperty(kMusWindow); | 783 ui::Window* parent_root_mus = parent_root_aura->GetProperty(kMusWindow); |
| 782 if (parent_mus) | 784 if (parent_root_mus) { |
| 783 parent_mus->AddTransientWindow(window_); | 785 parent_root_mus->AddTransientWindow(window_); |
| 786 if (!parent_mus) |
| 787 parent_mus = parent_root_mus; |
| 788 } |
| 784 } | 789 } |
| 785 | 790 |
| 786 if (params.parent_mus) | 791 if (parent_mus) |
| 787 params.parent_mus->AddChild(window_); | 792 parent_mus->AddChild(window_); |
| 788 | 793 |
| 789 // TODO(sky): deal with show state. | 794 // TODO(sky): deal with show state. |
| 790 if (!params.bounds.size().IsEmpty()) | 795 if (!params.bounds.size().IsEmpty()) |
| 791 SetBounds(params.bounds); | 796 SetBounds(params.bounds); |
| 792 | 797 |
| 793 // TODO(beng): much else, see [Desktop]NativeWidgetAura. | 798 // TODO(beng): much else, see [Desktop]NativeWidgetAura. |
| 794 | 799 |
| 795 native_widget_delegate_->OnNativeWidgetCreated(false); | 800 native_widget_delegate_->OnNativeWidgetCreated(false); |
| 796 } | 801 } |
| 797 | 802 |
| (...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1569 | 1574 |
| 1570 gfx::Path mask_path; | 1575 gfx::Path mask_path; |
| 1571 native_widget_delegate_->GetHitTestMask(&mask_path); | 1576 native_widget_delegate_->GetHitTestMask(&mask_path); |
| 1572 // TODO(jamescook): Use the full path for the mask. | 1577 // TODO(jamescook): Use the full path for the mask. |
| 1573 gfx::Rect mask_rect = | 1578 gfx::Rect mask_rect = |
| 1574 gfx::ToEnclosingRect(gfx::SkRectToRectF(mask_path.getBounds())); | 1579 gfx::ToEnclosingRect(gfx::SkRectToRectF(mask_path.getBounds())); |
| 1575 window_->SetHitTestMask(mask_rect); | 1580 window_->SetHitTestMask(mask_rect); |
| 1576 } | 1581 } |
| 1577 | 1582 |
| 1578 } // namespace views | 1583 } // namespace views |
| OLD | NEW |