Home | History | Annotate | only in /external/chromium_org/chrome/browser/extensions/api
Up to higher level directory
NameDateSize
activity_log_private/04-Nov-2014
alarms/04-Nov-2014
app_current_window_internal/04-Nov-2014
app_window/04-Nov-2014
audio/04-Nov-2014
automation/04-Nov-2014
automation_internal/04-Nov-2014
autotest_private/04-Nov-2014
bluetooth/04-Nov-2014
bluetooth_low_energy/04-Nov-2014
bluetooth_socket/04-Nov-2014
bookmark_manager_private/04-Nov-2014
bookmarks/04-Nov-2014
braille_display_private/04-Nov-2014
browser/04-Nov-2014
browsing_data/04-Nov-2014
capture_web_contents_function.cc04-Nov-20144.1K
capture_web_contents_function.h04-Nov-20142K
cast_channel/04-Nov-2014
cast_streaming/04-Nov-2014
chrome_extensions_api_client.cc04-Nov-20141.3K
chrome_extensions_api_client.h04-Nov-20141.1K
cloud_print_private/04-Nov-2014
command_line_private/04-Nov-2014
commands/04-Nov-2014
content_settings/04-Nov-2014
context_menus/04-Nov-2014
cookies/04-Nov-2014
debugger/04-Nov-2014
declarative/04-Nov-2014
declarative_content/04-Nov-2014
declarative_webrequest/04-Nov-2014
DEPS04-Nov-201457
desktop_capture/04-Nov-2014
developer_private/04-Nov-2014
diagnostics/04-Nov-2014
dial/04-Nov-2014
dns/04-Nov-2014
downloads/04-Nov-2014
downloads_internal/04-Nov-2014
enterprise_platform_keys/04-Nov-2014
enterprise_platform_keys_private/04-Nov-2014
execute_code_function.cc04-Nov-20147.2K
execute_code_function.h04-Nov-20142.7K
extension_action/04-Nov-2014
feedback_private/04-Nov-2014
file_handlers/04-Nov-2014
file_system/04-Nov-2014
font_settings/04-Nov-2014
gcd_private/04-Nov-2014
gcm/04-Nov-2014
guest_view/04-Nov-2014
hid/04-Nov-2014
history/04-Nov-2014
hotword_private/04-Nov-2014
i18n/04-Nov-2014
identity/04-Nov-2014
identity_private/04-Nov-2014
idle/04-Nov-2014
idltest/04-Nov-2014
image_writer_private/04-Nov-2014
input/04-Nov-2014
input_ime/04-Nov-2014
location/04-Nov-2014
log_private/04-Nov-2014
management/04-Nov-2014
mdns/04-Nov-2014
media_galleries/04-Nov-2014
media_galleries_private/04-Nov-2014
messaging/04-Nov-2014
metrics_private/04-Nov-2014
module/04-Nov-2014
music_manager_private/04-Nov-2014
networking_private/04-Nov-2014
notifications/04-Nov-2014
omnibox/04-Nov-2014
page_capture/04-Nov-2014
permissions/04-Nov-2014
power/04-Nov-2014
preference/04-Nov-2014
preferences_private/04-Nov-2014
principals_private/04-Nov-2014
processes/04-Nov-2014
proxy/04-Nov-2014
push_messaging/04-Nov-2014
reading_list_private/04-Nov-2014
README.txt04-Nov-20143.1K
recovery_private/04-Nov-2014
runtime/04-Nov-2014
screenlock_private/04-Nov-2014
serial/04-Nov-2014
sessions/04-Nov-2014
settings_overrides/04-Nov-2014
signed_in_devices/04-Nov-2014
socket/04-Nov-2014
sockets_tcp/04-Nov-2014
sockets_tcp_server/04-Nov-2014
sockets_udp/04-Nov-2014
spellcheck/04-Nov-2014
storage/04-Nov-2014
streams_private/04-Nov-2014
sync_file_system/04-Nov-2014
synced_notifications_private/04-Nov-2014
system_cpu/04-Nov-2014
system_display/04-Nov-2014
system_indicator/04-Nov-2014
system_info/04-Nov-2014
system_memory/04-Nov-2014
system_network/04-Nov-2014
system_private/04-Nov-2014
system_storage/04-Nov-2014
tab_capture/04-Nov-2014
tabs/04-Nov-2014
terminal/04-Nov-2014
test/04-Nov-2014
top_sites/04-Nov-2014
web_navigation/04-Nov-2014
web_request/04-Nov-2014
webcam_private/04-Nov-2014
webrtc_audio_private/04-Nov-2014
webrtc_logging_private/04-Nov-2014
webstore/04-Nov-2014
webstore_private/04-Nov-2014
webview/04-Nov-2014

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