dot_indicator.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright 2022 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_STYLE_DOT_INDICATOR_H_
  5. #define ASH_STYLE_DOT_INDICATOR_H_
  6. #include "ash/ash_export.h"
  7. #include "ui/views/view.h"
  8. namespace ash {
  9. // The indicator which is activated when its corresponding app receives a
  10. // notification. This is thus set invisible as default and should be explicitly
  11. // set to visible by the owner view. The owner of this component is also
  12. // responsible for setting the correct bounds on the app icon.
  13. class ASH_EXPORT DotIndicator : public views::View {
  14. public:
  15. explicit DotIndicator(SkColor indicator_color);
  16. DotIndicator(const DotIndicator& other) = delete;
  17. DotIndicator& operator=(const DotIndicator& other) = delete;
  18. ~DotIndicator() override;
  19. void SetColor(SkColor new_color);
  20. // Sets the bounds of the indicator without shadow.
  21. void SetIndicatorBounds(gfx::Rect indicator_bounds);
  22. private:
  23. // views::View:
  24. void OnPaint(gfx::Canvas* canvas) override;
  25. const gfx::ShadowValues shadow_values_;
  26. SkColor indicator_color_;
  27. };
  28. } // namespace ash
  29. #endif // ASH_STYLE_DOT_INDICATOR_H_