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/desktop_drag_drop_client_aurax11.h" | 5 #include "ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.h" |
6 | 6 |
7 #include <X11/Xatom.h> | 7 #include <X11/Xatom.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 } | 758 } |
759 | 759 |
760 void DesktopDragDropClientAuraX11::OnWindowDestroyed(aura::Window* window) { | 760 void DesktopDragDropClientAuraX11::OnWindowDestroyed(aura::Window* window) { |
761 DCHECK_EQ(target_window_, window); | 761 DCHECK_EQ(target_window_, window); |
762 target_window_ = NULL; | 762 target_window_ = NULL; |
763 } | 763 } |
764 | 764 |
765 void DesktopDragDropClientAuraX11::OnMouseMovement( | 765 void DesktopDragDropClientAuraX11::OnMouseMovement( |
766 const gfx::Point& screen_point, | 766 const gfx::Point& screen_point, |
767 int flags, | 767 int flags, |
768 base::TimeDelta event_time) { | 768 base::TimeTicks event_time) { |
769 if (drag_widget_.get()) { | 769 if (drag_widget_.get()) { |
770 drag_widget_->SetBounds( | 770 drag_widget_->SetBounds( |
771 gfx::Rect(screen_point - drag_widget_offset_, | 771 gfx::Rect(screen_point - drag_widget_offset_, |
772 drag_widget_->GetWindowBoundsInScreen().size())); | 772 drag_widget_->GetWindowBoundsInScreen().size())); |
773 drag_widget_->StackAtTop(); | 773 drag_widget_->StackAtTop(); |
774 } | 774 } |
775 | 775 |
776 const int kModifiers = ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | | 776 const int kModifiers = ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | |
777 ui::EF_ALT_DOWN | ui::EF_COMMAND_DOWN | | 777 ui::EF_ALT_DOWN | ui::EF_COMMAND_DOWN | |
778 ui::EF_LEFT_MOUSE_BUTTON | | 778 ui::EF_LEFT_MOUSE_BUTTON | |
779 ui::EF_MIDDLE_MOUSE_BUTTON | | 779 ui::EF_MIDDLE_MOUSE_BUTTON | |
780 ui::EF_RIGHT_MOUSE_BUTTON; | 780 ui::EF_RIGHT_MOUSE_BUTTON; |
781 current_modifier_state_ = flags & kModifiers; | 781 current_modifier_state_ = flags & kModifiers; |
782 | 782 |
783 repeat_mouse_move_timer_.Stop(); | 783 repeat_mouse_move_timer_.Stop(); |
784 ProcessMouseMove(screen_point, event_time.InMilliseconds()); | 784 ProcessMouseMove(screen_point, |
| 785 (event_time - base::TimeTicks()).InMilliseconds()); |
785 } | 786 } |
786 | 787 |
787 void DesktopDragDropClientAuraX11::OnMouseReleased() { | 788 void DesktopDragDropClientAuraX11::OnMouseReleased() { |
788 repeat_mouse_move_timer_.Stop(); | 789 repeat_mouse_move_timer_.Stop(); |
789 | 790 |
790 if (source_state_ != SOURCE_STATE_OTHER) { | 791 if (source_state_ != SOURCE_STATE_OTHER) { |
791 // The user has previously released the mouse and is clicking in | 792 // The user has previously released the mouse and is clicking in |
792 // frustration. | 793 // frustration. |
793 move_loop_->EndMoveLoop(); | 794 move_loop_->EndMoveLoop(); |
794 return; | 795 return; |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1222 for (int x = 0; x < in_bitmap->width(); ++x) { | 1223 for (int x = 0; x < in_bitmap->width(); ++x) { |
1223 if (SkColorGetA(in_row[x]) > kMinAlpha) | 1224 if (SkColorGetA(in_row[x]) > kMinAlpha) |
1224 return true; | 1225 return true; |
1225 } | 1226 } |
1226 } | 1227 } |
1227 | 1228 |
1228 return false; | 1229 return false; |
1229 } | 1230 } |
1230 | 1231 |
1231 } // namespace views | 1232 } // namespace views |
OLD | NEW |