ime_controller.cc 663 B

1234567891011121314151617181920212223242526272829303132333435
  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/ime_controller.h"
  5. namespace ash {
  6. namespace {
  7. ImeController* g_instance = nullptr;
  8. } // namespace
  9. // static
  10. void ImeController::SetInstanceForTest(ImeController* instance) {
  11. g_instance = instance;
  12. }
  13. // static
  14. ImeController* ImeController::Get() {
  15. return g_instance;
  16. }
  17. ImeController::~ImeController() {
  18. DCHECK_EQ(g_instance, this);
  19. g_instance = nullptr;
  20. }
  21. ImeController::ImeController() {
  22. DCHECK(!g_instance);
  23. g_instance = this;
  24. }
  25. } // namespace ash