| 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 #include "ui/views/mus/native_widget_mus.h" | 5 #include "ui/views/mus/native_widget_mus.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| (...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 aura::client::SetCursorClient(hosted_window, cursor_manager_.get()); | 704 aura::client::SetCursorClient(hosted_window, cursor_manager_.get()); |
| 705 } | 705 } |
| 706 | 706 |
| 707 window_tree_client_.reset(new NativeWidgetMusWindowTreeClient(hosted_window)); | 707 window_tree_client_.reset(new NativeWidgetMusWindowTreeClient(hosted_window)); |
| 708 hosted_window->AddPreTargetHandler(focus_client_.get()); | 708 hosted_window->AddPreTargetHandler(focus_client_.get()); |
| 709 hosted_window->SetLayoutManager( | 709 hosted_window->SetLayoutManager( |
| 710 new ContentWindowLayoutManager(hosted_window, content_)); | 710 new ContentWindowLayoutManager(hosted_window, content_)); |
| 711 capture_client_.reset(new MusCaptureClient(hosted_window, content_, window_)); | 711 capture_client_.reset(new MusCaptureClient(hosted_window, content_, window_)); |
| 712 | 712 |
| 713 content_->SetType(ui::wm::WINDOW_TYPE_NORMAL); | 713 content_->SetType(ui::wm::WINDOW_TYPE_NORMAL); |
| 714 content_->Init(ui::LAYER_TEXTURED); | 714 content_->Init(params.layer_type); |
| 715 if (window_->visible()) | 715 if (window_->visible()) |
| 716 content_->Show(); | 716 content_->Show(); |
| 717 content_->SetTransparent(true); | 717 content_->SetTransparent(true); |
| 718 content_->SetFillsBoundsCompletely(false); | 718 content_->SetFillsBoundsCompletely(false); |
| 719 hosted_window->AddChild(content_); | 719 hosted_window->AddChild(content_); |
| 720 | 720 |
| 721 // Set-up transiency if appropriate. | 721 // Set-up transiency if appropriate. |
| 722 if (params.parent && !params.child) { | 722 if (params.parent && !params.child) { |
| 723 aura::Window* parent_root = params.parent->GetRootWindow(); | 723 aura::Window* parent_root = params.parent->GetRootWindow(); |
| 724 mus::Window* parent_mus = parent_root->GetProperty(kMusWindow); | 724 mus::Window* parent_mus = parent_root->GetProperty(kMusWindow); |
| (...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1400 | 1400 |
| 1401 gfx::Path mask_path; | 1401 gfx::Path mask_path; |
| 1402 native_widget_delegate_->GetHitTestMask(&mask_path); | 1402 native_widget_delegate_->GetHitTestMask(&mask_path); |
| 1403 // TODO(jamescook): Use the full path for the mask. | 1403 // TODO(jamescook): Use the full path for the mask. |
| 1404 gfx::Rect mask_rect = | 1404 gfx::Rect mask_rect = |
| 1405 gfx::ToEnclosingRect(gfx::SkRectToRectF(mask_path.getBounds())); | 1405 gfx::ToEnclosingRect(gfx::SkRectToRectF(mask_path.getBounds())); |
| 1406 window_->SetHitTestMask(mask_rect); | 1406 window_->SetHitTestMask(mask_rect); |
| 1407 } | 1407 } |
| 1408 | 1408 |
| 1409 } // namespace views | 1409 } // namespace views |
| OLD | NEW |