Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/base/ime/input_method_mac.h" | 5 #include "ui/base/ime/input_method_mac.h" |
| 6 | 6 |
| 7 #include <Cocoa/Cocoa.h> | |
|
tapted
2016/10/25 02:57:57
nit: import
| |
| 8 | |
| 7 namespace ui { | 9 namespace ui { |
| 8 | 10 |
| 9 InputMethodMac::InputMethodMac(internal::InputMethodDelegate* delegate) { | 11 InputMethodMac::InputMethodMac(internal::InputMethodDelegate* delegate) { |
| 10 SetDelegate(delegate); | 12 SetDelegate(delegate); |
| 11 } | 13 } |
| 12 | 14 |
| 13 InputMethodMac::~InputMethodMac() { | 15 InputMethodMac::~InputMethodMac() { |
| 14 } | 16 } |
| 15 | 17 |
| 16 bool InputMethodMac::OnUntranslatedIMEMessage(const base::NativeEvent& event, | 18 bool InputMethodMac::OnUntranslatedIMEMessage(const base::NativeEvent& event, |
| 17 NativeEventResult* result) { | 19 NativeEventResult* result) { |
| 18 return false; | 20 return false; |
| 19 } | 21 } |
| 20 | 22 |
| 21 void InputMethodMac::DispatchKeyEvent(ui::KeyEvent* event) { | 23 void InputMethodMac::DispatchKeyEvent(ui::KeyEvent* event) { |
| 22 // This is used on Mac only to dispatch events post-IME. | 24 // This is used on Mac only to dispatch events post-IME. |
| 23 ignore_result(DispatchKeyEventPostIME(event)); | 25 ignore_result(DispatchKeyEventPostIME(event)); |
| 24 } | 26 } |
| 25 | 27 |
| 26 void InputMethodMac::OnCaretBoundsChanged(const TextInputClient* client) { | 28 void InputMethodMac::OnCaretBoundsChanged(const TextInputClient* client) { |
| 27 } | 29 } |
| 28 | 30 |
| 29 void InputMethodMac::CancelComposition(const TextInputClient* client) { | 31 void InputMethodMac::CancelComposition(const TextInputClient* client) { |
| 32 [[NSTextInputContext currentInputContext] discardMarkedText]; | |
|
tapted
2016/10/25 02:57:57
Do we need
if (!IsTextInputClientFocused(client
karandeepb
2016/10/25 04:48:59
Added the check.
| |
| 30 } | 33 } |
| 31 | 34 |
| 32 bool InputMethodMac::IsCandidatePopupOpen() const { | 35 bool InputMethodMac::IsCandidatePopupOpen() const { |
| 33 // There seems to be no way to tell if a candidate window is open. | 36 // There seems to be no way to tell if a candidate window is open. |
| 34 return false; | 37 return false; |
| 35 } | 38 } |
| 36 | 39 |
| 37 } // namespace ui | 40 } // namespace ui |
| OLD | NEW |