Commit a802ee16 authored by spang@chromium.org's avatar spang@chromium.org

ozone: Protect X11-specific code in IME support

This fixes some build errors for the "chromeos=1 use_ozone=1" build. We
need to stub out IME support until we have an ozone implementation.

BUG=361341
TEST=chrome --ozone-platform=test

Review URL: https://codereview.chromium.org/232233003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263033 0039d316-1c4b-4281-b951-d872f2087c98
parent 67fd3143
......@@ -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)) {
......
......@@ -1036,6 +1036,10 @@
'dependencies': [
'../ui/ozone/ozone.gyp:ozone',
],
'sources!': [
'browser/chromeos/input_method/input_method_engine.cc',
'browser/chromeos/input_method/input_method_engine.h',
],
'sources/': [
['exclude', '^browser/chromeos/events/'],
],
......
......@@ -110,6 +110,8 @@
'sources!': [
'composition_text_util_pango.cc',
'composition_text_util_pango.h',
'chromeos/character_composer.cc',
'chromeos/character_composer.h',
],
}],
],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment