• Home
  • History
  • Annotate
  • only in /external/chromium_org/chrome/browser/extensions/api/
NameDateSize

..05-Nov-201424 KiB

activity_log_private/05-Nov-20144 KiB

alarms/05-Nov-20144 KiB

app_current_window_internal/05-Nov-20144 KiB

app_window/05-Nov-20144 KiB

audio/05-Nov-20144 KiB

automation/05-Nov-20144 KiB

automation_internal/05-Nov-20144 KiB

autotest_private/05-Nov-20144 KiB

bluetooth/05-Nov-20144 KiB

bluetooth_low_energy/05-Nov-20144 KiB

bluetooth_socket/05-Nov-20144 KiB

bookmark_manager_private/05-Nov-20144 KiB

bookmarks/05-Nov-20144 KiB

braille_display_private/05-Nov-20144 KiB

browser/05-Nov-20144 KiB

browsing_data/05-Nov-20144 KiB

capture_web_contents_function.cc05-Nov-20144.1 KiB

capture_web_contents_function.h05-Nov-20142 KiB

cast_channel/05-Nov-20144 KiB

cast_streaming/05-Nov-20144 KiB

chrome_extensions_api_client.cc05-Nov-20141.3 KiB

chrome_extensions_api_client.h05-Nov-20141.1 KiB

cloud_print_private/05-Nov-20144 KiB

command_line_private/05-Nov-20144 KiB

commands/05-Nov-20144 KiB

content_settings/05-Nov-20144 KiB

context_menus/05-Nov-20144 KiB

cookies/05-Nov-20144 KiB

debugger/05-Nov-20144 KiB

declarative/05-Nov-20144 KiB

declarative_content/05-Nov-20144 KiB

declarative_webrequest/05-Nov-20144 KiB

DEPS05-Nov-201457

desktop_capture/05-Nov-20144 KiB

developer_private/05-Nov-20144 KiB

diagnostics/05-Nov-20144 KiB

dial/05-Nov-20144 KiB

dns/05-Nov-20144 KiB

downloads/05-Nov-20144 KiB

downloads_internal/05-Nov-20144 KiB

enterprise_platform_keys/05-Nov-20144 KiB

enterprise_platform_keys_private/05-Nov-20144 KiB

execute_code_function.cc05-Nov-20147.2 KiB

execute_code_function.h05-Nov-20142.7 KiB

extension_action/05-Nov-20144 KiB

feedback_private/05-Nov-20144 KiB

file_handlers/05-Nov-20144 KiB

file_system/05-Nov-20144 KiB

font_settings/05-Nov-20144 KiB

gcd_private/05-Nov-20144 KiB

gcm/05-Nov-20144 KiB

guest_view/05-Nov-20144 KiB

hid/05-Nov-20144 KiB

history/05-Nov-20144 KiB

hotword_private/05-Nov-20144 KiB

i18n/05-Nov-20144 KiB

identity/05-Nov-20144 KiB

identity_private/05-Nov-20144 KiB

idle/05-Nov-20144 KiB

idltest/05-Nov-20144 KiB

image_writer_private/05-Nov-20144 KiB

input/05-Nov-20144 KiB

input_ime/05-Nov-20144 KiB

location/05-Nov-20144 KiB

log_private/05-Nov-20144 KiB

management/05-Nov-20144 KiB

mdns/05-Nov-20144 KiB

media_galleries/05-Nov-20144 KiB

media_galleries_private/05-Nov-20144 KiB

messaging/05-Nov-20144 KiB

metrics_private/05-Nov-20144 KiB

module/05-Nov-20144 KiB

music_manager_private/05-Nov-20144 KiB

networking_private/05-Nov-20144 KiB

notifications/05-Nov-20144 KiB

omnibox/05-Nov-20144 KiB

page_capture/05-Nov-20144 KiB

permissions/05-Nov-20144 KiB

power/05-Nov-20144 KiB

preference/05-Nov-20144 KiB

preferences_private/05-Nov-20144 KiB

principals_private/05-Nov-20144 KiB

processes/05-Nov-20144 KiB

proxy/05-Nov-20144 KiB

push_messaging/05-Nov-20144 KiB

reading_list_private/05-Nov-20144 KiB

README.txt05-Nov-20143.1 KiB

recovery_private/05-Nov-20144 KiB

runtime/05-Nov-20144 KiB

screenlock_private/05-Nov-20144 KiB

serial/05-Nov-20144 KiB

sessions/05-Nov-20144 KiB

settings_overrides/05-Nov-20144 KiB

signed_in_devices/05-Nov-20144 KiB

socket/05-Nov-20144 KiB

sockets_tcp/05-Nov-20144 KiB

sockets_tcp_server/05-Nov-20144 KiB

sockets_udp/05-Nov-20144 KiB

spellcheck/05-Nov-20144 KiB

storage/05-Nov-20144 KiB

streams_private/05-Nov-20144 KiB

sync_file_system/05-Nov-20144 KiB

synced_notifications_private/05-Nov-20144 KiB

system_cpu/05-Nov-20144 KiB

system_display/05-Nov-20144 KiB

system_indicator/05-Nov-20144 KiB

system_info/05-Nov-20144 KiB

system_memory/05-Nov-20144 KiB

system_network/05-Nov-20144 KiB

system_private/05-Nov-20144 KiB

system_storage/05-Nov-20144 KiB

tab_capture/05-Nov-20144 KiB

tabs/05-Nov-20144 KiB

terminal/05-Nov-20144 KiB

test/05-Nov-20144 KiB

top_sites/05-Nov-20144 KiB

web_navigation/05-Nov-20144 KiB

web_request/05-Nov-20144 KiB

webcam_private/05-Nov-20144 KiB

webrtc_audio_private/05-Nov-20144 KiB

webrtc_logging_private/05-Nov-20144 KiB

webstore/05-Nov-20144 KiB

webstore_private/05-Nov-20144 KiB

webview/05-Nov-20144 KiB

README.txt

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