Home | History | Annotate | only in /external/chromium_org/chrome/browser/extensions/api
Up to higher level directory
NameDateSize
activity_log_private/05-Aug-2015
alarms/05-Aug-2015
api_registration.gyp05-Aug-20151.4K
audio/05-Aug-2015
automation/05-Aug-2015
automation_internal/05-Aug-2015
autotest_private/05-Aug-2015
bookmark_manager_private/05-Aug-2015
bookmarks/05-Aug-2015
braille_display_private/05-Aug-2015
browser/05-Aug-2015
browsing_data/05-Aug-2015
cast_streaming/05-Aug-2015
chrome_extensions_api_client.cc05-Aug-20154K
chrome_extensions_api_client.h05-Aug-20152.2K
cloud_print_private/05-Aug-2015
command_line_private/05-Aug-2015
commands/05-Aug-2015
content_settings/05-Aug-2015
context_menus/05-Aug-2015
cookies/05-Aug-2015
copresence/05-Aug-2015
copresence_private/05-Aug-2015
debugger/05-Aug-2015
declarative/05-Aug-2015
declarative_content/05-Aug-2015
declarative_webrequest/05-Aug-2015
DEPS05-Aug-201574
desktop_capture/05-Aug-2015
developer_private/05-Aug-2015
diagnostics/05-Aug-2015
dial/05-Aug-2015
downloads/05-Aug-2015
downloads_internal/05-Aug-2015
easy_unlock_private/05-Aug-2015
enterprise_platform_keys/05-Aug-2015
enterprise_platform_keys_private/05-Aug-2015
experience_sampling_private/05-Aug-2015
extension_action/05-Aug-2015
feedback_private/05-Aug-2015
file_handlers/05-Aug-2015
file_system/05-Aug-2015
font_settings/05-Aug-2015
gcd_private/05-Aug-2015
gcm/05-Aug-2015
guest_view/05-Aug-2015
history/05-Aug-2015
hotword_private/05-Aug-2015
i18n/05-Aug-2015
identity/05-Aug-2015
identity_private/05-Aug-2015
idle/05-Aug-2015
idltest/05-Aug-2015
image_writer_private/05-Aug-2015
input/05-Aug-2015
input_ime/05-Aug-2015
location/05-Aug-2015
log_private/05-Aug-2015
management/05-Aug-2015
mdns/05-Aug-2015
media_galleries/05-Aug-2015
media_galleries_private/05-Aug-2015
messaging/05-Aug-2015
metrics_private/05-Aug-2015
module/05-Aug-2015
music_manager_private/05-Aug-2015
networking_private/05-Aug-2015
notification_provider/05-Aug-2015
notifications/05-Aug-2015
omnibox/05-Aug-2015
page_capture/05-Aug-2015
permissions/05-Aug-2015
preference/05-Aug-2015
preferences_private/05-Aug-2015
principals_private/05-Aug-2015
processes/05-Aug-2015
proxy/05-Aug-2015
push_messaging/05-Aug-2015
reading_list_private/05-Aug-2015
README.txt05-Aug-20153.1K
recovery_private/05-Aug-2015
runtime/05-Aug-2015
screenlock_private/05-Aug-2015
sessions/05-Aug-2015
settings_overrides/05-Aug-2015
signed_in_devices/05-Aug-2015
socket/05-Aug-2015
sockets_tcp/05-Aug-2015
sockets_tcp_server/05-Aug-2015
sockets_udp/05-Aug-2015
spellcheck/05-Aug-2015
storage/05-Aug-2015
streams_private/05-Aug-2015
sync_file_system/05-Aug-2015
synced_notifications_private/05-Aug-2015
system_cpu/05-Aug-2015
system_display/05-Aug-2015
system_indicator/05-Aug-2015
system_memory/05-Aug-2015
system_network/05-Aug-2015
system_private/05-Aug-2015
system_storage/05-Aug-2015
tab_capture/05-Aug-2015
tabs/05-Aug-2015
terminal/05-Aug-2015
test/05-Aug-2015
top_sites/05-Aug-2015
web_navigation/05-Aug-2015
web_request/05-Aug-2015
web_view/05-Aug-2015
webcam_private/05-Aug-2015
webrtc_audio_private/05-Aug-2015
webrtc_logging_private/05-Aug-2015
webstore/05-Aug-2015
webstore_private/05-Aug-2015

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