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

Unified Diff: ui/views/cocoa/bridged_native_widget.mm

Issue 1207973002: Fixes for views_unittests on Mac after InputMethodBridge removal (DO NOT COMMIT) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20150625-IMERefactorMac-UPSTREAM
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/cocoa/bridged_native_widget.h ('k') | ui/views/cocoa/bridged_native_widget_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « ui/views/cocoa/bridged_native_widget.h ('k') | ui/views/cocoa/bridged_native_widget_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698