tray_bubble_base.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Copyright 2018 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_SYSTEM_TRAY_TRAY_BUBBLE_BASE_H_
  5. #define ASH_SYSTEM_TRAY_TRAY_BUBBLE_BASE_H_
  6. #include "ash/ash_export.h"
  7. #include "ui/views/widget/widget_observer.h"
  8. namespace views {
  9. class Widget;
  10. } // namespace views
  11. namespace ash {
  12. class TrayBackgroundView;
  13. class TrayBubbleView;
  14. // Base class for tray bubbles registered to TrayEventFilter.
  15. // Note: As this class implements `views::WidgetObserver`, the derived classes
  16. // are required to add themselves as a `views::WidgetObserver` to the bubble
  17. // Widgets they make.
  18. class ASH_EXPORT TrayBubbleBase : public views::WidgetObserver {
  19. public:
  20. TrayBubbleBase();
  21. ~TrayBubbleBase() override;
  22. // Returns the tray button instance.
  23. virtual TrayBackgroundView* GetTray() const = 0;
  24. // Returns the TrayBubbleView instance of the bubble.
  25. virtual TrayBubbleView* GetBubbleView() const = 0;
  26. // Returns the widget of the bubble.
  27. virtual views::Widget* GetBubbleWidget() const = 0;
  28. // views::WidgetObserver overrides:
  29. void OnWidgetVisibilityChanged(views::Widget* widget, bool visible) override;
  30. };
  31. } // namespace ash
  32. #endif // ASH_SYSTEM_TRAY_TRAY_BUBBLE_BASE_H_