| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/browser/chromeos/input_method/input_method_engine.h" | 10 #include "chrome/browser/chromeos/input_method/input_method_engine.h" |
| (...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 } | 769 } |
| 770 | 770 |
| 771 InputImeAPI::~InputImeAPI() { | 771 InputImeAPI::~InputImeAPI() { |
| 772 } | 772 } |
| 773 | 773 |
| 774 static base::LazyInstance<ProfileKeyedAPIFactory<InputImeAPI> > | 774 static base::LazyInstance<ProfileKeyedAPIFactory<InputImeAPI> > |
| 775 g_factory = LAZY_INSTANCE_INITIALIZER; | 775 g_factory = LAZY_INSTANCE_INITIALIZER; |
| 776 | 776 |
| 777 // static | 777 // static |
| 778 ProfileKeyedAPIFactory<InputImeAPI>* InputImeAPI::GetFactoryInstance() { | 778 ProfileKeyedAPIFactory<InputImeAPI>* InputImeAPI::GetFactoryInstance() { |
| 779 return &g_factory.Get(); | 779 return g_factory.Pointer(); |
| 780 } | 780 } |
| 781 | 781 |
| 782 void InputImeAPI::Observe(int type, | 782 void InputImeAPI::Observe(int type, |
| 783 const content::NotificationSource& source, | 783 const content::NotificationSource& source, |
| 784 const content::NotificationDetails& details) { | 784 const content::NotificationDetails& details) { |
| 785 if (type == chrome::NOTIFICATION_EXTENSION_LOADED) { | 785 if (type == chrome::NOTIFICATION_EXTENSION_LOADED) { |
| 786 const Extension* extension = | 786 const Extension* extension = |
| 787 content::Details<const Extension>(details).ptr(); | 787 content::Details<const Extension>(details).ptr(); |
| 788 const std::vector<InputComponentInfo>* input_components = | 788 const std::vector<InputComponentInfo>* input_components = |
| 789 extensions::InputComponents::GetInputComponents(extension); | 789 extensions::InputComponents::GetInputComponents(extension); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 807 if (input_components->size() > 0) | 807 if (input_components->size() > 0) |
| 808 input_ime_event_router()->UnregisterAllImes(profile_, extension->id()); | 808 input_ime_event_router()->UnregisterAllImes(profile_, extension->id()); |
| 809 } | 809 } |
| 810 } | 810 } |
| 811 | 811 |
| 812 InputImeEventRouter* InputImeAPI::input_ime_event_router() { | 812 InputImeEventRouter* InputImeAPI::input_ime_event_router() { |
| 813 return InputImeEventRouter::GetInstance(); | 813 return InputImeEventRouter::GetInstance(); |
| 814 } | 814 } |
| 815 | 815 |
| 816 } // namespace extensions | 816 } // namespace extensions |
| OLD | NEW |