note_taking_client.cc 663 B

1234567891011121314151617181920212223242526272829
  1. // Copyright 2019 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/note_taking_client.h"
  5. #include "base/check_op.h"
  6. namespace ash {
  7. namespace {
  8. NoteTakingClient* g_note_taking_client = nullptr;
  9. }
  10. // static
  11. NoteTakingClient* NoteTakingClient::GetInstance() {
  12. return g_note_taking_client;
  13. }
  14. NoteTakingClient::NoteTakingClient() {
  15. DCHECK(!g_note_taking_client);
  16. g_note_taking_client = this;
  17. }
  18. NoteTakingClient::~NoteTakingClient() {
  19. DCHECK_EQ(g_note_taking_client, this);
  20. g_note_taking_client = nullptr;
  21. }
  22. } // namespace ash