Save errno for logging before potentially overwriting it.
[chromium-blink-merge.git] / chromeos / ime / input_method_manager.cc
blobcede581b38b473b57ffc0cfa6a30b70ada019727
1 // Copyright 2013 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.
5 #include "chromeos/ime/input_method_manager.h"
7 #include "base/logging.h"
9 namespace chromeos {
10 namespace input_method {
12 namespace {
13 InputMethodManager* g_input_method_manager = NULL;
16 // static
17 InputMethodManager* InputMethodManager::Get() {
18 return g_input_method_manager;
21 // static
22 void InputMethodManager::Initialize(InputMethodManager* instance) {
23 DCHECK(!g_input_method_manager) << "Do not call Initialize() multiple times.";
24 g_input_method_manager = instance;
27 // static
28 void InputMethodManager::Shutdown() {
29 DCHECK(g_input_method_manager)
30 << "InputMethodManager() is not initialized.";
31 delete g_input_method_manager;
32 g_input_method_manager = NULL;
35 } // namespace input_method
36 } // namespace chromeos