Index: ash/ime/input_method_event_filter.cc |
diff --git a/ash/ime/input_method_event_filter.cc b/ash/ime/input_method_event_filter.cc |
deleted file mode 100644 |
index f0c9435e7115421757d7563d1e64b37918e6733f..0000000000000000000000000000000000000000 |
--- a/ash/ime/input_method_event_filter.cc |
+++ /dev/null |
@@ -1,91 +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. |
- |
-#include "ash/ime/input_method_event_filter.h" |
- |
-#include "ash/shell.h" |
-#include "ui/aura/client/aura_constants.h" |
-#include "ui/aura/event.h" |
-#include "ui/aura/root_window.h" |
-#include "ui/base/ime/input_method.h" |
-#include "ui/base/ime/input_method_factory.h" |
- |
-namespace ash { |
-namespace internal { |
- |
-//////////////////////////////////////////////////////////////////////////////// |
-// InputMethodEventFilter, public: |
- |
-InputMethodEventFilter::InputMethodEventFilter() |
- : ALLOW_THIS_IN_INITIALIZER_LIST( |
- input_method_(ui::CreateInputMethod(this))) { |
- // TODO(yusukes): Check if the root window is currently focused and pass the |
- // result to Init(). |
- input_method_->Init(true); |
- Shell::GetRootWindow()->SetProperty( |
- aura::client::kRootWindowInputMethodKey, |
- input_method_.get()); |
-} |
- |
-InputMethodEventFilter::~InputMethodEventFilter() { |
-} |
- |
-//////////////////////////////////////////////////////////////////////////////// |
-// InputMethodEventFilter, EventFilter implementation: |
- |
-bool InputMethodEventFilter::PreHandleKeyEvent(aura::Window* target, |
- aura::KeyEvent* event) { |
- const ui::EventType type = event->type(); |
- if (type == ui::ET_TRANSLATED_KEY_PRESS || |
- 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<aura::TranslatedKeyEvent*>(event)->ConvertToKeyEvent(); |
- return false; |
- } else { |
- input_method_->DispatchKeyEvent(event->native_event()); |
- return true; |
- } |
-} |
- |
-bool InputMethodEventFilter::PreHandleMouseEvent(aura::Window* target, |
- aura::MouseEvent* event) { |
- return false; |
-} |
- |
-ui::TouchStatus InputMethodEventFilter::PreHandleTouchEvent( |
- aura::Window* target, |
- aura::TouchEvent* event) { |
- return ui::TOUCH_STATUS_UNKNOWN; |
-} |
- |
-ui::GestureStatus InputMethodEventFilter::PreHandleGestureEvent( |
- aura::Window* target, |
- aura::GestureEvent* event) { |
- return ui::GESTURE_STATUS_UNKNOWN; |
-} |
- |
-//////////////////////////////////////////////////////////////////////////////// |
-// InputMethodEventFilter, ui::InputMethodDelegate implementation: |
- |
-void InputMethodEventFilter::DispatchKeyEventPostIME( |
- const base::NativeEvent& event) { |
-#if defined(OS_WIN) |
- DCHECK(event.message != WM_CHAR); |
-#endif |
- aura::TranslatedKeyEvent aura_event(event, false /* is_char */); |
- Shell::GetRootWindow()->DispatchKeyEvent(&aura_event); |
-} |
- |
-void InputMethodEventFilter::DispatchFabricatedKeyEventPostIME( |
- ui::EventType type, |
- ui::KeyboardCode key_code, |
- int flags) { |
- aura::TranslatedKeyEvent aura_event(type == ui::ET_KEY_PRESSED, key_code, |
- flags); |
- Shell::GetRootWindow()->DispatchKeyEvent(&aura_event); |
-} |
- |
-} // namespace internal |
-} // namespace ash |