tracing_model.cc 748 B

123456789101112131415161718192021222324252627282930
  1. // Copyright 2018 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/model/tracing_model.h"
  5. namespace ash {
  6. TracingModel::TracingModel() = default;
  7. TracingModel::~TracingModel() = default;
  8. void TracingModel::AddObserver(TracingObserver* observer) {
  9. observers_.AddObserver(observer);
  10. }
  11. void TracingModel::RemoveObserver(TracingObserver* observer) {
  12. observers_.RemoveObserver(observer);
  13. }
  14. void TracingModel::SetIsTracing(bool is_tracing) {
  15. is_tracing_ = is_tracing;
  16. NotifyChanged();
  17. }
  18. void TracingModel::NotifyChanged() {
  19. for (auto& observer : observers_)
  20. observer.OnTracingModeChanged();
  21. }
  22. } // namespace ash