capture_mode_constants.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. // Copyright 2020 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_CAPTURE_MODE_CAPTURE_MODE_CONSTANTS_H_
  5. #define ASH_CAPTURE_MODE_CAPTURE_MODE_CONSTANTS_H_
  6. #include "base/time/time.h"
  7. #include "third_party/skia/include/core/SkColor.h"
  8. #include "ui/gfx/color_palette.h"
  9. #include "ui/gfx/geometry/insets.h"
  10. #include "ui/gfx/geometry/size.h"
  11. namespace ash::capture_mode {
  12. constexpr gfx::Size kButtonSize{32, 32};
  13. constexpr gfx::Insets kButtonPadding{0};
  14. // The spacing used by the BoxLayout manager to space out child views in the
  15. // CaptureModeBarView.
  16. constexpr int kBetweenChildSpacing = 16;
  17. // The amount the capture region changes when using the arrow keys to adjust it.
  18. constexpr int kCtrlArrowKeyboardRegionChangeDp = 1;
  19. constexpr int kArrowKeyboardRegionChangeDp = 15;
  20. constexpr int kShiftArrowKeyboardRegionChangeDp = 40;
  21. constexpr int kSpaceBetweenCaptureBarAndSettingsMenu = 8;
  22. // Constants needed to paint the highlight around the area being captured.
  23. constexpr int kCaptureRegionBorderStrokePx = 1;
  24. // This color is set to WHITE on purpose in both dark and light mode.
  25. constexpr SkColor kRegionBorderColor = SK_ColorWHITE;
  26. // Color of the dimming shield layer. It is set to dim the region that is
  27. // outside of the region will be recorded, either in the capture session or
  28. // video recording is in progress. This color is set to be the same in both dark
  29. // and light mode. We will investigate whether to do this kind of change to
  30. // ShieldLayer globally.
  31. constexpr SkColor kDimmingShieldColor =
  32. SkColorSetA(gfx::kGoogleGrey900, 102); // 40%
  33. // The space between the `image_toggle_button_` and `video_toggle_button_`.
  34. constexpr int kSpaceBetweenCaptureModeTypeButtons = 2;
  35. // The minimum value we use to clamp the camera preview diameter.
  36. constexpr int kMinCameraPreviewDiameter = 120;
  37. // The minimum value if the diameter of the expanded camera preview goes below
  38. // which, the camera preview will be considered too small to be collapsible.
  39. constexpr int kMinCollapsibleCameraPreviewDiameter = 150;
  40. // The minimum value of the shorter side of the surface within which the camera
  41. // preview is confined. Less values will cause the camera preview to hide.
  42. constexpr int kMinCaptureSurfaceShortSideLengthForVisibleCamera = 176;
  43. // The value by which we divide the shorter side of the surface within which the
  44. // camera preview is confined (e.g. the display work area when recrding the
  45. // fullscreen) to calculate the expanded diameter.
  46. constexpr int kCaptureSurfaceShortSideDivider = 4;
  47. // The divider used to calculate the collapsed diameter from the expanded
  48. // diameter.
  49. constexpr int kCollapsedPreviewDivider = 2;
  50. // Size of the camera preview border.
  51. constexpr int kCameraPreviewBorderSize = 4;
  52. // The space between the camera preview and edges of the bounds that will be
  53. // recorded.
  54. constexpr int kSpaceBetweenCameraPreviewAndEdges = 16;
  55. // The space between the bottom of camera preview resize button and the bottom
  56. // of the camera preview.
  57. constexpr int kSpaceBetweenResizeButtonAndCameraPreview = 12;
  58. // The duration to continue showing resize button since the mouse exiting the
  59. // preview bounds or the last tap on the preview widget.
  60. constexpr base::TimeDelta kResizeButtonShowDuration = base::Milliseconds(4500);
  61. // When capture UI (capture bar, capture label) is overlapped with user
  62. // capture region or camera preview, and the mouse is not hovering over the
  63. // capture UI, drop the opacity to this value to make the region or camera
  64. // preview easier to see.
  65. constexpr float kCaptureUiOverlapOpacity = 0.15f;
  66. } // namespace ash::capture_mode
  67. #endif // ASH_CAPTURE_MODE_CAPTURE_MODE_CONSTANTS_H_