network_list_header_view.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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_HEADER_VIEW_H_
  5. #define ASH_SYSTEM_NETWORK_NETWORK_LIST_HEADER_VIEW_H_
  6. #include "ash/ash_export.h"
  7. #include "ash/system/tray/tri_view.h"
  8. #include "ui/views/view.h"
  9. namespace ash {
  10. // This class is used for the headers of both networks and VPNs, and will be
  11. // responsible for initializing the core views for a header.
  12. class ASH_EXPORT NetworkListHeaderView : public views::View {
  13. public:
  14. NetworkListHeaderView(const NetworkListHeaderView&) = delete;
  15. NetworkListHeaderView& operator=(const NetworkListHeaderView&) = delete;
  16. ~NetworkListHeaderView() override = default;
  17. protected:
  18. explicit NetworkListHeaderView(int label_id);
  19. TriView* container() const { return container_; }
  20. // Used for testing. This is 1 because view IDs should not be 0.
  21. static constexpr int kTitleLabelViewId = 1;
  22. private:
  23. friend class NetworkListNetworkHeaderViewTest;
  24. friend class NetworkListMobileHeaderViewTest;
  25. friend class NetworkListWifiHeaderViewTest;
  26. void AddTitleView(int label_id);
  27. TriView* container_ = nullptr;
  28. };
  29. } // namespace ash
  30. #endif // ASH_SYSTEM_NETWORK_NETWORK_LIST_HEADER_VIEW_H_