| Index: chrome/browser/chromeos/extensions/input_method_api.h
|
| diff --git a/chrome/browser/chromeos/extensions/input_method_api.h b/chrome/browser/chromeos/extensions/input_method_api.h
|
| index 37bd9d2d1d2cd68eeb43c7e90ce93f721577ff0d..719c3028a73e6ddb5090081ec10ae69c27d33b13 100644
|
| --- a/chrome/browser/chromeos/extensions/input_method_api.h
|
| +++ b/chrome/browser/chromeos/extensions/input_method_api.h
|
| @@ -6,7 +6,14 @@
|
| #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_INPUT_METHOD_API_H_
|
|
|
| #include "base/compiler_specific.h"
|
| +#include "base/memory/scoped_ptr.h"
|
| +#include "chrome/browser/extensions/event_router.h"
|
| #include "chrome/browser/extensions/extension_function.h"
|
| +#include "chrome/browser/profiles/profile_keyed_service.h"
|
| +
|
| +namespace chromeos {
|
| +class ExtensionInputMethodEventRouter;
|
| +}
|
|
|
| namespace extensions {
|
|
|
| @@ -24,6 +31,31 @@ class GetInputMethodFunction : public SyncExtensionFunction {
|
| DECLARE_EXTENSION_FUNCTION_NAME("inputMethodPrivate.get");
|
| };
|
|
|
| +class InputMethodAPI : public ProfileKeyedService,
|
| + public extensions::EventRouter::Observer {
|
| + public:
|
| + explicit InputMethodAPI(Profile* profile);
|
| + virtual ~InputMethodAPI();
|
| +
|
| + // Returns input method name for the given XKB (X keyboard extensions in X
|
| + // Window System) id.
|
| + static std::string GetInputMethodForXkb(const std::string& xkb_id);
|
| +
|
| + // ProfileKeyedService implementation.
|
| + virtual void Shutdown() OVERRIDE;
|
| +
|
| + // EventRouter::Observer implementation.
|
| + virtual void OnListenerAdded(const extensions::EventListenerInfo& details)
|
| + OVERRIDE;
|
| +
|
| + private:
|
| + Profile* const profile_;
|
| +
|
| + // Created lazily upon OnListenerAdded.
|
| + scoped_ptr<chromeos::ExtensionInputMethodEventRouter>
|
| + input_method_event_router_;
|
| +};
|
| +
|
| } // namespace extensions
|
|
|
| #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_INPUT_METHOD_API_H_
|
|
|