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/frame/custom_frame_view_ash.h" | 9 #include "ash/frame/custom_frame_view_ash.h" |
10 #include "ash/public/cpp/shelf_types.h" | 10 #include "ash/public/cpp/shelf_types.h" |
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1126 DCHECK(!widget_); | 1126 DCHECK(!widget_); |
1127 | 1127 |
1128 views::Widget::InitParams params; | 1128 views::Widget::InitParams params; |
1129 params.type = views::Widget::InitParams::TYPE_WINDOW; | 1129 params.type = views::Widget::InitParams::TYPE_WINDOW; |
1130 params.ownership = views::Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET; | 1130 params.ownership = views::Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET; |
1131 params.delegate = this; | 1131 params.delegate = this; |
1132 params.shadow_type = views::Widget::InitParams::SHADOW_TYPE_NONE; | 1132 params.shadow_type = views::Widget::InitParams::SHADOW_TYPE_NONE; |
1133 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 1133 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
1134 params.show_state = show_state; | 1134 params.show_state = show_state; |
1135 // Make shell surface a transient child if |parent_| has been set. | 1135 // Make shell surface a transient child if |parent_| has been set. |
1136 params.parent = | 1136 params.parent = parent_ ? parent_ |
1137 parent_ ? parent_ : WMHelper::GetInstance()->GetContainer(container_); | 1137 : WMHelper::GetInstance()->GetContainer( |
| 1138 primary_display_id_, container_); |
1138 params.bounds = gfx::Rect(origin_, gfx::Size()); | 1139 params.bounds = gfx::Rect(origin_, gfx::Size()); |
1139 bool activatable = activatable_; | 1140 bool activatable = activatable_; |
1140 // ShellSurfaces in system modal container are only activatable if input | 1141 // ShellSurfaces in system modal container are only activatable if input |
1141 // region is non-empty. See OnCommitSurface() for more details. | 1142 // region is non-empty. See OnCommitSurface() for more details. |
1142 if (container_ == ash::kShellWindowId_SystemModalContainer) | 1143 if (container_ == ash::kShellWindowId_SystemModalContainer) |
1143 activatable &= !surface_->GetHitTestBounds().IsEmpty(); | 1144 activatable &= !surface_->GetHitTestBounds().IsEmpty(); |
1144 params.activatable = activatable ? views::Widget::InitParams::ACTIVATABLE_YES | 1145 params.activatable = activatable ? views::Widget::InitParams::ACTIVATABLE_YES |
1145 : views::Widget::InitParams::ACTIVATABLE_NO; | 1146 : views::Widget::InitParams::ACTIVATABLE_NO; |
1146 | 1147 |
1147 // Note: NativeWidget owns this widget. | 1148 // Note: NativeWidget owns this widget. |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1668 gfx::Point ShellSurface::GetMouseLocation() const { | 1669 gfx::Point ShellSurface::GetMouseLocation() const { |
1669 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow(); | 1670 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow(); |
1670 gfx::Point location = | 1671 gfx::Point location = |
1671 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot(); | 1672 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot(); |
1672 aura::Window::ConvertPointToTarget( | 1673 aura::Window::ConvertPointToTarget( |
1673 root_window, widget_->GetNativeWindow()->parent(), &location); | 1674 root_window, widget_->GetNativeWindow()->parent(), &location); |
1674 return location; | 1675 return location; |
1675 } | 1676 } |
1676 | 1677 |
1677 } // namespace exo | 1678 } // namespace exo |
OLD | NEW |