network_list_item_view.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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_SYSTEM_NETWORK_NETWORK_LIST_ITEM_VIEW_H_
  5. #define ASH_SYSTEM_NETWORK_NETWORK_LIST_ITEM_VIEW_H_
  6. #include "ash/ash_export.h"
  7. #include "ash/system/network/network_info.h"
  8. #include "ash/system/tray/hover_highlight_view.h"
  9. #include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h"
  10. #include "ui/base/metadata/metadata_impl_macros.h"
  11. namespace ash {
  12. class ViewClickListener;
  13. // Base class used in configuring the view shown for a single network in
  14. // the detailed Network page within the quick settings.
  15. class ASH_EXPORT NetworkListItemView : public HoverHighlightView {
  16. public:
  17. METADATA_HEADER(NetworkListItemView);
  18. NetworkListItemView(const NetworkListItemView&) = delete;
  19. NetworkListItemView& operator=(const NetworkListItemView&) = delete;
  20. ~NetworkListItemView() override;
  21. virtual void UpdateViewForNetwork(
  22. const chromeos::network_config::mojom::NetworkStatePropertiesPtr&
  23. network_properties) = 0;
  24. const chromeos::network_config::mojom::NetworkStatePropertiesPtr&
  25. network_properties() {
  26. return network_properties_;
  27. }
  28. protected:
  29. explicit NetworkListItemView(ViewClickListener* listener);
  30. std::u16string GetLabel();
  31. chromeos::network_config::mojom::NetworkStatePropertiesPtr
  32. network_properties_;
  33. };
  34. } // namespace ash
  35. #endif // ASH_SYSTEM_NETWORK_NETWORK_LIST_ITEM_VIEW_H_