| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "app/keyboard_code_conversion.h" | 9 #include "app/keyboard_code_conversion.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| 11 #include "chrome/browser/browser_window.h" | 11 #include "chrome/browser/browser_window.h" |
| 12 #include "chrome/browser/extensions/extension_tabs_module.h" | 12 #include "chrome/browser/extensions/extension_tabs_module.h" |
| 13 #include "chrome/browser/renderer_host/render_view_host.h" | 13 #include "chrome/browser/renderer_host/render_view_host.h" |
| 14 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
| 15 #include "chrome/browser/views/frame/browser_view.h" | 15 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 16 #include "chrome/common/native_web_keyboard_event.h" | 16 #include "chrome/common/native_web_keyboard_event.h" |
| 17 #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h" | 17 #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h" |
| 18 #include "views/event.h" | 18 #include "views/event.h" |
| 19 #include "views/widget/root_view.h" | 19 #include "views/widget/root_view.h" |
| 20 | 20 |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 // Keys. | 23 // Keys. |
| 24 const char kType[] = "type"; | 24 const char kType[] = "type"; |
| 25 const char kKeyIdentifier[] = "keyIdentifier"; | 25 const char kKeyIdentifier[] = "keyIdentifier"; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 } | 110 } |
| 111 | 111 |
| 112 views::KeyEvent event(type, code, flags, 0, 0); | 112 views::KeyEvent event(type, code, flags, 0, 0); |
| 113 if (!root_view->ProcessKeyEvent(event)) { | 113 if (!root_view->ProcessKeyEvent(event)) { |
| 114 error_ = kKeyEventUnprocessedError; | 114 error_ = kKeyEventUnprocessedError; |
| 115 return false; | 115 return false; |
| 116 } | 116 } |
| 117 | 117 |
| 118 return true; | 118 return true; |
| 119 } | 119 } |
| OLD | NEW |