1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_IME_MENU_EVENT_ROUTER_H_
6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_IME_MENU_EVENT_ROUTER_H_
7 
8 #include "base/macros.h"
9 #include "ui/base/ime/chromeos/input_method_manager.h"
10 
11 namespace content {
12 class BrowserContext;
13 }
14 
15 namespace chromeos {
16 
17 // Event router class for the IME Menu activated/deactivate events.
18 // It's owned by InputMethodManager, and its lifetime restricted to the lifetime
19 // of the InputMethodManager and the EventRouter.
20 class ExtensionImeMenuEventRouter
21     : public input_method::InputMethodManager::ImeMenuObserver {
22  public:
23   explicit ExtensionImeMenuEventRouter(content::BrowserContext* context);
24   ~ExtensionImeMenuEventRouter() override;
25 
26   // input_method::InputMethodManager::ImeMenuObserver:
27   void ImeMenuActivationChanged(bool activation) override;
28   void ImeMenuListChanged() override;
29   void ImeMenuItemsChanged(
30       const std::string& engine_id,
31       const std::vector<input_method::InputMethodManager::MenuItem>& items)
32       override;
33 
34  private:
35   content::BrowserContext* context_;
36 
37   DISALLOW_COPY_AND_ASSIGN(ExtensionImeMenuEventRouter);
38 };
39 
40 }  // namespace chromeos
41 
42 #endif  // CHROME_BROWSER_CHROMEOS_EXTENSIONS_IME_MENU_EVENT_ROUTER_H_
43