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 16 matching lines...) Expand all Loading... |
27 namespace SetCandidates = extensions::api::input_ime::SetCandidates; | 27 namespace SetCandidates = extensions::api::input_ime::SetCandidates; |
28 namespace SetCandidateWindowProperties = | 28 namespace SetCandidateWindowProperties = |
29 extensions::api::input_ime::SetCandidateWindowProperties; | 29 extensions::api::input_ime::SetCandidateWindowProperties; |
30 namespace CommitText = extensions::api::input_ime::CommitText; | 30 namespace CommitText = extensions::api::input_ime::CommitText; |
31 namespace ClearComposition = extensions::api::input_ime::ClearComposition; | 31 namespace ClearComposition = extensions::api::input_ime::ClearComposition; |
32 namespace SetComposition = extensions::api::input_ime::SetComposition; | 32 namespace SetComposition = extensions::api::input_ime::SetComposition; |
33 | 33 |
34 namespace { | 34 namespace { |
35 | 35 |
36 const char kErrorEngineNotAvailable[] = "Engine is not available"; | 36 const char kErrorEngineNotAvailable[] = "Engine is not available"; |
37 const char kErrorBadCandidateList[] = "Invalid candidate list provided"; | |
38 const char kErrorSetMenuItemsFail[] = "Could not create menu Items"; | 37 const char kErrorSetMenuItemsFail[] = "Could not create menu Items"; |
39 const char kErrorUpdateMenuItemsFail[] = "Could not update menu Items"; | 38 const char kErrorUpdateMenuItemsFail[] = "Could not update menu Items"; |
40 | 39 |
41 void SetMenuItemToMenu(const input_ime::MenuItem& input, | 40 void SetMenuItemToMenu(const input_ime::MenuItem& input, |
42 chromeos::InputMethodEngine::MenuItem* out) { | 41 chromeos::InputMethodEngine::MenuItem* out) { |
43 out->modified = 0; | 42 out->modified = 0; |
44 out->id = input.id; | 43 out->id = input.id; |
45 if (input.label) { | 44 if (input.label) { |
46 out->modified |= chromeos::InputMethodEngine::MENU_ITEM_MODIFIED_LABEL; | 45 out->modified |= chromeos::InputMethodEngine::MENU_ITEM_MODIFIED_LABEL; |
47 out->label = *input.label; | 46 out->label = *input.label; |
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
765 if (input_components->size() > 0) | 764 if (input_components->size() > 0) |
766 input_ime_event_router()->UnregisterAllImes(profile_, extension->id()); | 765 input_ime_event_router()->UnregisterAllImes(profile_, extension->id()); |
767 } | 766 } |
768 } | 767 } |
769 | 768 |
770 InputImeEventRouter* InputImeAPI::input_ime_event_router() { | 769 InputImeEventRouter* InputImeAPI::input_ime_event_router() { |
771 return InputImeEventRouter::GetInstance(); | 770 return InputImeEventRouter::GetInstance(); |
772 } | 771 } |
773 | 772 |
774 } // namespace extensions | 773 } // namespace extensions |
OLD | NEW |