| 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/extension_input_api.h" | 5 #include "chrome/browser/extensions/extension_input_api.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" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "chrome/browser/extensions/key_identifier_conversion_views.h" | 12 #include "chrome/browser/extensions/key_identifier_conversion_views.h" |
| 13 #include "chrome/browser/ui/browser.h" | 13 #include "chrome/browser/ui/browser.h" |
| 14 #include "chrome/browser/ui/browser_window.h" | 14 #include "chrome/browser/ui/browser_window.h" |
| 15 #include "chrome/browser/ui/views/frame/browser_view.h" | 15 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 16 #include "chrome/common/chrome_notification_types.h" | 16 #include "chrome/common/chrome_notification_types.h" |
| 17 #include "ui/base/event.h" | 17 #include "ui/base/events/event.h" |
| 18 #include "ui/views/ime/input_method.h" | 18 #include "ui/views/ime/input_method.h" |
| 19 #include "ui/views/views_delegate.h" | 19 #include "ui/views/views_delegate.h" |
| 20 #include "ui/views/widget/widget.h" | 20 #include "ui/views/widget/widget.h" |
| 21 | 21 |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 // Keys. | 24 // Keys. |
| 25 const char kType[] = "type"; | 25 const char kType[] = "type"; |
| 26 const char kKeyIdentifier[] = "keyIdentifier"; | 26 const char kKeyIdentifier[] = "keyIdentifier"; |
| 27 const char kAlt[] = "altKey"; | 27 const char kAlt[] = "altKey"; |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 views::InputMethod* ime = widget->GetInputMethod(); | 132 views::InputMethod* ime = widget->GetInputMethod(); |
| 133 if (ime) { | 133 if (ime) { |
| 134 ime->DispatchKeyEvent(event); | 134 ime->DispatchKeyEvent(event); |
| 135 } else if (!widget->OnKeyEvent(event)) { | 135 } else if (!widget->OnKeyEvent(event)) { |
| 136 error_ = kKeyEventUnprocessedError; | 136 error_ = kKeyEventUnprocessedError; |
| 137 return false; | 137 return false; |
| 138 } | 138 } |
| 139 | 139 |
| 140 return true; | 140 return true; |
| 141 } | 141 } |
| OLD | NEW |