Chromium Code Reviews| Index: chrome/browser/extensions/api/README.txt |
| diff --git a/chrome/browser/extensions/api/README.txt b/chrome/browser/extensions/api/README.txt |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..3e4f73c22029fbadb827293f0d0f53dca154b2e8 |
| --- /dev/null |
| +++ b/chrome/browser/extensions/api/README.txt |
| @@ -0,0 +1,31 @@ |
| +This file describes steps and files needed when adding a new API to Chrome. |
| +Before you start coding your new API, though, make sure you follow the process |
| +described at: |
| + http://www.chromium.org/developers/design-documents/extensions/proposed-changes/apis-under-development |
| + |
| +This describes the new mechanism for defining API using IDL files. Some old APIs |
| +are still described using a JSON format. Don't rely on these. For inspiration, |
| +you can look at the "alarms" API. |
| + |
| +Supposing your API is called "Foo" and is currently experimental, here are the |
| +steps to add it: |
| + |
| +1) Write your API specification. |
|
Aaron Boodman
2012/05/15 00:07:43
We shouldn't recommend that people use IDL, becaus
beaudoin
2012/05/16 16:56:16
Done.
|
| +Create "chrome/common/extensions/api/experimental_foo.idl". This file should |
| +contain your complete API description. Look at alarms.idl for inspiration. |
| + |
| +2) Add your API to the project |
| +Add "experimental_foo.idl" to the "idl_schema_files" in |
| +"chrome/common/extensions/api/api.gyp". |
| + |
| +3) Write the API function handlers. |
| +Create foo_api.cc and foo_api.h under "chrome/browser/extensions/api/foo". |
|
Aaron Boodman
2012/05/15 00:07:43
Can you add a statement recommending use of JSON S
beaudoin
2012/05/16 16:56:16
Done.
|
| + |
| +4) Write support classes for your API. |
| +If your API needs any support classes add them to |
| +"chrome/browser/extensions/api/foo". Some old APIs added their support classes |
| +directly to chrome/browser/extensions. Don't do that. |
|
Aaron Boodman
2012/05/15 00:07:43
Insert a step about testing here?
|
| + |
| +5) Update the project with your new files. |
| +The files you created in (3) and (4) should be added to |
| +"chrome/chrome_browser_extensions.gypi". |