network_list_mobile_header_view_impl.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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_MOBILE_HEADER_VIEW_IMPL_H_
  5. #define ASH_SYSTEM_NETWORK_NETWORK_LIST_MOBILE_HEADER_VIEW_IMPL_H_
  6. #include "ash/ash_export.h"
  7. #include "ash/style/icon_button.h"
  8. #include "ash/system/network/network_list_mobile_header_view.h"
  9. #include "ash/system/network/network_list_network_header_view.h"
  10. #include "ash/system/tray/tri_view.h"
  11. #include "base/memory/weak_ptr.h"
  12. #include "ui/views/view.h"
  13. namespace ash {
  14. // Implementation of NetworkListMobileHeaderView.
  15. class ASH_EXPORT NetworkListMobileHeaderViewImpl
  16. : public NetworkListMobileHeaderView {
  17. public:
  18. explicit NetworkListMobileHeaderViewImpl(
  19. NetworkListNetworkHeaderView::Delegate* delegate);
  20. NetworkListMobileHeaderViewImpl(const NetworkListMobileHeaderViewImpl&) =
  21. delete;
  22. NetworkListMobileHeaderViewImpl& operator=(
  23. const NetworkListMobileHeaderViewImpl&) = delete;
  24. ~NetworkListMobileHeaderViewImpl() override;
  25. private:
  26. friend class NetworkListMobileHeaderViewTest;
  27. // Used for testing.
  28. static constexpr int kAddESimButtonId =
  29. NetworkListNetworkHeaderView::kToggleButtonId + 1;
  30. // NetworkListNetworkHeaderView:
  31. void AddExtraButtons() override;
  32. void OnToggleToggled(bool is_on) override;
  33. // NetworkListMobileHeaderView:
  34. void SetAddESimButtonState(bool enabled, bool visible) override;
  35. void AddESimButtonPressed();
  36. // Button that navigates to the Settings mobile data subpage with the eSIM
  37. // setup dialog open. This is null when the device is not eSIM-capable.
  38. IconButton* add_esim_button_ = nullptr;
  39. base::WeakPtrFactory<NetworkListMobileHeaderViewImpl> weak_factory_{this};
  40. };
  41. } // namespace ash
  42. #endif // ASH_SYSTEM_NETWORK_NETWORK_LIST_MOBILE_HEADER_VIEW_IMPL_H_