mutable_phone_model.cc 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright 2020 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/components/phonehub/mutable_phone_model.h"
  5. namespace ash {
  6. namespace phonehub {
  7. MutablePhoneModel::MutablePhoneModel() = default;
  8. MutablePhoneModel::~MutablePhoneModel() = default;
  9. void MutablePhoneModel::SetPhoneName(
  10. const absl::optional<std::u16string>& phone_name) {
  11. if (phone_name_ == phone_name)
  12. return;
  13. phone_name_ = phone_name;
  14. NotifyModelChanged();
  15. }
  16. void MutablePhoneModel::SetPhoneStatusModel(
  17. const absl::optional<PhoneStatusModel>& phone_status_model) {
  18. if (phone_status_model_ == phone_status_model)
  19. return;
  20. phone_status_model_ = phone_status_model;
  21. NotifyModelChanged();
  22. }
  23. void MutablePhoneModel::SetBrowserTabsModel(
  24. const absl::optional<BrowserTabsModel>& browser_tabs_model) {
  25. if (browser_tabs_model_ == browser_tabs_model)
  26. return;
  27. browser_tabs_model_ = browser_tabs_model;
  28. NotifyModelChanged();
  29. }
  30. } // namespace phonehub
  31. } // namespace ash