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

Side by Side Diff: ui/base/ime/input_method_mac.mm

Issue 2434433006: MacViews: Implement InputMethodMac::CancelComposition. (Closed)
Patch Set: Created 4 years, 2 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 | « ui/base/ime/BUILD.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
OLDNEW
« no previous file with comments | « ui/base/ime/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698