| 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 | 8 |
| 9 #include "base/debug/stack_trace.h" | 9 #include "base/debug/stack_trace.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 } | 69 } |
| 70 | 70 |
| 71 //////////////////////////////////////////////////////////////////////////////// | 71 //////////////////////////////////////////////////////////////////////////////// |
| 72 // DesktopWindowTreeHostLinux, aura::client::WindowMoveClient implementation: | 72 // DesktopWindowTreeHostLinux, aura::client::WindowMoveClient implementation: |
| 73 | 73 |
| 74 aura::client::WindowMoveResult X11DesktopWindowMoveClient::RunMoveLoop( | 74 aura::client::WindowMoveResult X11DesktopWindowMoveClient::RunMoveLoop( |
| 75 aura::Window* source, | 75 aura::Window* source, |
| 76 const gfx::Vector2d& drag_offset, | 76 const gfx::Vector2d& drag_offset, |
| 77 aura::client::WindowMoveSource move_source) { | 77 aura::client::WindowMoveSource move_source) { |
| 78 window_offset_ = drag_offset; | 78 window_offset_ = drag_offset; |
| 79 dispatcher_ = source->GetDispatcher(); | 79 dispatcher_ = source->GetHost()->dispatcher(); |
| 80 | 80 |
| 81 bool success = move_loop_.RunMoveLoop(source, | 81 bool success = move_loop_.RunMoveLoop(source, |
| 82 dispatcher_->host()->last_cursor()); | 82 dispatcher_->host()->last_cursor()); |
| 83 return success ? aura::client::MOVE_SUCCESSFUL : aura::client::MOVE_CANCELED; | 83 return success ? aura::client::MOVE_SUCCESSFUL : aura::client::MOVE_CANCELED; |
| 84 } | 84 } |
| 85 | 85 |
| 86 void X11DesktopWindowMoveClient::EndMoveLoop() { | 86 void X11DesktopWindowMoveClient::EndMoveLoop() { |
| 87 window_move_timer_.Stop(); | 87 window_move_timer_.Stop(); |
| 88 move_loop_.EndMoveLoop(); | 88 move_loop_.EndMoveLoop(); |
| 89 } | 89 } |
| 90 | 90 |
| 91 //////////////////////////////////////////////////////////////////////////////// | 91 //////////////////////////////////////////////////////////////////////////////// |
| 92 // DesktopWindowTreeHostLinux, private: | 92 // DesktopWindowTreeHostLinux, private: |
| 93 | 93 |
| 94 void X11DesktopWindowMoveClient::SetHostBounds(const gfx::Rect& rect) { | 94 void X11DesktopWindowMoveClient::SetHostBounds(const gfx::Rect& rect) { |
| 95 dispatcher_->host()->SetBounds(rect); | 95 dispatcher_->host()->SetBounds(rect); |
| 96 } | 96 } |
| 97 | 97 |
| 98 } // namespace views | 98 } // namespace views |
| OLD | NEW |