Home | History | Annotate | only in /external/chromium_org/chrome/browser/extensions/api
Up to higher level directory
NameDateSize
activity_log_private/06-Dec-2013
alarms/06-Dec-2013
api_function.cc06-Dec-20131.9K
api_function.h06-Dec-20132.2K
api_resource.cc06-Dec-2013466
api_resource.h06-Dec-20131.2K
api_resource_manager.h06-Dec-20138K
api_resource_manager_unittest.cc06-Dec-20132.5K
app_current_window_internal/06-Dec-2013
app_runtime/06-Dec-2013
app_window/06-Dec-2013
audio/06-Dec-2013
autotest_private/06-Dec-2013
bluetooth/06-Dec-2013
bookmark_manager_private/06-Dec-2013
bookmarks/06-Dec-2013
browsing_data/06-Dec-2013
cloud_print_private/06-Dec-2013
command_line_private/06-Dec-2013
commands/06-Dec-2013
content_settings/06-Dec-2013
context_menus/06-Dec-2013
cookies/06-Dec-2013
debugger/06-Dec-2013
declarative/06-Dec-2013
declarative_content/06-Dec-2013
declarative_webrequest/06-Dec-2013
DEPS06-Dec-201331
developer_private/06-Dec-2013
diagnostics/06-Dec-2013
dial/06-Dec-2013
discovery/06-Dec-2013
dns/06-Dec-2013
downloads/06-Dec-2013
downloads_internal/06-Dec-2013
enterprise_platform_keys_private/06-Dec-2013
execute_code_function.cc06-Dec-20135.5K
execute_code_function.h06-Dec-20132.4K
extension_action/06-Dec-2013
feedback_private/06-Dec-2013
file_handlers/06-Dec-2013
file_system/06-Dec-2013
font_settings/06-Dec-2013
history/06-Dec-2013
i18n/06-Dec-2013
identity/06-Dec-2013
identity_private/06-Dec-2013
idle/06-Dec-2013
idltest/06-Dec-2013
input/06-Dec-2013
input_ime/06-Dec-2013
location/06-Dec-2013
log_private/06-Dec-2013
management/06-Dec-2013
media_galleries/06-Dec-2013
media_galleries_private/06-Dec-2013
messaging/06-Dec-2013
metrics_private/06-Dec-2013
module/06-Dec-2013
music_manager_private/06-Dec-2013
networking_private/06-Dec-2013
notifications/06-Dec-2013
omnibox/06-Dec-2013
page_capture/06-Dec-2013
permissions/06-Dec-2013
power/06-Dec-2013
preference/06-Dec-2013
processes/06-Dec-2013
profile_keyed_api_factory.h06-Dec-20134.8K
proxy/06-Dec-2013
push_messaging/06-Dec-2013
README.txt06-Dec-20133.1K
recovery_private/06-Dec-2013
rtc_private/06-Dec-2013
runtime/06-Dec-2013
serial/06-Dec-2013
session_restore/06-Dec-2013
signedin_devices/06-Dec-2013
socket/06-Dec-2013
spellcheck/06-Dec-2013
storage/06-Dec-2013
streams_private/06-Dec-2013
sync_file_system/06-Dec-2013
system_cpu/06-Dec-2013
system_display/06-Dec-2013
system_indicator/06-Dec-2013
system_info/06-Dec-2013
system_memory/06-Dec-2013
system_private/06-Dec-2013
system_storage/06-Dec-2013
tab_capture/06-Dec-2013
tabs/06-Dec-2013
terminal/06-Dec-2013
test/06-Dec-2013
top_sites/06-Dec-2013
usb/06-Dec-2013
web_navigation/06-Dec-2013
web_request/06-Dec-2013
webstore_private/06-Dec-2013
webview/06-Dec-2013

README.txt

      1 This file describes steps and files needed when adding a new API to Chrome.
      2 Before you start coding your new API, though, make sure you follow the process
      3 described at:
      4   http://www.chromium.org/developers/design-documents/extensions/proposed-changes/apis-under-development
      5 
      6 Two approaches are available for writing your API specification. The original
      7 approach relies on JSON specification files. The more recent and simpler system 
      8 uses Web IDL files, but does not yet support all the features of the JSON files.
      9 Discuss with a member of the extensions team (aa (a] chromium.org) before you decide
     10 which approach is better suited to your API.
     11 
     12 The following steps suppose you're writing an experimental API called "Foo".
     13 
     14 --------------------------------------------------------------------------------
     15 APPROACH 1: JSON FILES
     16 
     17 1) Write your API specification.
     18 Create "chrome/common/extensions/api/experimental_foo.json". For inspiration 
     19 look at the "app" API. Include descriptions fields to generate the
     20 documentation.
     21 
     22 2) Add your API specification to api.gyp.
     23 Add "experimental_foo.json" to the "schema_files" section in
     24 "chrome/common/extensions/api/api.gyp".
     25 
     26 3) Write the API function handlers.
     27 Create foo_api.cc and foo_api.h under "chrome/browser/extensions/api/foo". You
     28 should use the JSON Schema Compiler. Look at the "permissions_api.cc" for
     29 details on how to do that.
     30 
     31 --------------------------------------------------------------------------------
     32 APPROACH 2: IDL FILES
     33 
     34 1) Write your API specification.
     35 Create "chrome/common/extensions/api/experimental_foo.idl". For inspiration look
     36 at "alarms.idl". Include comments, they will be used to automatically generate
     37 the documentation.
     38 
     39 2) Add your API specification to api.gyp.
     40 Add "experimental_foo.idl" to the "schema_files" section in
     41 "chrome/common/extensions/api/api.gyp".
     42 
     43 3) Write the API function handlers.
     44 Create foo_api.cc and foo_api.h under "chrome/browser/extensions/api/foo". You
     45 should use the JSON Schema Compiler. Look at the "alarms_api.cc" for details on
     46 how to do that.
     47 
     48 --------------------------------------------------------------------------------
     49 STEPS COMMON TO BOTH APPROACHES
     50 
     51 6) Write support classes for your API
     52 If your API needs any support classes add them to
     53 "chrome/browser/extensions/api/foo". Some old APIs added their support classes
     54 directly to chrome/browser/extensions. Don't do that.
     55 
     56 7) Update the project with your new files.
     57 The files you created in (3) and (5) should be added to
     58 "chrome/chrome_browser_extensions.gypi".
     59 
     60 --------------------------------------------------------------------------------
     61 GENERATING DOCUMENTATION
     62 
     63 8) Add a stub template in ../docs/templates/public corresponding to your API.
     64 See other templates for inspiration.
     65 
     66 9) Run ../docs/templates/server2/preview.py to view the generated documentation.
     67 
     68 --------------------------------------------------------------------------------
     69 WRITING TESTS
     70 
     71 12) Write a unit test for your API.
     72 Create "chrome/browser/extensions/api/foo/foo_api_unittest.cc" and test each of
     73 your API methods. See "alarms_api_unittest.cc" for details. Once done add your
     74 .cc to "chrome/chrome_tests.gypi".
     75