network_info.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // Copyright 2014 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_INFO_H_
  5. #define ASH_SYSTEM_NETWORK_NETWORK_INFO_H_
  6. #include <string>
  7. #include "chromeos/services/network_config/public/mojom/cros_network_config.mojom-forward.h"
  8. #include "chromeos/services/network_config/public/mojom/network_types.mojom-forward.h"
  9. #include "ui/gfx/image/image_skia.h"
  10. namespace gfx {
  11. class ImageSkia;
  12. }
  13. namespace ash {
  14. // Includes information necessary about a network for displaying the appropriate
  15. // UI to the user.
  16. struct NetworkInfo {
  17. NetworkInfo();
  18. explicit NetworkInfo(const std::string& guid);
  19. ~NetworkInfo();
  20. bool operator==(const NetworkInfo& other) const;
  21. bool operator!=(const NetworkInfo& other) const { return !(*this == other); }
  22. std::string guid;
  23. std::u16string label;
  24. std::u16string tooltip;
  25. gfx::ImageSkia image;
  26. bool disable = false;
  27. bool secured = false;
  28. bool connectable = false;
  29. bool sim_locked = false;
  30. // Only set for eSIM cellular networks. This is used to uniquely identity
  31. // eSIM networks.
  32. std::string sim_eid;
  33. // Initialized in .cc file because full (non-forward) mojom headers are large.
  34. chromeos::network_config::mojom::ConnectionStateType connection_state;
  35. chromeos::network_config::mojom::NetworkType type;
  36. chromeos::network_config::mojom::OncSource source;
  37. // Used by cellular networks, for other network types, activation_status is
  38. // set to a default value of kUnknown.
  39. chromeos::network_config::mojom::ActivationStateType activation_state;
  40. int battery_percentage = 0;
  41. int signal_strength = 0;
  42. };
  43. } // namespace ash
  44. #endif // ASH_SYSTEM_NETWORK_NETWORK_INFO_H_