| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/extensions/api/input_ime/input_ime_api.h" | 5 #include "chrome/browser/extensions/api/input_ime/input_ime_api.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 InputComponents::GetInputComponents(extension); | 623 InputComponents::GetInputComponents(extension); |
| 624 if (!input_components || input_components->empty()) | 624 if (!input_components || input_components->empty()) |
| 625 return; | 625 return; |
| 626 InputImeEventRouter* event_router = | 626 InputImeEventRouter* event_router = |
| 627 GetInputImeEventRouter(Profile::FromBrowserContext(browser_context)); | 627 GetInputImeEventRouter(Profile::FromBrowserContext(browser_context)); |
| 628 if (event_router) { | 628 if (event_router) { |
| 629 event_router->UnregisterAllImes(extension->id()); | 629 event_router->UnregisterAllImes(extension->id()); |
| 630 } | 630 } |
| 631 } | 631 } |
| 632 | 632 |
| 633 void InputImeAPI::OnListenerAdded(const EventListenerInfo& details) { | |
| 634 if (!details.browser_context) | |
| 635 return; | |
| 636 InputMethodEngine* engine = | |
| 637 GetActiveEngine(Profile::FromBrowserContext(details.browser_context), | |
| 638 details.extension_id); | |
| 639 // Notifies the IME extension for IME ready with onActivate/onFocus events. | |
| 640 if (engine) | |
| 641 engine->Enable(engine->GetActiveComponentId()); | |
| 642 } | |
| 643 | |
| 644 } // namespace extensions | 633 } // namespace extensions |
| OLD | NEW |