Revert "Reland c91b178b07b0d - Delete dead signin code (SigninGlobalError)"
[chromium-blink-merge.git] / ash / ime / input_method_event_handler.cc
blobda7d2fdc665e295b629fc8e8f94187567a152a65
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ash/ime/input_method_event_handler.h"
7 #include "ui/base/ime/input_method.h"
8 #include "ui/events/event.h"
10 namespace ash {
12 ////////////////////////////////////////////////////////////////////////////////
13 // InputMethodEventHandler, public:
15 InputMethodEventHandler::InputMethodEventHandler(ui::InputMethod* input_method)
16 : input_method_(input_method), post_ime_(false) {
19 InputMethodEventHandler::~InputMethodEventHandler() {
22 void InputMethodEventHandler::SetPostIME(bool post_ime) {
23 post_ime_ = post_ime;
26 ////////////////////////////////////////////////////////////////////////////////
27 // InputMethodEventHandler, EventFilter implementation:
29 void InputMethodEventHandler::OnKeyEvent(ui::KeyEvent* event) {
30 // Never send synthesized key event.
31 if (event->flags() & ui::EF_IS_SYNTHESIZED)
32 return;
33 if (post_ime_)
34 return;
35 input_method_->DispatchKeyEvent(event);
36 event->StopPropagation();
39 } // namespace ash