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 "extensions/browser/api/virtual_keyboard_private/virtual_keyboard_priva
te_api.h" | 5 #include "extensions/browser/api/virtual_keyboard_private/virtual_keyboard_priva
te_api.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
9 #include "extensions/browser/api/extensions_api_client.h" | 9 #include "extensions/browser/api/extensions_api_client.h" |
10 #include "extensions/browser/api/virtual_keyboard_private/virtual_keyboard_deleg
ate.h" | 10 #include "extensions/browser/api/virtual_keyboard_private/virtual_keyboard_deleg
ate.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 } | 72 } |
73 | 73 |
74 bool VirtualKeyboardPrivateHideKeyboardFunction::RunSync() { | 74 bool VirtualKeyboardPrivateHideKeyboardFunction::RunSync() { |
75 VirtualKeyboardDelegate* delegate = GetDelegate(this); | 75 VirtualKeyboardDelegate* delegate = GetDelegate(this); |
76 if (delegate) | 76 if (delegate) |
77 return delegate->HideKeyboard(); | 77 return delegate->HideKeyboard(); |
78 error_ = kNotYetImplementedError; | 78 error_ = kNotYetImplementedError; |
79 return false; | 79 return false; |
80 } | 80 } |
81 | 81 |
| 82 bool VirtualKeyboardPrivateSetHotrodKeyboardFunction::RunSync() { |
| 83 VirtualKeyboardDelegate* delegate = GetDelegate(this); |
| 84 if (delegate) { |
| 85 bool enable; |
| 86 EXTENSION_FUNCTION_VALIDATE(args_->GetBoolean(0, &enable)); |
| 87 delegate->SetHotrodKeyboard(enable); |
| 88 return true; |
| 89 } |
| 90 error_ = kNotYetImplementedError; |
| 91 return false; |
| 92 } |
| 93 |
82 bool VirtualKeyboardPrivateLockKeyboardFunction::RunSync() { | 94 bool VirtualKeyboardPrivateLockKeyboardFunction::RunSync() { |
83 VirtualKeyboardDelegate* delegate = GetDelegate(this); | 95 VirtualKeyboardDelegate* delegate = GetDelegate(this); |
84 if (delegate) { | 96 if (delegate) { |
85 bool lock; | 97 bool lock; |
86 EXTENSION_FUNCTION_VALIDATE(args_->GetBoolean(0, &lock)); | 98 EXTENSION_FUNCTION_VALIDATE(args_->GetBoolean(0, &lock)); |
87 return delegate->LockKeyboard(lock); | 99 return delegate->LockKeyboard(lock); |
88 } | 100 } |
89 error_ = kNotYetImplementedError; | 101 error_ = kNotYetImplementedError; |
90 return false; | 102 return false; |
91 } | 103 } |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 static base::LazyInstance<BrowserContextKeyedAPIFactory<VirtualKeyboardAPI>> | 177 static base::LazyInstance<BrowserContextKeyedAPIFactory<VirtualKeyboardAPI>> |
166 g_factory = LAZY_INSTANCE_INITIALIZER; | 178 g_factory = LAZY_INSTANCE_INITIALIZER; |
167 | 179 |
168 // static | 180 // static |
169 BrowserContextKeyedAPIFactory<VirtualKeyboardAPI>* | 181 BrowserContextKeyedAPIFactory<VirtualKeyboardAPI>* |
170 VirtualKeyboardAPI::GetFactoryInstance() { | 182 VirtualKeyboardAPI::GetFactoryInstance() { |
171 return g_factory.Pointer(); | 183 return g_factory.Pointer(); |
172 } | 184 } |
173 | 185 |
174 } // namespace extensions | 186 } // namespace extensions |
OLD | NEW |