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

Unified Diff: ui/views/corewm/input_method_event_filter.cc

Issue 194843004: Move files from ui/views/corewm to ui/wm/core (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 9 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 | « ui/views/corewm/input_method_event_filter.h ('k') | ui/views/corewm/input_method_event_filter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/corewm/input_method_event_filter.cc
diff --git a/ui/views/corewm/input_method_event_filter.cc b/ui/views/corewm/input_method_event_filter.cc
deleted file mode 100644
index 56b19402055be619b69c9980408e9bae89e29395..0000000000000000000000000000000000000000
--- a/ui/views/corewm/input_method_event_filter.cc
+++ /dev/null
@@ -1,75 +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 "ui/views/corewm/input_method_event_filter.h"
-
-#include "ui/aura/client/aura_constants.h"
-#include "ui/aura/window_event_dispatcher.h"
-#include "ui/base/ime/input_method.h"
-#include "ui/base/ime/input_method_factory.h"
-#include "ui/events/event.h"
-#include "ui/events/event_processor.h"
-
-namespace views {
-namespace corewm {
-
-////////////////////////////////////////////////////////////////////////////////
-// InputMethodEventFilter, public:
-
-InputMethodEventFilter::InputMethodEventFilter(gfx::AcceleratedWidget widget)
- : input_method_(ui::CreateInputMethod(this, widget)),
- target_dispatcher_(NULL) {
- // TODO(yusukes): Check if the root window is currently focused and pass the
- // result to Init().
- input_method_->Init(true);
-}
-
-InputMethodEventFilter::~InputMethodEventFilter() {
-}
-
-void InputMethodEventFilter::SetInputMethodPropertyInRootWindow(
- aura::Window* root_window) {
- root_window->SetProperty(aura::client::kRootWindowInputMethodKey,
- input_method_.get());
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// InputMethodEventFilter, EventFilter implementation:
-
-void InputMethodEventFilter::OnKeyEvent(ui::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<ui::TranslatedKeyEvent*>(event)->ConvertToKeyEvent();
- } else {
- // If the focused window is changed, all requests to IME will be
- // discarded so it's safe to update the target_dispatcher_ here.
- aura::Window* target = static_cast<aura::Window*>(event->target());
- target_dispatcher_ = target->GetRootWindow()->GetHost()->event_processor();
- DCHECK(target_dispatcher_);
- if (input_method_->DispatchKeyEvent(*event))
- event->StopPropagation();
- }
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// InputMethodEventFilter, ui::InputMethodDelegate implementation:
-
-bool InputMethodEventFilter::DispatchKeyEventPostIME(
- const ui::KeyEvent& event) {
-#if defined(OS_WIN)
- if (DCHECK_IS_ON() && event.HasNativeEvent())
- DCHECK_NE(event.native_event().message, static_cast<UINT>(WM_CHAR));
-#endif
- ui::TranslatedKeyEvent aura_event(event);
- ui::EventDispatchDetails details =
- target_dispatcher_->OnEventFromSource(&aura_event);
- CHECK(!details.dispatcher_destroyed);
- return aura_event.handled();
-}
-
-} // namespace corewm
-} // namespace views
« no previous file with comments | « ui/views/corewm/input_method_event_filter.h ('k') | ui/views/corewm/input_method_event_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698