Chromium Code Reviews| Index: ash/mus/root_window_controller.cc |
| diff --git a/ash/mus/root_window_controller.cc b/ash/mus/root_window_controller.cc |
| index 4279731f0df65714c0b6267737bf9c288226dab0..7c7bdae6baf8d6595035ac364e037dd534117f76 100644 |
| --- a/ash/mus/root_window_controller.cc |
| +++ b/ash/mus/root_window_controller.cc |
| @@ -102,9 +102,21 @@ ui::Window* RootWindowController::NewTopLevelWindow( |
| if (GetRequestedContainer(window, &container_id)) { |
| container_window = GetWindowByShellWindowId(container_id)->mus_window(); |
| } else { |
| - // TODO(sky): window->bounds() isn't quite right. |
| + const gfx::Point& screen_point_top_right = |
|
mfomitchev
2016/11/18 17:36:24
Nit: Any particular reason you are using const ref
thanhph
2016/11/18 19:15:44
Done.
|
| + wm_root_window_controller_->ConvertPointToScreen( |
| + WmWindowMus::Get(window), window->bounds().top_right()); |
| + |
| + const gfx::Point& screen_point_bottom_left = |
| + wm_root_window_controller_->ConvertPointToScreen( |
| + WmWindowMus::Get(window), window->bounds().bottom_left()); |
| + |
| + const gfx::Rect& screen_bound = |
|
mfomitchev
2016/11/18 17:36:24
The variable name is a little confusing - sounds l
thanhph
2016/11/18 19:15:44
Done. Thanks!
|
| + gfx::Rect(screen_point_bottom_left.x(), screen_point_top_right.y(), |
| + screen_point_top_right.x() - screen_point_bottom_left.x(), |
| + screen_point_bottom_left.y() - screen_point_top_right.y()); |
| + |
| container_window = WmWindowMus::GetMusWindow(wm::GetDefaultParent( |
| - WmWindowMus::Get(root_), WmWindowMus::Get(window), window->bounds())); |
| + WmWindowMus::Get(root_), WmWindowMus::Get(window), screen_bound)); |
| } |
| DCHECK(WmWindowMus::Get(container_window)->IsContainer()); |
| @@ -114,9 +126,7 @@ ui::Window* RootWindowController::NewTopLevelWindow( |
| } else { |
| container_window->AddChild(window); |
| } |
| - |
| window_count_++; |
| - |
| return window; |
| } |