| 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 "components/exo/wm_helper_mus.h" | 5 #include "components/exo/wm_helper_mus.h" |
| 6 | 6 |
| 7 #include "ash/common/display/display_info.h" | |
| 8 #include "services/ui/public/cpp/window_tree_client.h" | 7 #include "services/ui/public/cpp/window_tree_client.h" |
| 9 #include "ui/aura/client/focus_client.h" | 8 #include "ui/aura/client/focus_client.h" |
| 10 #include "ui/aura/env.h" | 9 #include "ui/aura/env.h" |
| 11 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
| 11 #include "ui/display/manager/managed_display_info.h" |
| 12 #include "ui/views/mus/native_widget_mus.h" | 12 #include "ui/views/mus/native_widget_mus.h" |
| 13 #include "ui/views/mus/window_manager_connection.h" | 13 #include "ui/views/mus/window_manager_connection.h" |
| 14 #include "ui/views/widget/widget.h" | 14 #include "ui/views/widget/widget.h" |
| 15 | 15 |
| 16 namespace exo { | 16 namespace exo { |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| 19 aura::Window* GetToplevelAuraWindow(ui::Window* window) { | 19 aura::Window* GetToplevelAuraWindow(ui::Window* window) { |
| 20 DCHECK(window); | 20 DCHECK(window); |
| 21 // We never create child ui::Window, so window->parent() should be null. | 21 // We never create child ui::Window, so window->parent() should be null. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 } | 66 } |
| 67 | 67 |
| 68 WMHelperMus::~WMHelperMus() { | 68 WMHelperMus::~WMHelperMus() { |
| 69 views::WindowManagerConnection::Get()->client()->RemoveObserver(this); | 69 views::WindowManagerConnection::Get()->client()->RemoveObserver(this); |
| 70 aura::Env::GetInstance()->RemoveObserver(this); | 70 aura::Env::GetInstance()->RemoveObserver(this); |
| 71 } | 71 } |
| 72 | 72 |
| 73 //////////////////////////////////////////////////////////////////////////////// | 73 //////////////////////////////////////////////////////////////////////////////// |
| 74 // WMHelperMus, private: | 74 // WMHelperMus, private: |
| 75 | 75 |
| 76 const ash::DisplayInfo WMHelperMus::GetDisplayInfo(int64_t display_id) const { | 76 const ui::ManagedDisplayInfo WMHelperMus::GetDisplayInfo( |
| 77 int64_t display_id) const { |
| 77 // TODO(penghuang): Return real display info when it is supported in mus. | 78 // TODO(penghuang): Return real display info when it is supported in mus. |
| 78 return ash::DisplayInfo(display_id, "", false); | 79 return ui::ManagedDisplayInfo(display_id, "", false); |
| 79 } | 80 } |
| 80 | 81 |
| 81 aura::Window* WMHelperMus::GetContainer(int container_id) { | 82 aura::Window* WMHelperMus::GetContainer(int container_id) { |
| 82 NOTIMPLEMENTED(); | 83 NOTIMPLEMENTED(); |
| 83 return nullptr; | 84 return nullptr; |
| 84 } | 85 } |
| 85 | 86 |
| 86 aura::Window* WMHelperMus::GetActiveWindow() const { | 87 aura::Window* WMHelperMus::GetActiveWindow() const { |
| 87 ui::Window* window = | 88 ui::Window* window = |
| 88 views::WindowManagerConnection::Get()->client()->GetFocusedWindow(); | 89 views::WindowManagerConnection::Get()->client()->GetFocusedWindow(); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 | 174 |
| 174 void WMHelperMus::OnWindowFocused(aura::Window* gained_focus, | 175 void WMHelperMus::OnWindowFocused(aura::Window* gained_focus, |
| 175 aura::Window* lost_focus) { | 176 aura::Window* lost_focus) { |
| 176 if (focused_window_ != gained_focus) { | 177 if (focused_window_ != gained_focus) { |
| 177 focused_window_ = gained_focus; | 178 focused_window_ = gained_focus; |
| 178 NotifyWindowFocused(gained_focus, lost_focus); | 179 NotifyWindowFocused(gained_focus, lost_focus); |
| 179 } | 180 } |
| 180 } | 181 } |
| 181 | 182 |
| 182 } // namespace exo | 183 } // namespace exo |
| OLD | NEW |