OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chromeos/ime/input_method_manager.h" | 5 #include "chromeos/dbus/fake_introspectable_client.h" |
6 | 6 |
| 7 #include "base/callback.h" |
7 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "dbus/object_path.h" |
8 | 10 |
9 namespace chromeos { | 11 namespace chromeos { |
10 namespace input_method { | |
11 | 12 |
12 namespace { | 13 FakeIntrospectableClient::FakeIntrospectableClient() {} |
13 InputMethodManager* g_input_method_manager = NULL; | 14 |
| 15 FakeIntrospectableClient::~FakeIntrospectableClient() {} |
| 16 |
| 17 void FakeIntrospectableClient::Init(dbus::Bus* bus) {} |
| 18 |
| 19 void FakeIntrospectableClient::Introspect(const std::string& service_name, |
| 20 const dbus::ObjectPath& object_path, |
| 21 const IntrospectCallback& callback) { |
| 22 VLOG(1) << "Introspect: " << service_name << " " << object_path.value(); |
| 23 callback.Run(service_name, object_path, "", false); |
14 } | 24 } |
15 | 25 |
16 // static | |
17 InputMethodManager* InputMethodManager::Get() { | |
18 return g_input_method_manager; | |
19 } | |
20 | |
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; | |
25 } | |
26 | |
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; | |
33 } | |
34 | |
35 } // namespace input_method | |
36 } // namespace chromeos | 26 } // namespace chromeos |
OLD | NEW |