blob: 647cf3bd2742e9921acc350aa8ac719be2eca8ee (
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
37
38
39
40
41
42
43
44
45
46
47
48
49
|
// Copyright (c) 2012 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 "chrome/browser/chromeos/input_method/input_method_configuration.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/chromeos/input_method/input_method_delegate_impl.h"
#include "chrome/browser/chromeos/input_method/input_method_manager_impl.h"
namespace chromeos {
namespace input_method {
namespace {
InputMethodManager* g_input_method_manager = NULL;
} // namespace
void Initialize() {
DCHECK(!g_input_method_manager);
InputMethodManagerImpl* impl = new InputMethodManagerImpl(
scoped_ptr<InputMethodDelegate>(new InputMethodDelegateImpl));
impl->Init();
g_input_method_manager = impl;
DVLOG(1) << "InputMethodManager initialized";
}
void InitializeForTesting(InputMethodManager* mock_manager) {
DCHECK(!g_input_method_manager);
g_input_method_manager = mock_manager;
DVLOG(1) << "InputMethodManager for testing initialized";
}
void Shutdown() {
delete g_input_method_manager;
g_input_method_manager = NULL;
DVLOG(1) << "InputMethodManager shutdown";
}
InputMethodManager* GetInputMethodManager() {
DCHECK(g_input_method_manager);
return g_input_method_manager;
}
} // namespace input_method
} // namespace chromeos
|