| 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 "ui/views/linux_ui/linux_ui.h" | 5 #include "ui/views/linux_ui/linux_ui.h" |
| 6 | 6 |
| 7 #include "ui/base/ime/linux/linux_input_method_context_factory.h" | 7 #include "ui/base/ime/linux/linux_input_method_context_factory.h" |
| 8 #include "ui/shell_dialogs/linux_shell_dialog.h" | 8 #include "ui/shell_dialogs/linux_shell_dialog.h" |
| 9 | 9 |
| 10 namespace { | 10 namespace { |
| 11 | 11 |
| 12 views::LinuxUI* g_linux_ui = NULL; | 12 views::LinuxUI* g_linux_ui = NULL; |
| 13 | 13 |
| 14 } // namespace | 14 } // namespace |
| 15 | 15 |
| 16 namespace views { | 16 namespace views { |
| 17 | 17 |
| 18 void LinuxUI::SetInstance(LinuxUI* instance) { | 18 void LinuxUI::SetInstance(LinuxUI* instance) { |
| 19 delete g_linux_ui; | 19 delete g_linux_ui; |
| 20 g_linux_ui = instance; | 20 g_linux_ui = instance; |
| 21 #if defined(USE_X11) | |
| 22 LinuxInputMethodContextFactory::SetInstance(instance); | 21 LinuxInputMethodContextFactory::SetInstance(instance); |
| 23 #endif | |
| 24 LinuxShellDialog::SetInstance(instance); | 22 LinuxShellDialog::SetInstance(instance); |
| 25 } | 23 } |
| 26 | 24 |
| 27 LinuxUI* LinuxUI::instance() { | 25 LinuxUI* LinuxUI::instance() { |
| 28 return g_linux_ui; | 26 return g_linux_ui; |
| 29 } | 27 } |
| 30 | 28 |
| 31 } // namespace views | 29 } // namespace views |
| OLD | NEW |