• Home
Name
Date
Size
#Lines
LOC

..--

activity_log_private/03-May-2024-466341

alarms/03-May-2024-1,6261,187

app_current_window_internal/03-May-2024-531422

app_runtime/03-May-2024-183123

app_window/03-May-2024-534407

audio/03-May-2024-606431

autotest_private/03-May-2024-461344

bluetooth/03-May-2024-2,4661,818

bookmark_manager_private/03-May-2024-930687

bookmarks/03-May-2024-1,6801,256

braille_display_private/03-May-2024-1,5471,160

browsing_data/03-May-2024-1,234926

cast_channel/03-May-2024-2,9212,114

cloud_print_private/03-May-2024-365257

command_line_private/03-May-2024-8951

commands/03-May-2024-951667

content_settings/03-May-2024-1,6991,290

context_menus/03-May-2024-504390

cookies/03-May-2024-1,4821,065

debugger/03-May-2024-929673

declarative/03-May-2024-4,0462,811

declarative_content/03-May-2024-1,6891,211

declarative_webrequest/03-May-2024-6,3884,788

desktop_capture/03-May-2024-622466

developer_private/03-May-2024-2,1111,618

diagnostics/03-May-2024-206141

dial/03-May-2024-2,7791,941

discovery/03-May-2024-633428

dns/03-May-2024-465296

downloads/03-May-2024-5,9604,995

downloads_internal/03-May-2024-7147

enterprise_platform_keys_private/03-May-2024-1,3111,021

extension_action/03-May-2024-3,2102,283

feedback_private/03-May-2024-851595

file_handlers/03-May-2024-496377

file_system/03-May-2024-2,0181,639

font_settings/03-May-2024-822568

gcm/03-May-2024-551406

history/03-May-2024-780577

i18n/03-May-2024-15699

identity/03-May-2024-4,6423,582

identity_private/03-May-2024-7243

idle/03-May-2024-1,257889

idltest/03-May-2024-10772

image_writer_private/03-May-2024-2,6311,912

input/03-May-2024-276200

input_ime/03-May-2024-1,025803

location/03-May-2024-664451

log_private/03-May-2024-578401

management/03-May-2024-2,2511,680

mdns/03-May-2024-1,121785

media_galleries/03-May-2024-818623

media_galleries_private/03-May-2024-2,4291,704

messaging/03-May-2024-3,4792,513

metrics_private/03-May-2024-546397

module/03-May-2024-158100

music_manager_private/03-May-2024-1,069756

networking_private/03-May-2024-3,7642,804

notifications/03-May-2024-1,6011,223

omnibox/03-May-2024-1,227896

page_capture/03-May-2024-328231

permissions/03-May-2024-844588

power/03-May-2024-544355

preference/03-May-2024-2,4131,792

principals_private/03-May-2024-11470

processes/03-May-2024-1,147797

proxy/03-May-2024-1,7381,298

push_messaging/03-May-2024-1,9391,352

recovery_private/03-May-2024-32

runtime/03-May-2024-944714

serial/03-May-2024-3,0742,167

sessions/03-May-2024-1,091864

settings_overrides/03-May-2024-419351

signed_in_devices/03-May-2024-992695

socket/03-May-2024-3,4642,620

sockets_tcp/03-May-2024-1,174836

sockets_tcp_server/03-May-2024-985711

sockets_udp/03-May-2024-1,268920

spellcheck/03-May-2024-154110

storage/03-May-2024-7,2405,211

streams_private/03-May-2024-554361

sync_file_system/03-May-2024-1,232936

system_cpu/03-May-2024-204121

system_display/03-May-2024-1,9821,424

system_indicator/03-May-2024-494341

system_info/03-May-2024-472290

system_memory/03-May-2024-203119

system_network/03-May-2024-181129

system_private/03-May-2024-310220

system_storage/03-May-2024-739521

tab_capture/03-May-2024-1,275955

tabs/03-May-2024-4,6653,542

terminal/03-May-2024-427290

test/03-May-2024-302195

top_sites/03-May-2024-159104

usb/03-May-2024-1,8011,429

web_navigation/03-May-2024-2,9832,283

web_request/03-May-2024-9,3426,983

webrtc_audio_private/03-May-2024-934681

webrtc_logging_private/03-May-2024-776518

webstore_private/03-May-2024-1,362990

webview/03-May-2024-576396

DEPSD03-May-202457 54

README.txtD03-May-20243.1 KiB7556

api_function.ccD03-May-20241.9 KiB8058

api_function.hD03-May-20242.2 KiB7032

api_resource.ccD03-May-2024561 2312

api_resource.hD03-May-20241.4 KiB4624

api_resource_manager.hD03-May-202411.1 KiB335236

api_resource_manager_unittest.ccD03-May-20242.5 KiB6848

capture_web_contents_function.ccD03-May-20244.7 KiB159128

capture_web_contents_function.hD03-May-20242.1 KiB6837

execute_code_function.ccD03-May-20246.8 KiB217171

execute_code_function.hD03-May-20242.6 KiB7638

profile_keyed_api_factory.hD03-May-20244.8 KiB12659

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