| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "ui/keyboard/keyboard_ui_handler.h" | 5 #include "ui/keyboard/keyboard_ui_handler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 if (!args->GetDictionary(0, ¶ms) || | 108 if (!args->GetDictionary(0, ¶ms) || |
| 109 !params->GetString("type", &type) || | 109 !params->GetString("type", &type) || |
| 110 !params->GetInteger("charValue", &char_value) || | 110 !params->GetInteger("charValue", &char_value) || |
| 111 !params->GetInteger("keyCode", &key_code) || | 111 !params->GetInteger("keyCode", &key_code) || |
| 112 !params->GetString("keyName", &key_name) || | 112 !params->GetString("keyName", &key_name) || |
| 113 !params->GetInteger("modifiers", &modifiers)) { | 113 !params->GetInteger("modifiers", &modifiers)) { |
| 114 LOG(ERROR) << "SendKeyEvent failed: bad argument"; | 114 LOG(ERROR) << "SendKeyEvent failed: bad argument"; |
| 115 return; | 115 return; |
| 116 } | 116 } |
| 117 | 117 |
| 118 aura::WindowEventDispatcher* dispatcher = | 118 aura::WindowEventDispatcher* dispatcher = web_ui()->GetWebContents()-> |
| 119 web_ui()->GetWebContents()->GetView()->GetNativeView()->GetDispatcher(); | 119 GetView()->GetNativeView()->GetHost()->dispatcher(); |
| 120 if (!dispatcher) { | 120 if (!dispatcher) { |
| 121 LOG(ERROR) << "sendKeyEvent failed: no dispatcher"; | 121 LOG(ERROR) << "sendKeyEvent failed: no dispatcher"; |
| 122 return; | 122 return; |
| 123 } | 123 } |
| 124 | 124 |
| 125 if (!keyboard::SendKeyEvent(type, | 125 if (!keyboard::SendKeyEvent(type, |
| 126 char_value, | 126 char_value, |
| 127 key_code, | 127 key_code, |
| 128 key_name, | 128 key_name, |
| 129 modifiers, | 129 modifiers, |
| 130 dispatcher)) { | 130 dispatcher)) { |
| 131 LOG(ERROR) << "sendKeyEvent failed"; | 131 LOG(ERROR) << "sendKeyEvent failed"; |
| 132 } | 132 } |
| 133 } | 133 } |
| 134 | 134 |
| 135 void KeyboardUIHandler::HandleHideKeyboard(const base::ListValue* args) { | 135 void KeyboardUIHandler::HandleHideKeyboard(const base::ListValue* args) { |
| 136 // TODO(stevet): Call into the keyboard controller to hide the keyboard | 136 // TODO(stevet): Call into the keyboard controller to hide the keyboard |
| 137 // directly. | 137 // directly. |
| 138 NOTIMPLEMENTED(); | 138 NOTIMPLEMENTED(); |
| 139 return; | 139 return; |
| 140 } | 140 } |
| 141 | 141 |
| 142 } // namespace keyboard | 142 } // namespace keyboard |
| OLD | NEW |