container_full_width_behavior.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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_CONTAINER_FULL_WIDTH_BEHAVIOR_H_
  5. #define ASH_KEYBOARD_UI_CONTAINER_FULL_WIDTH_BEHAVIOR_H_
  6. #include "ash/keyboard/ui/container_behavior.h"
  7. #include "ui/gfx/geometry/rect.h"
  8. namespace keyboard {
  9. // Relative distance from the parent window, from which show animation starts
  10. // or hide animation finishes.
  11. constexpr int kFullWidthKeyboardAnimationDistance = 30;
  12. class KEYBOARD_EXPORT ContainerFullWidthBehavior : public ContainerBehavior {
  13. public:
  14. explicit ContainerFullWidthBehavior(Delegate* delegate);
  15. ~ContainerFullWidthBehavior() override;
  16. // ContainerBehavior overrides
  17. void DoHidingAnimation(
  18. aura::Window* container,
  19. ::wm::ScopedHidingAnimationSettings* animation_settings) override;
  20. void DoShowingAnimation(
  21. aura::Window* container,
  22. ui::ScopedLayerAnimationSettings* animation_settings) override;
  23. void InitializeShowAnimationStartingState(aura::Window* container) override;
  24. gfx::Rect AdjustSetBoundsRequest(
  25. const gfx::Rect& display_bounds,
  26. const gfx::Rect& requested_bounds_in_screen_coords) override;
  27. bool IsOverscrollAllowed() const override;
  28. void SavePosition(const gfx::Rect& keyboard_bounds,
  29. const gfx::Size& screen_size) override;
  30. bool HandlePointerEvent(const ui::LocatedEvent& event,
  31. const display::Display& current_display) override;
  32. bool HandleGestureEvent(const ui::GestureEvent& event,
  33. const gfx::Rect& bounds_in_screen) override;
  34. void SetCanonicalBounds(aura::Window* container,
  35. const gfx::Rect& display_bounds) override;
  36. ContainerType GetType() const override;
  37. bool TextBlurHidesKeyboard() const override;
  38. void SetOccludedBounds(const gfx::Rect& occluded_bounds_in_window) override;
  39. gfx::Rect GetOccludedBounds(
  40. const gfx::Rect& visual_bounds_in_window) const override;
  41. bool OccludedBoundsAffectWorkspaceLayout() const override;
  42. void SetDraggableArea(const gfx::Rect& rect) override;
  43. void SetAreaToRemainOnScreen(const gfx::Rect& bounds) override;
  44. private:
  45. gfx::Rect occluded_bounds_in_window_;
  46. };
  47. } // namespace keyboard
  48. #endif // ASH_KEYBOARD_UI_CONTAINER_FULL_WIDTH_BEHAVIOR_H_