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

Unified Diff: ui/base/ime/input_method_mac.mm

Issue 2434433006: MacViews: Implement InputMethodMac::CancelComposition. (Closed)
Patch Set: Address comments. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/ime/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/ime/input_method_mac.mm
diff --git a/ui/base/ime/input_method_mac.mm b/ui/base/ime/input_method_mac.mm
index b03b1620e3f1758361d109a1794036172a841452..e53f06744475a57c05a76c50051f75a527de95a4 100644
--- a/ui/base/ime/input_method_mac.mm
+++ b/ui/base/ime/input_method_mac.mm
@@ -4,6 +4,8 @@
#include "ui/base/ime/input_method_mac.h"
+#import <Cocoa/Cocoa.h>
+
namespace ui {
InputMethodMac::InputMethodMac(internal::InputMethodDelegate* delegate) {
@@ -27,6 +29,10 @@
}
void InputMethodMac::CancelComposition(const TextInputClient* client) {
+ if (!IsTextInputClientFocused(client))
+ return;
+
+ [[NSTextInputContext currentInputContext] discardMarkedText];
}
bool InputMethodMac::IsCandidatePopupOpen() const {
« 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