| 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 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 784 chrome::NOTIFICATION_EXTENSION_LOADED, | 784 chrome::NOTIFICATION_EXTENSION_LOADED, |
| 785 content::Source<Profile>(profile_)); | 785 content::Source<Profile>(profile_)); |
| 786 registrar_.Add(this, | 786 registrar_.Add(this, |
| 787 chrome::NOTIFICATION_EXTENSION_UNLOADED, | 787 chrome::NOTIFICATION_EXTENSION_UNLOADED, |
| 788 content::Source<Profile>(profile_)); | 788 content::Source<Profile>(profile_)); |
| 789 } | 789 } |
| 790 | 790 |
| 791 InputImeAPI::~InputImeAPI() { | 791 InputImeAPI::~InputImeAPI() { |
| 792 } | 792 } |
| 793 | 793 |
| 794 static base::LazyInstance<ProfileKeyedAPIFactory<InputImeAPI> > | 794 static base::LazyInstance<BrowserContextKeyedAPIFactory<InputImeAPI> > |
| 795 g_factory = LAZY_INSTANCE_INITIALIZER; | 795 g_factory = LAZY_INSTANCE_INITIALIZER; |
| 796 | 796 |
| 797 // static | 797 // static |
| 798 ProfileKeyedAPIFactory<InputImeAPI>* InputImeAPI::GetFactoryInstance() { | 798 BrowserContextKeyedAPIFactory<InputImeAPI>* InputImeAPI::GetFactoryInstance() { |
| 799 return g_factory.Pointer(); | 799 return g_factory.Pointer(); |
| 800 } | 800 } |
| 801 | 801 |
| 802 void InputImeAPI::Observe(int type, | 802 void InputImeAPI::Observe(int type, |
| 803 const content::NotificationSource& source, | 803 const content::NotificationSource& source, |
| 804 const content::NotificationDetails& details) { | 804 const content::NotificationDetails& details) { |
| 805 if (type == chrome::NOTIFICATION_EXTENSION_LOADED) { | 805 if (type == chrome::NOTIFICATION_EXTENSION_LOADED) { |
| 806 const Extension* extension = | 806 const Extension* extension = |
| 807 content::Details<const Extension>(details).ptr(); | 807 content::Details<const Extension>(details).ptr(); |
| 808 const std::vector<InputComponentInfo>* input_components = | 808 const std::vector<InputComponentInfo>* input_components = |
| (...skipping 18 matching lines...) Expand all Loading... |
| 827 if (input_components->size() > 0) | 827 if (input_components->size() > 0) |
| 828 input_ime_event_router()->UnregisterAllImes(profile_, extension->id()); | 828 input_ime_event_router()->UnregisterAllImes(profile_, extension->id()); |
| 829 } | 829 } |
| 830 } | 830 } |
| 831 | 831 |
| 832 InputImeEventRouter* InputImeAPI::input_ime_event_router() { | 832 InputImeEventRouter* InputImeAPI::input_ime_event_router() { |
| 833 return InputImeEventRouter::GetInstance(); | 833 return InputImeEventRouter::GetInstance(); |
| 834 } | 834 } |
| 835 | 835 |
| 836 } // namespace extensions | 836 } // namespace extensions |
| OLD | NEW |