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

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

Issue 1257603006: Refactoring for the InputMethod & InputMethodDelegate interfaces. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed Sadrul's comment. Created 5 years, 4 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/controls/textfield/textfield_unittest.cc » ('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 1759a9591417fda6c370599fbd4cccb5c0c50f59..1bd03ff243ee6d097a8d3ac0e766240a09d3199e 100644
--- a/ui/views/cocoa/bridged_native_widget.mm
+++ b/ui/views/cocoa/bridged_native_widget.mm
@@ -789,12 +789,15 @@ void BridgedNativeWidget::CreateLayer(ui::LayerType layer_type,
////////////////////////////////////////////////////////////////////////////////
// BridgedNativeWidget, internal::InputMethodDelegate:
-bool BridgedNativeWidget::DispatchKeyEventPostIME(const ui::KeyEvent& key) {
+ui::EventDispatchDetails BridgedNativeWidget::DispatchKeyEventPostIME(
+ ui::KeyEvent* key) {
DCHECK(focus_manager_);
- native_widget_mac_->GetWidget()->OnKeyEvent(const_cast<ui::KeyEvent*>(&key));
- if (!key.handled())
- return !focus_manager_->OnKeyEvent(key);
- return key.handled();
+ native_widget_mac_->GetWidget()->OnKeyEvent(key);
+ if (!key->handled()) {
+ if (!focus_manager_->OnKeyEvent(*key))
+ key->StopPropagation();
+ }
+ return ui::EventDispatchDetails();
}
////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « ui/views/cocoa/bridged_native_widget.h ('k') | ui/views/controls/textfield/textfield_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698