tray_bubble_base.cc 949 B

12345678910111213141516171819202122232425262728
  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. #include "ash/system/tray/tray_bubble_base.h"
  5. #include "ash/shelf/shelf_widget.h"
  6. #include "ash/system/status_area_widget.h"
  7. #include "ash/system/tray/tray_background_view.h"
  8. #include "base/check_op.h"
  9. #include "ui/views/widget/widget_observer.h"
  10. namespace ash {
  11. TrayBubbleBase::TrayBubbleBase() = default;
  12. TrayBubbleBase::~TrayBubbleBase() = default;
  13. void TrayBubbleBase::OnWidgetVisibilityChanged(views::Widget* widget,
  14. bool visible) {
  15. TrayBackgroundView* tray = GetTray();
  16. views::Widget* current_widget = GetBubbleWidget();
  17. if (!tray || !current_widget)
  18. return;
  19. DCHECK_EQ(current_widget, widget);
  20. tray->shelf()->GetStatusAreaWidget()->NotifyAnyBubbleVisibilityChanged(
  21. widget, visible);
  22. }
  23. } // namespace ash