quick_actions_view.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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_SYSTEM_PHONEHUB_QUICK_ACTIONS_VIEW_H_
  5. #define ASH_SYSTEM_PHONEHUB_QUICK_ACTIONS_VIEW_H_
  6. #include "ash/ash_export.h"
  7. #include "ash/components/phonehub/phone_hub_manager.h"
  8. #include "ui/views/view.h"
  9. namespace ash {
  10. class QuickActionControllerBase;
  11. class QuickActionItem;
  12. // A view in Phone Hub bubble that contains toggle button for quick actions such
  13. // as enable hotspot, silence phone and locate phone.
  14. class ASH_EXPORT QuickActionsView : public views::View {
  15. public:
  16. explicit QuickActionsView(phonehub::PhoneHubManager* phone_hub_manager);
  17. ~QuickActionsView() override;
  18. QuickActionsView(QuickActionsView&) = delete;
  19. QuickActionsView operator=(QuickActionsView&) = delete;
  20. QuickActionItem* enable_hotspot_for_testing() { return enable_hotspot_; }
  21. QuickActionItem* silence_phone_for_testing() { return silence_phone_; }
  22. QuickActionItem* locate_phone_for_testing() { return locate_phone_; }
  23. private:
  24. // Add all the quick actions items to the view.
  25. void InitQuickActionItems();
  26. // Controllers of quick actions items. Owned by this.
  27. std::vector<std::unique_ptr<QuickActionControllerBase>>
  28. quick_action_controllers_;
  29. phonehub::PhoneHubManager* phone_hub_manager_ = nullptr;
  30. // QuickActionItem for unit testing. Owned by this view.
  31. QuickActionItem* enable_hotspot_ = nullptr;
  32. QuickActionItem* silence_phone_ = nullptr;
  33. QuickActionItem* locate_phone_ = nullptr;
  34. };
  35. } // namespace ash
  36. #endif // ASH_SYSTEM_PHONEHUB_QUICK_ACTIONS_VIEW_H_