Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: chrome/browser/extensions/api/input_ime/input_ime_api_nonchromeos.h

Issue 1528483002: Add chrome.input.ime.activate and chrome.input.ime.deactivate API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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 #ifndef CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_NONCHROMEOS_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_NONCHROMEOS_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_NONCHROMEOS_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_NONCHROMEOS_H_
7 7
8 #include "chrome/browser/extensions/api/input_ime/input_ime_event_router_base.h" 8 #include "chrome/browser/extensions/api/input_ime/input_ime_event_router_base.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "extensions/browser/extension_function.h"
10 11
11 class Profile; 12 class Profile;
12 13
13 namespace extensions { 14 namespace extensions {
14 class InputImeEventRouterBase; 15 class InputImeEventRouterBase;
15 16
16 class InputImeEventRouter : public InputImeEventRouterBase { 17 class InputImeEventRouter : public InputImeEventRouterBase {
17 public: 18 public:
18 explicit InputImeEventRouter(Profile* profile); 19 explicit InputImeEventRouter(Profile* profile);
19 ~InputImeEventRouter() override; 20 ~InputImeEventRouter() override;
20 21
22 bool RegisterImeExtension(const std::string& extension_id);
23 void UnregisterImeExtension(const std::string& extension_id);
24
25 ui::IMEEngineHandlerInterface* GetActiveEngine(
26 const std::string& extension_id);
27
28 void SetActiveEngine(const std::string& extension_id);
29
30 private:
31 // The id of the all registered extensions.
32 std::vector<std::string> extension_ids_;
33
21 DISALLOW_COPY_AND_ASSIGN(InputImeEventRouter); 34 DISALLOW_COPY_AND_ASSIGN(InputImeEventRouter);
22 }; 35 };
23 36
37 class InputImeActivateFunction : public SyncExtensionFunction {
38 public:
39 DECLARE_EXTENSION_FUNCTION("input.ime.activate", INPUT_IME_ACTIVATE)
40
41 protected:
42 ~InputImeActivateFunction() override {}
43
44 // ExtensionFunction:
45 bool RunSync() override;
Devlin 2016/01/11 21:48:34 Read comments in extension_function.h above RunSyn
Azure Wei 2016/01/13 02:28:10 Done.
46 };
47
48 class InputImeDeactivateFunction : public SyncExtensionFunction {
49 public:
50 DECLARE_EXTENSION_FUNCTION("input.ime.deactivate", INPUT_IME_DEACTIVATE)
51
52 protected:
53 ~InputImeDeactivateFunction() override {}
54
55 // ExtensionFunction:
56 bool RunSync() override;
57 };
58
24 } // namespace extensions 59 } // namespace extensions
25 60
26 #endif // CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_NONCHROMEOS_H_ 61 #endif // CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_NONCHROMEOS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698