Index: ui/views/cocoa/bridged_native_widget.mm |
diff --git a/ui/views/cocoa/bridged_native_widget.mm b/ui/views/cocoa/bridged_native_widget.mm |
index 58ac5b4cf25446ffa67ff2e8a359e0ab952f8e4c..72c2a297170e97f3078662814f76d8bd023b58d9 100644 |
--- a/ui/views/cocoa/bridged_native_widget.mm |
+++ b/ui/views/cocoa/bridged_native_widget.mm |
@@ -707,9 +707,7 @@ void BridgedNativeWidget::OnSizeConstraintsChanged() { |
ui::InputMethod* BridgedNativeWidget::GetInputMethod() { |
if (!input_method_) { |
- // Delegate is NULL because Mac IME does not need DispatchKeyEventPostIME |
tapted
2015/06/25 11:54:14
I think this was true (and worked OK) when InputMe
|
- // callbacks. |
- input_method_ = ui::CreateInputMethod(NULL, nil); |
+ input_method_ = ui::CreateInputMethod(this, nil); |
input_method_->OnFocus(); |
} |
return input_method_.get(); |
@@ -750,6 +748,17 @@ void BridgedNativeWidget::CreateLayer(ui::LayerType layer_type, |
} |
//////////////////////////////////////////////////////////////////////////////// |
+// BridgedNativeWidget, internal::InputMethodDelegate: |
+ |
+bool BridgedNativeWidget::DispatchKeyEventPostIME(const ui::KeyEvent& key) { |
+ DCHECK(focus_manager_); |
+ native_widget_mac_->GetWidget()->OnKeyEvent(const_cast<ui::KeyEvent*>(&key)); |
+ if (!key.handled()) |
+ focus_manager_->OnKeyEvent(key); |
+ return key.handled(); |
+} |
+ |
+//////////////////////////////////////////////////////////////////////////////// |
// BridgedNativeWidget, CocoaMouseCaptureDelegate: |
void BridgedNativeWidget::PostCapturedEvent(NSEvent* event) { |