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

Side by Side Diff: ui/aura/test/input_method_glue.cc

Issue 2166863002: aura: Fix IME interaction in content-shell in chromeos build. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 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.
4
5 #include "ui/aura/test/input_method_glue.h"
6
7 #include "ui/aura/env.h"
8 #include "ui/aura/window_tree_host.h"
9 #include "ui/base/ime/input_method.h"
10 #include "ui/events/event.h"
11
12 namespace aura {
13
14 InputMethodGlue::InputMethodGlue(aura::WindowTreeHost* host) : host_(host) {
15 aura::Env::GetInstance()->AddPreTargetHandler(this);
16 host_->GetInputMethod()->SetDelegate(this);
17 }
18
19 InputMethodGlue::~InputMethodGlue() {
20 host_->GetInputMethod()->SetDelegate(host_);
21 aura::Env::GetInstance()->RemovePreTargetHandler(this);
22 }
23
24 void InputMethodGlue::OnKeyEvent(ui::KeyEvent* key) {
25 if (processing_ime_event_)
26 return;
27 host_->GetInputMethod()->DispatchKeyEvent(key);
28 key->StopPropagation();
29 }
30
31 ui::EventDispatchDetails InputMethodGlue::DispatchKeyEventPostIME(
32 ui::KeyEvent* key) {
33 base::AutoReset<bool> reset(&processing_ime_event_, true);
34 return host_->DispatchKeyEventPostIME(key);
35 }
36
37 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698