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 "components/exo/shell_surface.h" | 5 #include "components/exo/shell_surface.h" |
| 6 | 6 |
| 7 #include "ash/aura/wm_window_aura.h" | 7 #include "ash/aura/wm_window_aura.h" |
| 8 #include "ash/common/shell_window_ids.h" | 8 #include "ash/common/shell_window_ids.h" |
| 9 #include "ash/common/wm/window_resizer.h" | 9 #include "ash/common/wm/window_resizer.h" |
| 10 #include "ash/common/wm/window_state.h" | 10 #include "ash/common/wm/window_state.h" |
| (...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 880 DCHECK(!widget_); | 880 DCHECK(!widget_); |
| 881 | 881 |
| 882 views::Widget::InitParams params; | 882 views::Widget::InitParams params; |
| 883 params.type = views::Widget::InitParams::TYPE_WINDOW; | 883 params.type = views::Widget::InitParams::TYPE_WINDOW; |
| 884 params.ownership = views::Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET; | 884 params.ownership = views::Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET; |
| 885 params.delegate = this; | 885 params.delegate = this; |
| 886 params.shadow_type = views::Widget::InitParams::SHADOW_TYPE_NONE; | 886 params.shadow_type = views::Widget::InitParams::SHADOW_TYPE_NONE; |
| 887 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 887 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
| 888 params.show_state = show_state; | 888 params.show_state = show_state; |
| 889 params.parent = | 889 params.parent = |
| 890 ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), container_); | 890 ash::Shell::GetContainer(ash::Shell::GetTargetRootWindow(), container_); |
|
reveman
2016/07/26 14:46:01
When |parent_| is set then this needs to be the sa
Dominik Laskowski
2016/07/26 23:13:38
Good point. See my reply below.
| |
| 891 params.bounds = initial_bounds_; | 891 params.bounds = initial_bounds_; |
|
oshima
2016/07/26 01:07:11
This isn't correct (at least for arc++).
I think
reveman
2016/07/26 14:46:01
Initial bounds are always "gfx::Rect(1, 1)" for ar
oshima
2016/07/26 20:40:56
If the initial bounds is set in screen coordinate,
reveman
2016/07/26 21:38:33
Initial bounds is parent origin + offset provided
Dominik Laskowski
2016/07/26 23:13:38
Initial bounds are in screen coordinates regardles
| |
| 892 bool activatable = activatable_; | 892 bool activatable = activatable_; |
| 893 // ShellSurfaces in system modal container are only activatable if input | 893 // ShellSurfaces in system modal container are only activatable if input |
| 894 // region is non-empty. See OnCommitSurface() for more details. | 894 // region is non-empty. See OnCommitSurface() for more details. |
| 895 if (container_ == ash::kShellWindowId_SystemModalContainer) | 895 if (container_ == ash::kShellWindowId_SystemModalContainer) |
| 896 activatable &= !surface_->GetHitTestBounds().IsEmpty(); | 896 activatable &= !surface_->GetHitTestBounds().IsEmpty(); |
| 897 params.activatable = activatable ? views::Widget::InitParams::ACTIVATABLE_YES | 897 params.activatable = activatable ? views::Widget::InitParams::ACTIVATABLE_YES |
| 898 : views::Widget::InitParams::ACTIVATABLE_NO; | 898 : views::Widget::InitParams::ACTIVATABLE_NO; |
| 899 | 899 |
| 900 // Note: NativeWidget owns this widget. | 900 // Note: NativeWidget owns this widget. |
| 901 widget_ = new ShellSurfaceWidget(this); | 901 widget_ = new ShellSurfaceWidget(this); |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1224 shadow_origin -= origin.OffsetFromOrigin(); | 1224 shadow_origin -= origin.OffsetFromOrigin(); |
| 1225 gfx::Rect shadow_bounds(shadow_origin, shadow_content_bounds_.size()); | 1225 gfx::Rect shadow_bounds(shadow_origin, shadow_content_bounds_.size()); |
| 1226 | 1226 |
| 1227 shadow_overlay_->SetBounds(shadow_bounds); | 1227 shadow_overlay_->SetBounds(shadow_bounds); |
| 1228 shadow_underlay_->SetBounds(shadow_bounds); | 1228 shadow_underlay_->SetBounds(shadow_bounds); |
| 1229 shadow->SetContentBounds(gfx::Rect(shadow_bounds.size())); | 1229 shadow->SetContentBounds(gfx::Rect(shadow_bounds.size())); |
| 1230 } | 1230 } |
| 1231 } | 1231 } |
| 1232 | 1232 |
| 1233 } // namespace exo | 1233 } // namespace exo |
| OLD | NEW |