OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/widget/desktop_aura/x11_desktop_handler.h" | 5 #include "ui/views/widget/desktop_aura/x11_desktop_handler.h" |
6 | 6 |
7 #include <X11/Xatom.h> | 7 #include <X11/Xatom.h> |
8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
9 | 9 |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 } | 144 } |
145 | 145 |
146 void X11DesktopHandler::OnWillDestroyEnv() { | 146 void X11DesktopHandler::OnWillDestroyEnv() { |
147 g_handler = NULL; | 147 g_handler = NULL; |
148 delete this; | 148 delete this; |
149 } | 149 } |
150 | 150 |
151 void X11DesktopHandler::OnActiveWindowChanged(::Window xid) { | 151 void X11DesktopHandler::OnActiveWindowChanged(::Window xid) { |
152 if (current_window_ == xid) | 152 if (current_window_ == xid) |
153 return; | 153 return; |
154 DesktopRootWindowHostX11* old_host = | 154 DesktopWindowTreeHostX11* old_host = |
155 views::DesktopRootWindowHostX11::GetHostForXID(current_window_); | 155 views::DesktopWindowTreeHostX11::GetHostForXID(current_window_); |
156 if (old_host) | 156 if (old_host) |
157 old_host->HandleNativeWidgetActivationChanged(false); | 157 old_host->HandleNativeWidgetActivationChanged(false); |
158 | 158 |
159 DesktopRootWindowHostX11* new_host = | 159 DesktopWindowTreeHostX11* new_host = |
160 views::DesktopRootWindowHostX11::GetHostForXID(xid); | 160 views::DesktopWindowTreeHostX11::GetHostForXID(xid); |
161 if (new_host) | 161 if (new_host) |
162 new_host->HandleNativeWidgetActivationChanged(true); | 162 new_host->HandleNativeWidgetActivationChanged(true); |
163 | 163 |
164 current_window_ = xid; | 164 current_window_ = xid; |
165 } | 165 } |
166 | 166 |
167 } // namespace views | 167 } // namespace views |
OLD | NEW |