microphone_mute_notification_delegate.cc 781 B

123456789101112131415161718192021222324252627282930313233
  1. // Copyright 2021 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/public/cpp/microphone_mute_notification_delegate.h"
  5. #include "base/check.h"
  6. #include "base/check_op.h"
  7. namespace ash {
  8. namespace {
  9. MicrophoneMuteNotificationDelegate* g_instance = nullptr;
  10. } // namespace
  11. // static
  12. MicrophoneMuteNotificationDelegate* MicrophoneMuteNotificationDelegate::Get() {
  13. return g_instance;
  14. }
  15. MicrophoneMuteNotificationDelegate::MicrophoneMuteNotificationDelegate() {
  16. DCHECK(!g_instance);
  17. g_instance = this;
  18. }
  19. MicrophoneMuteNotificationDelegate::~MicrophoneMuteNotificationDelegate() {
  20. DCHECK_EQ(this, g_instance);
  21. g_instance = nullptr;
  22. }
  23. } // namespace ash