| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2006-2008 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_CHROME_PLUGIN_HOST_H__ | |
| 6 #define CHROME_BROWSER_CHROME_PLUGIN_HOST_H__ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "chrome/common/chrome_plugin_api.h" | |
| 10 | |
| 11 // Returns the table of browser functions for use from the browser process. | |
| 12 CPBrowserFuncs* GetCPBrowserFuncsForBrowser(); | |
| 13 | |
| 14 // Interface for generic data passed to plugin UI command handlers. | |
| 15 // Note: All functions are called on the plugin thread. | |
| 16 class CPCommandInterface { | |
| 17 public: | |
| 18 virtual ~CPCommandInterface() {} | |
| 19 | |
| 20 // Returns the actual pointer to pass to the plugin. | |
| 21 virtual void *GetData() = 0; | |
| 22 | |
| 23 // Called when the command has been invoked. The default action is deletion, | |
| 24 // but some callers may want to use output or check the return value before | |
| 25 // deleting. | |
| 26 virtual void OnCommandInvoked(CPError retval); | |
| 27 | |
| 28 // Some commands have an asynchronous response. This is called some time | |
| 29 // after OnCommandInvoked. | |
| 30 virtual void OnCommandResponse(CPError retval); | |
| 31 }; | |
| 32 | |
| 33 // Called when a builtin or plugin-registered UI command is invoked by a user | |
| 34 // gesture. 'data' is an optional parameter that allows command-specific data | |
| 35 // to be passed to the plugin. Ownership of 'data' is transferred to the | |
| 36 // callee. CPBrowsingContext is some additional data the caller wishes to pass | |
| 37 // through to the receiver. OnCommandInvoked is called after the command has | |
| 38 // been invoked. | |
| 39 void CPHandleCommand(int command, CPCommandInterface* data, | |
| 40 CPBrowsingContext context); | |
| 41 | |
| 42 #endif // CHROME_BROWSER_CHROME_PLUGIN_HOST_H__ | |
| OLD | NEW |