| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/desktop_window_tree_host_mus.h" | 5 #include "ui/views/mus/desktop_window_tree_host_mus.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/threading/thread_task_runner_handle.h" | 8 #include "base/threading/thread_task_runner_handle.h" |
| 9 #include "ui/aura/client/aura_constants.h" | 9 #include "ui/aura/client/aura_constants.h" |
| 10 #include "ui/aura/client/cursor_client.h" | 10 #include "ui/aura/client/cursor_client.h" |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 } | 399 } |
| 400 | 400 |
| 401 void DesktopWindowTreeHostMus::SetSize(const gfx::Size& size) { | 401 void DesktopWindowTreeHostMus::SetSize(const gfx::Size& size) { |
| 402 // Use GetBounds() as the origin of window() is always at 0, 0. | 402 // Use GetBounds() as the origin of window() is always at 0, 0. |
| 403 gfx::Rect screen_bounds = | 403 gfx::Rect screen_bounds = |
| 404 gfx::ConvertRectToDIP(GetScaleFactor(), GetBoundsInPixels()); | 404 gfx::ConvertRectToDIP(GetScaleFactor(), GetBoundsInPixels()); |
| 405 screen_bounds.set_size(size); | 405 screen_bounds.set_size(size); |
| 406 SetBoundsInDIP(screen_bounds); | 406 SetBoundsInDIP(screen_bounds); |
| 407 } | 407 } |
| 408 | 408 |
| 409 void DesktopWindowTreeHostMus::StackAbove(aura::Window* window) { | 409 void DesktopWindowTreeHostMus::StackAbove(aura::Window* relative) { |
| 410 // TODO: implement window stacking, http://crbug.com/663617. | 410 // Windows and X11 check for |relative| being nullptr and fail silently. It |
| 411 NOTIMPLEMENTED(); | 411 // also looks like |relative| is usually multiple children deep in the root |
| 412 // window, which we must pass instead. |
| 413 if (relative && relative->GetRootWindow()) |
| 414 WindowTreeHostMus::StackAbove(relative->GetRootWindow()); |
| 412 } | 415 } |
| 413 | 416 |
| 414 void DesktopWindowTreeHostMus::StackAtTop() { | 417 void DesktopWindowTreeHostMus::StackAtTop() { |
| 415 // Request to the server to stack our current mus window at the top. Our | 418 // Request to the server to stack our current mus window at the top. Our |
| 416 // window() is a root, and we can't reach up past it so we can't just request | 419 // window() is a root, and we can't reach up past it so we can't just request |
| 417 // a Reorder(), which is what we'd do to reorder our own subwindows. | 420 // a Reorder(), which is what we'd do to reorder our own subwindows. |
| 418 WindowTreeHostMus::StackAtTop(); | 421 WindowTreeHostMus::StackAtTop(); |
| 419 } | 422 } |
| 420 | 423 |
| 421 void DesktopWindowTreeHostMus::CenterWindow(const gfx::Size& size) { | 424 void DesktopWindowTreeHostMus::CenterWindow(const gfx::Size& size) { |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 aura::client::FocusClient* focus_client, | 732 aura::client::FocusClient* focus_client, |
| 730 aura::Window* window) { | 733 aura::Window* window) { |
| 731 if (window == this->window()) { | 734 if (window == this->window()) { |
| 732 desktop_native_widget_aura_->HandleActivationChanged(true); | 735 desktop_native_widget_aura_->HandleActivationChanged(true); |
| 733 } else if (is_active_) { | 736 } else if (is_active_) { |
| 734 desktop_native_widget_aura_->HandleActivationChanged(false); | 737 desktop_native_widget_aura_->HandleActivationChanged(false); |
| 735 } | 738 } |
| 736 } | 739 } |
| 737 | 740 |
| 738 } // namespace views | 741 } // namespace views |
| OLD | NEW |