| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/virtual_keyboard_private/chrome_virtual_
keyboard_delegate.h" | 5 #include "chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_
keyboard_delegate.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 return true; | 104 return true; |
| 105 } | 105 } |
| 106 | 106 |
| 107 bool ChromeVirtualKeyboardDelegate::InsertText(const base::string16& text) { | 107 bool ChromeVirtualKeyboardDelegate::InsertText(const base::string16& text) { |
| 108 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 108 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 109 return keyboard::InsertText(text); | 109 return keyboard::InsertText(text); |
| 110 } | 110 } |
| 111 | 111 |
| 112 bool ChromeVirtualKeyboardDelegate::OnKeyboardLoaded() { | 112 bool ChromeVirtualKeyboardDelegate::OnKeyboardLoaded() { |
| 113 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 113 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 114 keyboard::MarkKeyboardLoadFinished(); | 114 base::RecordAction(base::UserMetricsAction("VirtualKeyboardLoaded")); |
| 115 base::UserMetricsAction("VirtualKeyboardLoaded"); | |
| 116 return true; | 115 return true; |
| 117 } | 116 } |
| 118 | 117 |
| 119 void ChromeVirtualKeyboardDelegate::SetHotrodKeyboard(bool enable) { | 118 void ChromeVirtualKeyboardDelegate::SetHotrodKeyboard(bool enable) { |
| 120 if (keyboard::GetHotrodKeyboardEnabled() == enable) | 119 if (keyboard::GetHotrodKeyboardEnabled() == enable) |
| 121 return; | 120 return; |
| 122 | 121 |
| 123 keyboard::SetHotrodKeyboardEnabled(enable); | 122 keyboard::SetHotrodKeyboardEnabled(enable); |
| 124 // This reloads virtual keyboard even if it exists. This ensures virtual | 123 // This reloads virtual keyboard even if it exists. This ensures virtual |
| 125 // keyboard gets the correct state of the hotrod keyboard through | 124 // keyboard gets the correct state of the hotrod keyboard through |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 "gestureediting", keyboard::IsGestureEditingEnabled())); | 221 "gestureediting", keyboard::IsGestureEditingEnabled())); |
| 223 features->AppendString(GenerateFeatureFlag( | 222 features->AppendString(GenerateFeatureFlag( |
| 224 "voiceinput", has_input_devices && keyboard::IsVoiceInputEnabled())); | 223 "voiceinput", has_input_devices && keyboard::IsVoiceInputEnabled())); |
| 225 features->AppendString(GenerateFeatureFlag( | 224 features->AppendString(GenerateFeatureFlag( |
| 226 "experimental", keyboard::IsExperimentalInputViewEnabled())); | 225 "experimental", keyboard::IsExperimentalInputViewEnabled())); |
| 227 results->Set("features", std::move(features)); | 226 results->Set("features", std::move(features)); |
| 228 std::move(on_settings_callback).Run(std::move(results)); | 227 std::move(on_settings_callback).Run(std::move(results)); |
| 229 } | 228 } |
| 230 | 229 |
| 231 } // namespace extensions | 230 } // namespace extensions |
| OLD | NEW |