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_window_move_client.h" | 5 #include "ui/views/widget/desktop_aura/x11_desktop_window_move_client.h" |
6 | 6 |
7 #include <X11/Xlib.h> | 7 #include <X11/Xlib.h> |
8 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class. | 8 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class. |
9 #undef RootWindow | 9 #undef RootWindow |
10 | 10 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 | 64 |
65 void X11DesktopWindowMoveClient::OnMouseReleased() { | 65 void X11DesktopWindowMoveClient::OnMouseReleased() { |
66 EndMoveLoop(); | 66 EndMoveLoop(); |
67 } | 67 } |
68 | 68 |
69 void X11DesktopWindowMoveClient::OnMoveLoopEnded() { | 69 void X11DesktopWindowMoveClient::OnMoveLoopEnded() { |
70 root_window_ = NULL; | 70 root_window_ = NULL; |
71 } | 71 } |
72 | 72 |
73 //////////////////////////////////////////////////////////////////////////////// | 73 //////////////////////////////////////////////////////////////////////////////// |
74 // DesktopRootWindowHostLinux, aura::client::WindowMoveClient implementation: | 74 // DesktopWindowTreeHostLinux, aura::client::WindowMoveClient implementation: |
75 | 75 |
76 aura::client::WindowMoveResult X11DesktopWindowMoveClient::RunMoveLoop( | 76 aura::client::WindowMoveResult X11DesktopWindowMoveClient::RunMoveLoop( |
77 aura::Window* source, | 77 aura::Window* source, |
78 const gfx::Vector2d& drag_offset, | 78 const gfx::Vector2d& drag_offset, |
79 aura::client::WindowMoveSource move_source) { | 79 aura::client::WindowMoveSource move_source) { |
80 window_offset_ = drag_offset; | 80 window_offset_ = drag_offset; |
81 root_window_ = source->GetDispatcher(); | 81 root_window_ = source->GetDispatcher(); |
82 | 82 |
83 bool success = move_loop_.RunMoveLoop(source, root_window_->last_cursor()); | 83 bool success = move_loop_.RunMoveLoop(source, root_window_->last_cursor()); |
84 return success ? aura::client::MOVE_SUCCESSFUL : aura::client::MOVE_CANCELED; | 84 return success ? aura::client::MOVE_SUCCESSFUL : aura::client::MOVE_CANCELED; |
85 } | 85 } |
86 | 86 |
87 void X11DesktopWindowMoveClient::EndMoveLoop() { | 87 void X11DesktopWindowMoveClient::EndMoveLoop() { |
88 window_move_timer_.Stop(); | 88 window_move_timer_.Stop(); |
89 move_loop_.EndMoveLoop(); | 89 move_loop_.EndMoveLoop(); |
90 } | 90 } |
91 | 91 |
92 //////////////////////////////////////////////////////////////////////////////// | 92 //////////////////////////////////////////////////////////////////////////////// |
93 // DesktopRootWindowHostLinux, private: | 93 // DesktopWindowTreeHostLinux, private: |
94 | 94 |
95 void X11DesktopWindowMoveClient::SetHostBounds(const gfx::Rect& rect) { | 95 void X11DesktopWindowMoveClient::SetHostBounds(const gfx::Rect& rect) { |
96 root_window_->SetHostBounds(rect); | 96 root_window_->SetHostBounds(rect); |
97 } | 97 } |
98 | 98 |
99 } // namespace views | 99 } // namespace views |
OLD | NEW |