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 15 matching lines...) Expand all Loading... |
37 views::WindowManagerConnection::Get()->client()->AddObserver(this); | 37 views::WindowManagerConnection::Get()->client()->AddObserver(this); |
38 } | 38 } |
39 | 39 |
40 WMHelperMus::~WMHelperMus() { | 40 WMHelperMus::~WMHelperMus() { |
41 views::WindowManagerConnection::Get()->client()->RemoveObserver(this); | 41 views::WindowManagerConnection::Get()->client()->RemoveObserver(this); |
42 } | 42 } |
43 | 43 |
44 //////////////////////////////////////////////////////////////////////////////// | 44 //////////////////////////////////////////////////////////////////////////////// |
45 // WMHelperMus, private: | 45 // WMHelperMus, private: |
46 | 46 |
47 const ash::DisplayInfo WMHelperMus::GetDisplayInfo(int64_t display_id) const { | 47 const display::ManagedDisplayInfo WMHelperMus::GetDisplayInfo( |
| 48 int64_t display_id) const { |
48 // TODO(penghuang): Return real display info when it is supported in mus. | 49 // TODO(penghuang): Return real display info when it is supported in mus. |
49 return ash::DisplayInfo(display_id, "", false); | 50 return display::ManagedDisplayInfo(display_id, "", false); |
50 } | 51 } |
51 | 52 |
52 aura::Window* WMHelperMus::GetContainer(int container_id) { | 53 aura::Window* WMHelperMus::GetContainer(int container_id) { |
53 NOTIMPLEMENTED(); | 54 NOTIMPLEMENTED(); |
54 return nullptr; | 55 return nullptr; |
55 } | 56 } |
56 | 57 |
57 aura::Window* WMHelperMus::GetActiveWindow() const { | 58 aura::Window* WMHelperMus::GetActiveWindow() const { |
58 ui::Window* window = | 59 ui::Window* window = |
59 views::WindowManagerConnection::Get()->client()->GetFocusedWindow(); | 60 views::WindowManagerConnection::Get()->client()->GetFocusedWindow(); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 133 |
133 void WMHelperMus::OnWindowFocused(aura::Window* gained_focus, | 134 void WMHelperMus::OnWindowFocused(aura::Window* gained_focus, |
134 aura::Window* lost_focus) { | 135 aura::Window* lost_focus) { |
135 if (focused_window_ != gained_focus) { | 136 if (focused_window_ != gained_focus) { |
136 focused_window_ = gained_focus; | 137 focused_window_ = gained_focus; |
137 NotifyWindowFocused(gained_focus, lost_focus); | 138 NotifyWindowFocused(gained_focus, lost_focus); |
138 } | 139 } |
139 } | 140 } |
140 | 141 |
141 } // namespace exo | 142 } // namespace exo |
OLD | NEW |