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 30 matching lines...) Expand all Loading... |
41 "sendKeyEvent", | 41 "sendKeyEvent", |
42 base::Bind(&KeyboardUIHandler::HandleSendKeyEventMessage, | 42 base::Bind(&KeyboardUIHandler::HandleSendKeyEventMessage, |
43 base::Unretained(this))); | 43 base::Unretained(this))); |
44 web_ui()->RegisterMessageCallback( | 44 web_ui()->RegisterMessageCallback( |
45 "hideKeyboard", | 45 "hideKeyboard", |
46 base::Bind(&KeyboardUIHandler::HandleHideKeyboard, | 46 base::Bind(&KeyboardUIHandler::HandleHideKeyboard, |
47 base::Unretained(this))); | 47 base::Unretained(this))); |
48 } | 48 } |
49 | 49 |
50 void KeyboardUIHandler::HandleInsertTextMessage(const base::ListValue* args) { | 50 void KeyboardUIHandler::HandleInsertTextMessage(const base::ListValue* args) { |
51 string16 text; | 51 base::string16 text; |
52 if (!args->GetString(0, &text)) { | 52 if (!args->GetString(0, &text)) { |
53 LOG(ERROR) << "insertText failed: bad argument"; | 53 LOG(ERROR) << "insertText failed: bad argument"; |
54 return; | 54 return; |
55 } | 55 } |
56 | 56 |
57 aura::Window* root_window = | 57 aura::Window* root_window = |
58 web_ui()->GetWebContents()->GetView()->GetNativeView()->GetRootWindow(); | 58 web_ui()->GetWebContents()->GetView()->GetNativeView()->GetRootWindow(); |
59 if (!root_window) { | 59 if (!root_window) { |
60 LOG(ERROR) << "insertText failed: no root window"; | 60 LOG(ERROR) << "insertText failed: no root window"; |
61 return; | 61 return; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |