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

Unified Diff: chrome/browser/extensions/api/input_ime/input_ime_api.cc

Issue 232233003: ozone: Protect X11-specific code in IME support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/chrome_browser_chromeos.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/input_ime/input_ime_api.cc
diff --git a/chrome/browser/extensions/api/input_ime/input_ime_api.cc b/chrome/browser/extensions/api/input_ime/input_ime_api.cc
index a309e41bca08970c92e24bd11b44580058c41690..eec546bfad67d243c7bf1a71868a69785ee902ca 100644
--- a/chrome/browser/extensions/api/input_ime/input_ime_api.cc
+++ b/chrome/browser/extensions/api/input_ime/input_ime_api.cc
@@ -7,7 +7,6 @@
#include "base/strings/string_number_conversions.h"
#include "base/values.h"
#include "chrome/browser/chrome_notification_types.h"
-#include "chrome/browser/chromeos/input_method/input_method_engine.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
@@ -19,6 +18,10 @@
#include "extensions/browser/extension_function_registry.h"
#include "extensions/browser/extension_system.h"
+#if defined(USE_X11)
+#include "chrome/browser/chromeos/input_method/input_method_engine.h"
+#endif
+
namespace input_ime = extensions::api::input_ime;
namespace KeyEventHandled = extensions::api::input_ime::KeyEventHandled;
namespace DeleteSurroundingText =
@@ -308,11 +311,11 @@ InputImeEventRouter::GetInstance() {
return Singleton<InputImeEventRouter>::get();
}
-#if defined(OS_CHROMEOS)
bool InputImeEventRouter::RegisterIme(
Profile* profile,
const std::string& extension_id,
const extensions::InputComponentInfo& component) {
+#if defined(USE_X11)
VLOG(1) << "RegisterIme: " << extension_id << " id: " << component.id;
// If the engine exists already, it may be registered with an old profile.
@@ -349,6 +352,11 @@ bool InputImeEventRouter::RegisterIme(
engine_map[component.id] = engine;
return true;
+#else
+ // TODO(spang): IME support under ozone.
+ NOTIMPLEMENTED();
+ return false;
+#endif
}
void InputImeEventRouter::UnregisterAllImes(
@@ -361,7 +369,6 @@ void InputImeEventRouter::UnregisterAllImes(
engines_.erase(engine_map);
}
}
-#endif
InputMethodEngineInterface* InputImeEventRouter::GetEngine(
const std::string& extension_id, const std::string& engine_id) {
@@ -542,10 +549,10 @@ bool InputImeSendKeyEventsFunction::RunImpl() {
const std::vector<linked_ptr<input_ime::KeyboardEvent> >& key_data =
params.key_data;
- std::vector<chromeos::InputMethodEngine::KeyboardEvent> key_data_out;
+ std::vector<chromeos::InputMethodEngineInterface::KeyboardEvent> key_data_out;
for (size_t i = 0; i < key_data.size(); ++i) {
- chromeos::InputMethodEngine::KeyboardEvent event;
+ chromeos::InputMethodEngineInterface::KeyboardEvent event;
event.type = input_ime::KeyboardEvent::ToString(key_data[i]->type);
event.key = key_data[i]->key;
event.code = key_data[i]->code;
@@ -639,7 +646,6 @@ bool InputImeSetCandidateWindowPropertiesFunction::RunImpl() {
return true;
}
-#if defined(OS_CHROMEOS)
bool InputImeSetCandidatesFunction::RunImpl() {
InputMethodEngineInterface* engine =
InputImeEventRouter::GetInstance()->GetActiveEngine(extension_id());
@@ -775,7 +781,6 @@ bool InputImeKeyEventHandledFunction::RunImpl() {
extension_id(), params->request_id, params->response);
return true;
}
-#endif
InputImeAPI::InputImeAPI(content::BrowserContext* context)
: profile_(Profile::FromBrowserContext(context)) {
« no previous file with comments | « no previous file | chrome/chrome_browser_chromeos.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698