OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/extension_input_api.h" | 5 #include "chrome/browser/extensions/extension_input_api.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 } | 137 } |
138 | 138 |
139 #if defined(TOUCH_UI) | 139 #if defined(TOUCH_UI) |
140 bool HideKeyboardFunction::RunImpl() { | 140 bool HideKeyboardFunction::RunImpl() { |
141 NotificationService::current()->Notify( | 141 NotificationService::current()->Notify( |
142 NotificationType::HIDE_KEYBOARD_INVOKED, | 142 NotificationType::HIDE_KEYBOARD_INVOKED, |
143 Source<HideKeyboardFunction>(this), | 143 Source<HideKeyboardFunction>(this), |
144 NotificationService::NoDetails()); | 144 NotificationService::NoDetails()); |
145 return true; | 145 return true; |
146 } | 146 } |
| 147 |
| 148 bool SetKeyboardHeightFunction::RunImpl() { |
| 149 int height = 0; |
| 150 EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &height)); |
| 151 NotificationService::current()->Notify( |
| 152 NotificationType::SET_KEYBOARD_HEIGHT_INVOKED, |
| 153 Source<SetKeyboardHeightFunction>(this), |
| 154 Details<int>(&height)); |
| 155 return true; |
| 156 } |
147 #endif | 157 #endif |
148 | 158 |
149 #if defined(OS_CHROMEOS) && defined(TOUCH_UI) | 159 #if defined(OS_CHROMEOS) && defined(TOUCH_UI) |
150 // TODO(yusukes): This part should be moved to extension_input_api_chromeos.cc. | 160 // TODO(yusukes): This part should be moved to extension_input_api_chromeos.cc. |
151 bool SendHandwritingStrokeFunction::RunImpl() { | 161 bool SendHandwritingStrokeFunction::RunImpl() { |
152 chromeos::CrosLibrary* cros_library = chromeos::CrosLibrary::Get(); | 162 chromeos::CrosLibrary* cros_library = chromeos::CrosLibrary::Get(); |
153 if (!cros_library->EnsureLoaded()) { | 163 if (!cros_library->EnsureLoaded()) { |
154 error_ = kCrosLibraryNotLoadedError; | 164 error_ = kCrosLibraryNotLoadedError; |
155 return false; | 165 return false; |
156 } | 166 } |
(...skipping 26 matching lines...) Expand all Loading... |
183 // TODO(yusukes): Add a parameter for an input context ID. | 193 // TODO(yusukes): Add a parameter for an input context ID. |
184 int stroke_count = 0; // zero means 'clear all strokes'. | 194 int stroke_count = 0; // zero means 'clear all strokes'. |
185 if (HasOptionalArgument(0)) { | 195 if (HasOptionalArgument(0)) { |
186 EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &stroke_count)); | 196 EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &stroke_count)); |
187 EXTENSION_FUNCTION_VALIDATE(stroke_count >= 0); | 197 EXTENSION_FUNCTION_VALIDATE(stroke_count >= 0); |
188 } | 198 } |
189 cros_library->GetInputMethodLibrary()->CancelHandwritingStrokes(stroke_count); | 199 cros_library->GetInputMethodLibrary()->CancelHandwritingStrokes(stroke_count); |
190 return true; | 200 return true; |
191 } | 201 } |
192 #endif | 202 #endif |
OLD | NEW |