Chromium Code Reviews| 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 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 675 return new ClientSideNonClientFrameView(GetWidget()); | 675 return new ClientSideNonClientFrameView(GetWidget()); |
| 676 } | 676 } |
| 677 | 677 |
| 678 void NativeWidgetMus::InitNativeWidget(const Widget::InitParams& params) { | 678 void NativeWidgetMus::InitNativeWidget(const Widget::InitParams& params) { |
| 679 NativeWidgetAura::RegisterNativeWidgetForWindow(this, content_); | 679 NativeWidgetAura::RegisterNativeWidgetForWindow(this, content_); |
| 680 aura::Window* hosted_window = window_tree_host_->window(); | 680 aura::Window* hosted_window = window_tree_host_->window(); |
| 681 | 681 |
| 682 ownership_ = params.ownership; | 682 ownership_ = params.ownership; |
| 683 window_->SetCanFocus(params.activatable == | 683 window_->SetCanFocus(params.activatable == |
| 684 Widget::InitParams::ACTIVATABLE_YES); | 684 Widget::InitParams::ACTIVATABLE_YES); |
| 685 if (!params.accept_events) | |
| 686 window_->SetAcceptEvents(params.accept_events); | |
|
sadrul
2016/07/09 14:51:22
You can do this unconditionally (like SetCanFocus
riajiang
2016/07/11 15:48:38
Changed it to do the checking in window_tree_clien
| |
| 685 | 687 |
| 686 window_tree_host_->AddObserver(this); | 688 window_tree_host_->AddObserver(this); |
| 687 window_tree_host_->InitHost(); | 689 window_tree_host_->InitHost(); |
| 688 hosted_window->SetProperty(kMusWindow, window_); | 690 hosted_window->SetProperty(kMusWindow, window_); |
| 689 | 691 |
| 690 focus_client_.reset( | 692 focus_client_.reset( |
| 691 new FocusControllerMus(new FocusRulesImpl(hosted_window))); | 693 new FocusControllerMus(new FocusRulesImpl(hosted_window))); |
| 692 | 694 |
| 693 aura::client::SetFocusClient(hosted_window, focus_client_.get()); | 695 aura::client::SetFocusClient(hosted_window, focus_client_.get()); |
| 694 aura::client::SetActivationClient(hosted_window, focus_client_.get()); | 696 aura::client::SetActivationClient(hosted_window, focus_client_.get()); |
| (...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1401 | 1403 |
| 1402 gfx::Path mask_path; | 1404 gfx::Path mask_path; |
| 1403 native_widget_delegate_->GetHitTestMask(&mask_path); | 1405 native_widget_delegate_->GetHitTestMask(&mask_path); |
| 1404 // TODO(jamescook): Use the full path for the mask. | 1406 // TODO(jamescook): Use the full path for the mask. |
| 1405 gfx::Rect mask_rect = | 1407 gfx::Rect mask_rect = |
| 1406 gfx::ToEnclosingRect(gfx::SkRectToRectF(mask_path.getBounds())); | 1408 gfx::ToEnclosingRect(gfx::SkRectToRectF(mask_path.getBounds())); |
| 1407 window_->SetHitTestMask(mask_rect); | 1409 window_->SetHitTestMask(mask_rect); |
| 1408 } | 1410 } |
| 1409 | 1411 |
| 1410 } // namespace views | 1412 } // namespace views |
| OLD | NEW |