| Index: Source/core/platform/midi/MIDIAccessorChromium.cpp
|
| diff --git a/Source/core/html/ime/InputMethodContext.cpp b/Source/core/platform/midi/MIDIAccessorChromium.cpp
|
| similarity index 52%
|
| copy from Source/core/html/ime/InputMethodContext.cpp
|
| copy to Source/core/platform/midi/MIDIAccessorChromium.cpp
|
| index 6723fbba788423b047956834c49e474ba01ca299..0f9e5b02f9d616a9552db537f333c758cf90151c 100644
|
| --- a/Source/core/html/ime/InputMethodContext.cpp
|
| +++ b/Source/core/platform/midi/MIDIAccessorChromium.cpp
|
| @@ -29,74 +29,59 @@
|
| */
|
|
|
| #include "config.h"
|
| -#include "core/html/ime/InputMethodContext.h"
|
|
|
| -#include "core/html/ime/Composition.h"
|
| +#include "core/platform/midi/MIDIAccessorChromium.h"
|
|
|
| -namespace WebCore {
|
| +#include "public/platform/Platform.h"
|
| +#include "wtf/text/WTFString.h"
|
|
|
| -PassOwnPtr<InputMethodContext> InputMethodContext::create(HTMLElement* element)
|
| -{
|
| - return adoptPtr(new InputMethodContext(element));
|
| -}
|
| -
|
| -InputMethodContext::InputMethodContext(HTMLElement* element)
|
| - : m_enabled(false)
|
| - , m_composition(0)
|
| - , m_element(element)
|
| -{
|
| - ScriptWrappable::init(this);
|
| -}
|
| +using WebKit::WebString;
|
| +
|
| +namespace WebCore {
|
|
|
| -InputMethodContext::~InputMethodContext()
|
| +// Factory method: Chromium-implementation
|
| +PassOwnPtr<MIDIAccessor> MIDIAccessor::create(MIDIAccessorClient* client)
|
| {
|
| + return adoptPtr(new MIDIAccessorChromium(client));
|
| }
|
|
|
| -Composition* InputMethodContext::composition() const
|
| +MIDIAccessorChromium::MIDIAccessorChromium(MIDIAccessorClient* client)
|
| + : m_client(client)
|
| {
|
| - // FIXME: Implement this. This should lazily update the composition object
|
| - // here.
|
| - return m_composition.get();
|
| -}
|
| + ASSERT(client);
|
|
|
| -bool InputMethodContext::enabled() const
|
| -{
|
| - // FIXME: Implement this. Enabled state may change between calls from user
|
| - // action and the status should be retrieved here.
|
| - return m_enabled;
|
| + m_accessor = adoptPtr(WebKit::Platform::current()->createMIDIAccessor(this));
|
| + ASSERT(m_accessor);
|
| }
|
|
|
| -void InputMethodContext::setEnabled(bool enabled)
|
| +void MIDIAccessorChromium::requestAccess(int access)
|
| {
|
| - // FIXME: Implement this. The enabled state should propagate to IME.
|
| - m_enabled = enabled;
|
| + m_accessor->requestAccess(access);
|
| }
|
|
|
| -String InputMethodContext::locale() const
|
| +void MIDIAccessorChromium::addInputPort(const WebString& id, const WebString& manufacturer, const WebString& name, const WebString& version)
|
| {
|
| - // FIXME: Implement this.
|
| - return emptyString();
|
| + m_client->addInputPort(id, manufacturer, name, version);
|
| }
|
|
|
| -void InputMethodContext::confirmComposition()
|
| +void MIDIAccessorChromium::addOutputPort(const WebString& id, const WebString& manufacturer, const WebString& name, const WebString& version)
|
| {
|
| - // FIXME: Implement this.
|
| + m_client->addOutputPort(id, manufacturer, name, version);
|
| }
|
|
|
| -void InputMethodContext::setCaretRectangle(Node* anchor, int x, int y, int w, int h)
|
| +void MIDIAccessorChromium::accessApproved(bool approved)
|
| {
|
| - // FIXME: Implement this.
|
| + m_client->accessApproved(approved);
|
| }
|
|
|
| -void InputMethodContext::setExclusionRectangle(Node* anchor, int x, int y, int w, int h)
|
| +void MIDIAccessorChromium::sendMIDIData(unsigned portIndex, const unsigned char* data, size_t length, double timeStamp)
|
| {
|
| - // FIXME: Implement this.
|
| + m_accessor->sendMIDIData(portIndex, data, length, timeStamp);
|
| }
|
|
|
| -bool InputMethodContext::open()
|
| +void MIDIAccessorChromium::receiveMIDIData(unsigned portIndex, const UInt8* data, size_t length, double timeStamp)
|
| {
|
| - // FIXME: Implement this.
|
| - return false;
|
| + m_client->receiveMIDIData(portIndex, data, length, timeStamp);
|
| }
|
|
|
| } // namespace WebCore
|
|
|