network_info.cc 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  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. #include "ash/system/network/network_info.h"
  5. #include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h"
  6. namespace ash {
  7. NetworkInfo::NetworkInfo() : NetworkInfo(std::string()) {}
  8. NetworkInfo::NetworkInfo(const std::string& guid)
  9. : guid(guid),
  10. connection_state(
  11. chromeos::network_config::mojom::ConnectionStateType::kNotConnected),
  12. type(chromeos::network_config::mojom::NetworkType::kWiFi),
  13. source(chromeos::network_config::mojom::OncSource::kNone),
  14. activation_state(
  15. chromeos::network_config::mojom::ActivationStateType::kUnknown) {}
  16. NetworkInfo::~NetworkInfo() = default;
  17. bool NetworkInfo::operator==(const NetworkInfo& other) const {
  18. return guid == other.guid && label == other.label &&
  19. tooltip == other.tooltip && image.BackedBySameObjectAs(other.image) &&
  20. type == other.type && disable == other.disable &&
  21. sim_locked == other.sim_locked && sim_eid == other.sim_eid &&
  22. connection_state == other.connection_state && source == other.source &&
  23. activation_state == other.activation_state &&
  24. battery_percentage == other.battery_percentage;
  25. }
  26. } // namespace ash