summaryrefslogtreecommitdiffstats
path: root/chromeos/ime/input_method_manager.cc
blob: cede581b38b473b57ffc0cfa6a30b70ada019727 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chromeos/ime/input_method_manager.h"

#include "base/logging.h"

namespace chromeos {
namespace input_method {

namespace {
InputMethodManager* g_input_method_manager = NULL;
}

// static
InputMethodManager* InputMethodManager::Get() {
  return g_input_method_manager;
}

// static
void InputMethodManager::Initialize(InputMethodManager* instance) {
  DCHECK(!g_input_method_manager) << "Do not call Initialize() multiple times.";
  g_input_method_manager = instance;
}

// static
void InputMethodManager::Shutdown() {
  DCHECK(g_input_method_manager)
      << "InputMethodManager() is not initialized.";
  delete g_input_method_manager;
  g_input_method_manager = NULL;
}

}  // namespace input_method
}  // namespace chromeos