• Home
Name
Date
Size
#Lines
LOC

..--

activity_log_private/03-May-2024-508373

alarms/03-May-2024-1,6891,213

audio/03-May-2024-666461

automation/03-May-2024-504350

automation_internal/03-May-2024-590448

autotest_private/03-May-2024-391300

bookmark_manager_private/03-May-2024-1,289984

bookmarks/03-May-2024-1,7731,355

braille_display_private/03-May-2024-1,8401,357

browser/03-May-2024-10867

browsing_data/03-May-2024-1,265953

cast_streaming/03-May-2024-1,090846

cloud_print_private/03-May-2024-372266

command_line_private/03-May-2024-8951

commands/03-May-2024-1,342958

content_settings/03-May-2024-1,8331,382

context_menus/03-May-2024-617462

cookies/03-May-2024-1,4541,054

copresence/03-May-2024-845626

copresence_private/03-May-2024-171122

debugger/03-May-2024-1,090796

declarative/03-May-2024-825601

declarative_content/03-May-2024-2,7652,089

declarative_webrequest/03-May-2024-1,4191,136

desktop_capture/03-May-2024-677504

developer_private/03-May-2024-2,1201,621

diagnostics/03-May-2024-206141

dial/03-May-2024-2,7931,959

downloads/03-May-2024-6,5215,482

downloads_internal/03-May-2024-7147

easy_unlock_private/03-May-2024-1,5921,205

enterprise_platform_keys/03-May-2024-817634

enterprise_platform_keys_private/03-May-2024-1,3131,023

experience_sampling_private/03-May-2024-286190

extension_action/03-May-2024-2,6371,818

feedback_private/03-May-2024-816571

file_handlers/03-May-2024-923684

file_system/03-May-2024-3,0162,398

font_settings/03-May-2024-827572

gcd_private/03-May-2024-1,5951,191

gcm/03-May-2024-634470

guest_view/03-May-2024-32

history/03-May-2024-770569

hotword_private/03-May-2024-611461

i18n/03-May-2024-157100

identity/03-May-2024-4,6553,601

identity_private/03-May-2024-6435

idle/03-May-2024-1,250874

idltest/03-May-2024-10772

image_writer_private/03-May-2024-4,4683,241

input/03-May-2024-358271

input_ime/03-May-2024-1,142883

location/03-May-2024-594404

log_private/03-May-2024-1,280949

management/03-May-2024-2,8202,150

mdns/03-May-2024-1,161818

media_galleries/03-May-2024-2,6912,071

media_galleries_private/03-May-2024-1,9601,366

messaging/03-May-2024-3,9502,871

metrics_private/03-May-2024-579423

module/03-May-2024-15598

music_manager_private/03-May-2024-1,071758

networking_private/03-May-2024-4,4553,369

notification_provider/03-May-2024-512365

notifications/03-May-2024-1,047783

omnibox/03-May-2024-1,238901

page_capture/03-May-2024-328231

permissions/03-May-2024-852595

preference/03-May-2024-2,4531,835

preferences_private/03-May-2024-312231

principals_private/03-May-2024-11874

processes/03-May-2024-1,137794

proxy/03-May-2024-1,7791,326

push_messaging/03-May-2024-2,0141,419

reading_list_private/03-May-2024-220172

recovery_private/03-May-2024-32

runtime/03-May-2024-368293

screenlock_private/03-May-2024-363267

sessions/03-May-2024-1,2721,004

settings_overrides/03-May-2024-509428

signed_in_devices/03-May-2024-1,025727

socket/03-May-2024-895646

sockets_tcp/03-May-2024-11583

sockets_tcp_server/03-May-2024-185139

sockets_udp/03-May-2024-166120

spellcheck/03-May-2024-147104

storage/03-May-2024-4,7503,493

streams_private/03-May-2024-777506

sync_file_system/03-May-2024-1,3801,049

synced_notifications_private/03-May-2024-870688

system_cpu/03-May-2024-5740

system_display/03-May-2024-309256

system_indicator/03-May-2024-490338

system_memory/03-May-2024-4833

system_network/03-May-2024-7050

system_private/03-May-2024-306216

system_storage/03-May-2024-320234

tab_capture/03-May-2024-1,253917

tabs/03-May-2024-5,0823,870

terminal/03-May-2024-428292

test/03-May-2024-104

top_sites/03-May-2024-159104

web_navigation/03-May-2024-2,6021,951

web_request/03-May-2024-3,0252,388

web_view/03-May-2024-257179

webcam_private/03-May-2024-280203

webrtc_audio_private/03-May-2024-1,141803

webrtc_logging_private/03-May-2024-1,001691

webstore/03-May-2024-247171

webstore_private/03-May-2024-1,5421,139

DEPSD03-May-202474 65

README.txtD03-May-20243.1 KiB7556

api_registration.gypD03-May-20241.4 KiB4240

chrome_extensions_api_client.ccD03-May-20244 KiB10077

chrome_extensions_api_client.hD03-May-20242.2 KiB5440

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