| Index: chrome/browser/chromeos/input_method/input_method_configuration.cc
|
| diff --git a/chrome/browser/chromeos/input_method/input_method_configuration.cc b/chrome/browser/chromeos/input_method/input_method_configuration.cc
|
| index 647cf3bd2742e9921acc350aa8ac719be2eca8ee..f98025f15436453fc71d9bb46314909b364dc157 100644
|
| --- a/chrome/browser/chromeos/input_method/input_method_configuration.cc
|
| +++ b/chrome/browser/chromeos/input_method/input_method_configuration.cc
|
| @@ -4,18 +4,29 @@
|
|
|
| #include "chrome/browser/chromeos/input_method/input_method_configuration.h"
|
|
|
| +#include "base/bind.h"
|
| #include "base/logging.h"
|
| #include "base/memory/scoped_ptr.h"
|
| +#include "chrome/browser/chromeos/input_method/browser_state_monitor.h"
|
| #include "chrome/browser/chromeos/input_method/input_method_delegate_impl.h"
|
| #include "chrome/browser/chromeos/input_method/input_method_manager_impl.h"
|
| +#include "chrome/browser/chromeos/input_method/input_method_persistence.h"
|
|
|
| namespace chromeos {
|
| namespace input_method {
|
|
|
| namespace {
|
| InputMethodManager* g_input_method_manager = NULL;
|
| +InputMethodPersistence* g_input_method_persistence = NULL;
|
| +BrowserStateMonitor* g_browser_state_monitor = NULL;
|
| } // namespace
|
|
|
| +void OnSessionStateChange(InputMethodManagerImpl* input_method_manager_impl,
|
| + InputMethodPersistence* input_method_persistence,
|
| + InputMethodManager::State new_state) {
|
| + input_method_persistence->OnSessionStateChange(new_state);
|
| + input_method_manager_impl->SetState(new_state);
|
| +}
|
|
|
| void Initialize() {
|
| DCHECK(!g_input_method_manager);
|
| @@ -24,6 +35,10 @@ void Initialize() {
|
| scoped_ptr<InputMethodDelegate>(new InputMethodDelegateImpl));
|
| impl->Init();
|
| g_input_method_manager = impl;
|
| + g_input_method_persistence =
|
| + new InputMethodPersistence(g_input_method_manager);
|
| + g_browser_state_monitor = new BrowserStateMonitor(
|
| + base::Bind(&OnSessionStateChange, impl, g_input_method_persistence));
|
|
|
| DVLOG(1) << "InputMethodManager initialized";
|
| }
|
| @@ -35,8 +50,15 @@ void InitializeForTesting(InputMethodManager* mock_manager) {
|
| }
|
|
|
| void Shutdown() {
|
| + delete g_browser_state_monitor;
|
| + g_browser_state_monitor = NULL;
|
| +
|
| + delete g_input_method_persistence;
|
| + g_input_method_persistence = NULL;
|
| +
|
| delete g_input_method_manager;
|
| g_input_method_manager = NULL;
|
| +
|
| DVLOG(1) << "InputMethodManager shutdown";
|
| }
|
|
|
|
|