drag_descriptor.h 1.1 KB

123456789101112131415161718192021222324252627282930
  1. // Copyright 2017 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef ASH_KEYBOARD_UI_DRAG_DESCRIPTOR_H_
  5. #define ASH_KEYBOARD_UI_DRAG_DESCRIPTOR_H_
  6. #include "ui/events/event.h"
  7. #include "ui/gfx/geometry/point.h"
  8. #include "ui/gfx/geometry/vector2d.h"
  9. namespace keyboard {
  10. // Tracks the state of a mouse drag to move the keyboard. The DragDescriptor
  11. // does not actually change while the user drags. It essentially just records
  12. // the offset of the original click on the keyboard along with the original
  13. // location of the keyboard and uses incoming mouse move events to determine
  14. // where the keyboard should be placed using those offsets.
  15. struct DragDescriptor {
  16. gfx::Point original_keyboard_location;
  17. gfx::Vector2d original_click_offset;
  18. // The pointer ID provided by the touch event to disambiguate multiple
  19. // touch points. If this is a mouse event, then this value is kMousePointerId.
  20. ui::PointerId pointer_id;
  21. };
  22. } // namespace keyboard
  23. #endif // ASH_KEYBOARD_UI_DRAG_DESCRIPTOR_H_