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

Side by Side Diff: ash/ime/input_method_event_handler.cc

Issue 2095193002: clang-format all of //ash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « ash/host/transformer_helper.cc ('k') | ash/keyboard_uma_event_filter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/ime/input_method_event_handler.h" 5 #include "ash/ime/input_method_event_handler.h"
6 6
7 #include "ui/base/ime/input_method.h" 7 #include "ui/base/ime/input_method.h"
8 #include "ui/events/event.h" 8 #include "ui/events/event.h"
9 9
10 namespace ash { 10 namespace ash {
11 11
12 //////////////////////////////////////////////////////////////////////////////// 12 ////////////////////////////////////////////////////////////////////////////////
13 // InputMethodEventHandler, public: 13 // InputMethodEventHandler, public:
14 14
15 InputMethodEventHandler::InputMethodEventHandler(ui::InputMethod* input_method) 15 InputMethodEventHandler::InputMethodEventHandler(ui::InputMethod* input_method)
16 : input_method_(input_method), post_ime_(false) { 16 : input_method_(input_method), post_ime_(false) {}
17 }
18 17
19 InputMethodEventHandler::~InputMethodEventHandler() { 18 InputMethodEventHandler::~InputMethodEventHandler() {}
20 }
21 19
22 void InputMethodEventHandler::SetPostIME(bool post_ime) { 20 void InputMethodEventHandler::SetPostIME(bool post_ime) {
23 post_ime_ = post_ime; 21 post_ime_ = post_ime;
24 } 22 }
25 23
26 //////////////////////////////////////////////////////////////////////////////// 24 ////////////////////////////////////////////////////////////////////////////////
27 // InputMethodEventHandler, EventFilter implementation: 25 // InputMethodEventHandler, EventFilter implementation:
28 26
29 void InputMethodEventHandler::OnKeyEvent(ui::KeyEvent* event) { 27 void InputMethodEventHandler::OnKeyEvent(ui::KeyEvent* event) {
30 // Never send synthesized key event. 28 // Never send synthesized key event.
31 if (event->flags() & ui::EF_IS_SYNTHESIZED) 29 if (event->flags() & ui::EF_IS_SYNTHESIZED)
32 return; 30 return;
33 if (post_ime_) 31 if (post_ime_)
34 return; 32 return;
35 input_method_->DispatchKeyEvent(event); 33 input_method_->DispatchKeyEvent(event);
36 event->StopPropagation(); 34 event->StopPropagation();
37 } 35 }
38 36
39 } // namespace ash 37 } // namespace ash
OLDNEW
« no previous file with comments | « ash/host/transformer_helper.cc ('k') | ash/keyboard_uma_event_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698