1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_INPUT_INPUT_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_INPUT_INPUT_H_ 7 8 #include "base/compiler_specific.h" 9 #include "chrome/browser/extensions/api/profile_keyed_api_factory.h" 10 #include "chrome/browser/extensions/extension_function.h" 11 12 class Profile; 13 14 namespace extensions { 15 16 class InsertTextInputFunction : public SyncExtensionFunction { 17 public: 18 DECLARE_EXTENSION_FUNCTION( 19 "experimental.input.virtualKeyboard.insertText", 20 EXPERIMENTAL_INPUT_VIRTUALKEYBOARD_INSERTTEXT); 21 22 protected: 23 virtual ~InsertTextInputFunction() {} 24 25 // ExtensionFunction: 26 virtual bool RunImpl() OVERRIDE; 27 }; 28 29 class MoveCursorFunction : public SyncExtensionFunction { 30 public: 31 DECLARE_EXTENSION_FUNCTION( 32 "experimental.input.virtualKeyboard.moveCursor", 33 EXPERIMENTAL_INPUT_VIRTUALKEYBOARD_MOVECURSOR); 34 35 protected: 36 virtual ~MoveCursorFunction() {} 37 38 // ExtensionFunction. 39 virtual bool RunImpl() OVERRIDE; 40 }; 41 42 class InputAPI : public ProfileKeyedAPI { 43 public: 44 explicit InputAPI(Profile* profile); 45 virtual ~InputAPI(); 46 47 // ProfileKeyedAPI implementation. 48 static ProfileKeyedAPIFactory<InputAPI>* GetFactoryInstance(); 49 50 private: 51 friend class ProfileKeyedAPIFactory<InputAPI>; 52 53 // ProfileKeyedAPI implementation. 54 static const char* service_name() { 55 return "InputAPI"; 56 } 57 static const bool kServiceIsNULLWhileTesting = true; 58 }; 59 60 } // namespace extensions 61 62 #endif // CHROME_BROWSER_EXTENSIONS_API_INPUT_INPUT_H_ 63