summaryrefslogtreecommitdiffstats
path: root/ash/ime
diff options
context:
space:
mode:
authorerg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-30 23:14:03 +0000
committererg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-30 23:14:03 +0000
commitde4ec531ed531ea578a783f7da16f67ce0f6d658 (patch)
tree4ec6d291f8da0240e153e4ce126d625d5fe89c5d /ash/ime
parent6a73c3006dde579493a5b070fe9bd3008608d5b1 (diff)
downloadchromium_src-de4ec531ed531ea578a783f7da16f67ce0f6d658.zip
chromium_src-de4ec531ed531ea578a783f7da16f67ce0f6d658.tar.gz
chromium_src-de4ec531ed531ea578a783f7da16f67ce0f6d658.tar.bz2
Ash/aura split: Get views_examples_exe semi-running on linux/X11.
This adds tons of hacks, most of which should be clearly labeled with TODOs. BUG=119759 TEST= Review URL: http://codereview.chromium.org/9873035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129990 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/ime')
-rw-r--r--ash/ime/event.cc30
-rw-r--r--ash/ime/event.h39
-rw-r--r--ash/ime/input_method_event_filter.cc8
3 files changed, 4 insertions, 73 deletions
diff --git a/ash/ime/event.cc b/ash/ime/event.cc
deleted file mode 100644
index a9d2622..0000000
--- a/ash/ime/event.cc
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ash/ime/event.h"
-
-namespace ash {
-
-TranslatedKeyEvent::TranslatedKeyEvent(const base::NativeEvent& native_event,
- bool is_char)
- : KeyEvent(native_event, is_char) {
- set_type(type() == ui::ET_KEY_PRESSED ?
- ui::ET_TRANSLATED_KEY_PRESS : ui::ET_TRANSLATED_KEY_RELEASE);
-}
-
-TranslatedKeyEvent::TranslatedKeyEvent(bool is_press,
- ui::KeyboardCode key_code,
- int flags)
- : KeyEvent((is_press ?
- ui::ET_TRANSLATED_KEY_PRESS : ui::ET_TRANSLATED_KEY_RELEASE),
- key_code,
- flags) {
-}
-
-void TranslatedKeyEvent::ConvertToKeyEvent() {
- set_type(type() == ui::ET_TRANSLATED_KEY_PRESS ?
- ui::ET_KEY_PRESSED : ui::ET_KEY_RELEASED);
-}
-
-} // namespace ash
diff --git a/ash/ime/event.h b/ash/ime/event.h
deleted file mode 100644
index 0247c7c..0000000
--- a/ash/ime/event.h
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef ASH_IME_EVENT_H_
-#define ASH_IME_EVENT_H_
-#pragma once
-
-#include "ash/ash_export.h"
-#include "base/event_types.h"
-#include "ui/aura/event.h"
-#include "ui/base/events.h"
-#include "ui/base/keycodes/keyboard_codes.h"
-
-namespace ash {
-
-// A key event which is translated by an input method (IME).
-// For example, if an IME receives a KeyEvent(ui::VKEY_SPACE), and it does not
-// consume the key, the IME usually generates and dispatches a
-// TranslatedKeyEvent(ui::VKEY_SPACE) event. If the IME receives a KeyEvent and
-// it does consume the event, it might dispatch a
-// TranslatedKeyEvent(ui::VKEY_PROCESSKEY) event as defined in the DOM spec.
-class ASH_EXPORT TranslatedKeyEvent : public aura::KeyEvent {
- public:
- TranslatedKeyEvent(const base::NativeEvent& native_event, bool is_char);
-
- // Used for synthetic events such as a VKEY_PROCESSKEY key event.
- TranslatedKeyEvent(bool is_press,
- ui::KeyboardCode key_code,
- int flags);
-
- // Changes the type() of the object from ET_TRANSLATED_KEY_* to ET_KEY_* so
- // that RenderWidgetHostViewAura and NativeWidgetAura could handle the event.
- void ConvertToKeyEvent();
-};
-
-} // namespace ash
-
-#endif // ASH_IME_EVENT_H_
diff --git a/ash/ime/input_method_event_filter.cc b/ash/ime/input_method_event_filter.cc
index de8c038..f0c9435 100644
--- a/ash/ime/input_method_event_filter.cc
+++ b/ash/ime/input_method_event_filter.cc
@@ -4,7 +4,6 @@
#include "ash/ime/input_method_event_filter.h"
-#include "ash/ime/event.h"
#include "ash/shell.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/event.h"
@@ -42,7 +41,7 @@ bool InputMethodEventFilter::PreHandleKeyEvent(aura::Window* target,
type == ui::ET_TRANSLATED_KEY_RELEASE) {
// The |event| is already handled by this object, change the type of the
// event to ui::ET_KEY_* and pass it to the next filter.
- static_cast<TranslatedKeyEvent*>(event)->ConvertToKeyEvent();
+ static_cast<aura::TranslatedKeyEvent*>(event)->ConvertToKeyEvent();
return false;
} else {
input_method_->DispatchKeyEvent(event->native_event());
@@ -75,7 +74,7 @@ void InputMethodEventFilter::DispatchKeyEventPostIME(
#if defined(OS_WIN)
DCHECK(event.message != WM_CHAR);
#endif
- TranslatedKeyEvent aura_event(event, false /* is_char */);
+ aura::TranslatedKeyEvent aura_event(event, false /* is_char */);
Shell::GetRootWindow()->DispatchKeyEvent(&aura_event);
}
@@ -83,7 +82,8 @@ void InputMethodEventFilter::DispatchFabricatedKeyEventPostIME(
ui::EventType type,
ui::KeyboardCode key_code,
int flags) {
- TranslatedKeyEvent aura_event(type == ui::ET_KEY_PRESSED, key_code, flags);
+ aura::TranslatedKeyEvent aura_event(type == ui::ET_KEY_PRESSED, key_code,
+ flags);
Shell::GetRootWindow()->DispatchKeyEvent(&aura_event);
}