OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/extensions/api/input/input.h" | 5 #include "chrome/browser/extensions/api/input/input.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 flags, | 115 flags, |
116 prototype_event.is_char()); | 116 prototype_event.is_char()); |
117 if (character) { | 117 if (character) { |
118 event.set_character(character); | 118 event.set_character(character); |
119 event.set_unmodified_character(character); | 119 event.set_unmodified_character(character); |
120 } | 120 } |
121 | 121 |
122 views::InputMethod* ime = widget->GetInputMethod(); | 122 views::InputMethod* ime = widget->GetInputMethod(); |
123 if (ime) { | 123 if (ime) { |
124 ime->DispatchKeyEvent(event); | 124 ime->DispatchKeyEvent(event); |
125 } else if (!widget->OnKeyEvent(event)) { | 125 } else { |
126 error_ = kKeyEventUnprocessedError; | 126 widget->OnKeyEvent(&event); |
127 return false; | 127 if (event.handled()) { |
| 128 error_ = kKeyEventUnprocessedError; |
| 129 return false; |
| 130 } |
128 } | 131 } |
129 | 132 |
130 return true; | 133 return true; |
131 } | 134 } |
132 | 135 |
133 } // namespace extensions | 136 } // namespace extensions |
OLD | NEW |