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 "components/exo/shell_surface.h" | 5 #include "components/exo/shell_surface.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ash/aura/wm_window_aura.h" | 9 #include "ash/aura/wm_window_aura.h" |
10 #include "ash/common/shelf/wm_shelf.h" | 10 #include "ash/common/shelf/wm_shelf.h" |
(...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1013 // region is non-empty. See OnCommitSurface() for more details. | 1013 // region is non-empty. See OnCommitSurface() for more details. |
1014 if (container_ == ash::kShellWindowId_SystemModalContainer) | 1014 if (container_ == ash::kShellWindowId_SystemModalContainer) |
1015 activatable &= !surface_->GetHitTestBounds().IsEmpty(); | 1015 activatable &= !surface_->GetHitTestBounds().IsEmpty(); |
1016 params.activatable = activatable ? views::Widget::InitParams::ACTIVATABLE_YES | 1016 params.activatable = activatable ? views::Widget::InitParams::ACTIVATABLE_YES |
1017 : views::Widget::InitParams::ACTIVATABLE_NO; | 1017 : views::Widget::InitParams::ACTIVATABLE_NO; |
1018 | 1018 |
1019 // Note: NativeWidget owns this widget. | 1019 // Note: NativeWidget owns this widget. |
1020 widget_ = new ShellSurfaceWidget(this); | 1020 widget_ = new ShellSurfaceWidget(this); |
1021 widget_->Init(params); | 1021 widget_->Init(params); |
1022 | 1022 |
1023 views::View* root_view = widget_->GetRootView(); | |
1024 if (root_view != nullptr) { | |
reveman
2016/11/30 17:00:40
nit: s/root_view != nullptr/root_view/
when is th
yawano
2016/12/01 00:24:23
Done. I don't come up case where it becomes null.
| |
1025 root_view->SetFocusBehavior(views::View::FocusBehavior::NEVER); | |
reveman
2016/11/30 17:00:40
Can you explain in the description of this change
yawano
2016/12/01 00:24:23
Added comment.
| |
1026 } | |
1027 | |
1023 aura::Window* window = widget_->GetNativeWindow(); | 1028 aura::Window* window = widget_->GetNativeWindow(); |
1024 window->SetName("ExoShellSurface"); | 1029 window->SetName("ExoShellSurface"); |
1025 window->AddChild(surface_->window()); | 1030 window->AddChild(surface_->window()); |
1026 window->SetEventTargeter(base::WrapUnique(new CustomWindowTargeter(widget_))); | 1031 window->SetEventTargeter(base::WrapUnique(new CustomWindowTargeter(widget_))); |
1027 SetApplicationId(window, application_id_); | 1032 SetApplicationId(window, application_id_); |
1028 SetMainSurface(window, surface_); | 1033 SetMainSurface(window, surface_); |
1029 | 1034 |
1030 // Start tracking changes to window bounds and window state. | 1035 // Start tracking changes to window bounds and window state. |
1031 window->AddObserver(this); | 1036 window->AddObserver(this); |
1032 ash::wm::WindowState* window_state = ash::wm::GetWindowState(window); | 1037 ash::wm::WindowState* window_state = ash::wm::GetWindowState(window); |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1402 shadow_overlay_->layer()->Add(shadow->layer()); | 1407 shadow_overlay_->layer()->Add(shadow->layer()); |
1403 window->AddChild(shadow_overlay_); | 1408 window->AddChild(shadow_overlay_); |
1404 shadow_overlay_->Show(); | 1409 shadow_overlay_->Show(); |
1405 } | 1410 } |
1406 shadow_overlay_->SetBounds(shadow_bounds); | 1411 shadow_overlay_->SetBounds(shadow_bounds); |
1407 shadow->SetContentBounds(gfx::Rect(shadow_bounds.size())); | 1412 shadow->SetContentBounds(gfx::Rect(shadow_bounds.size())); |
1408 } | 1413 } |
1409 } | 1414 } |
1410 | 1415 |
1411 } // namespace exo | 1416 } // namespace exo |
OLD | NEW |