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 59 matching lines...) Loading... |
70 } | 70 } |
71 | 71 |
72 bool VirtualKeyboardPrivateHideKeyboardFunction::RunSync() { | 72 bool VirtualKeyboardPrivateHideKeyboardFunction::RunSync() { |
73 VirtualKeyboardDelegate* delegate = GetDelegate(this); | 73 VirtualKeyboardDelegate* delegate = GetDelegate(this); |
74 if (delegate) | 74 if (delegate) |
75 return delegate->HideKeyboard(); | 75 return delegate->HideKeyboard(); |
76 error_ = kNotYetImplementedError; | 76 error_ = kNotYetImplementedError; |
77 return false; | 77 return false; |
78 } | 78 } |
79 | 79 |
| 80 bool VirtualKeyboardPrivateSetHotrodKeyboardFunction::RunSync() { |
| 81 VirtualKeyboardDelegate* delegate = GetDelegate(this); |
| 82 if (delegate) { |
| 83 bool enable; |
| 84 EXTENSION_FUNCTION_VALIDATE(args_->GetBoolean(0, &enable)); |
| 85 delegate->SetHotrodKeyboard(enable); |
| 86 return true; |
| 87 } |
| 88 error_ = kNotYetImplementedError; |
| 89 return false; |
| 90 } |
| 91 |
80 bool VirtualKeyboardPrivateLockKeyboardFunction::RunSync() { | 92 bool VirtualKeyboardPrivateLockKeyboardFunction::RunSync() { |
81 VirtualKeyboardDelegate* delegate = GetDelegate(this); | 93 VirtualKeyboardDelegate* delegate = GetDelegate(this); |
82 if (delegate) { | 94 if (delegate) { |
83 bool lock; | 95 bool lock; |
84 EXTENSION_FUNCTION_VALIDATE(args_->GetBoolean(0, &lock)); | 96 EXTENSION_FUNCTION_VALIDATE(args_->GetBoolean(0, &lock)); |
85 return delegate->LockKeyboard(lock); | 97 return delegate->LockKeyboard(lock); |
86 } | 98 } |
87 error_ = kNotYetImplementedError; | 99 error_ = kNotYetImplementedError; |
88 return false; | 100 return false; |
89 } | 101 } |
(...skipping 56 matching lines...) Loading... |
146 static base::LazyInstance<BrowserContextKeyedAPIFactory<VirtualKeyboardAPI>> | 158 static base::LazyInstance<BrowserContextKeyedAPIFactory<VirtualKeyboardAPI>> |
147 g_factory = LAZY_INSTANCE_INITIALIZER; | 159 g_factory = LAZY_INSTANCE_INITIALIZER; |
148 | 160 |
149 // static | 161 // static |
150 BrowserContextKeyedAPIFactory<VirtualKeyboardAPI>* | 162 BrowserContextKeyedAPIFactory<VirtualKeyboardAPI>* |
151 VirtualKeyboardAPI::GetFactoryInstance() { | 163 VirtualKeyboardAPI::GetFactoryInstance() { |
152 return g_factory.Pointer(); | 164 return g_factory.Pointer(); |
153 } | 165 } |
154 | 166 |
155 } // namespace extensions | 167 } // namespace extensions |
OLD | NEW |