Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Side by Side Diff: chrome/common/extensions/docs/templates/intros/events.html

Issue 135083002: Clarify chrome.events as a namespace of common types. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/extensions/api/events.json ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <p> 1 <p>
2 An <code>Event</code> is an object 2 An <code>Event</code> is an object
3 that allows you to be notified 3 that allows you to be notified
4 when something interesting happens. 4 when something interesting happens.
5 Here's an example of using the 5 Here's an example of using the
6 <code>chrome.alarms.onAlarm</code> event 6 <code>chrome.alarms.onAlarm</code> event
7 to be notified whenever an alarm has elapsed: 7 to be notified whenever an alarm has elapsed:
8 </p> 8 </p>
9 9
10 <pre> 10 <pre>
(...skipping 11 matching lines...) Expand all
22 is always a function that you define to handle the event, 22 is always a function that you define to handle the event,
23 but the parameters to the function depend on 23 but the parameters to the function depend on
24 which event you're handling. 24 which event you're handling.
25 Checking the documentation for 25 Checking the documentation for
26 $ref:alarms.onAlarm, 26 $ref:alarms.onAlarm,
27 you can see that the function has a single parameter: 27 you can see that the function has a single parameter:
28 an $ref:alarms.Alarm object 28 an $ref:alarms.Alarm object
29 that has details about the elapsed alarm. 29 that has details about the elapsed alarm.
30 </p> 30 </p>
31 31
32 Example APIs using Events:
33 $ref:alarms,
34 {{?is_apps}}
35 $ref:app.runtime,
36 $ref:app.window,
37 {{/is_apps}}
38 $ref:i18n,
39 $ref:identity,
40 $ref:runtime.
41 Most <a href="api_index.html">chrome APIs</a> do.
32 42
33 {{^is_apps}} 43 {{^is_apps}}
34 <div class="doc-family extensions"> 44 <div class="doc-family extensions">
35 <h2 id="declarative">Declarative Event Handlers</h2> 45 <h2 id="declarative">Declarative Event Handlers</h2>
36 46
37 <p> 47 <p>
38 The declarative event handlers provide a means to define rules consisting of 48 The declarative event handlers provide a means to define rules consisting of
39 declarative conditions and actions. Conditions are evaluated in the browser 49 declarative conditions and actions. Conditions are evaluated in the browser
40 rather than the JavaScript engine which reduces roundtrip latencies and allows 50 rather than the JavaScript engine which reduces roundtrip latencies and allows
41 for very high efficiency. 51 for very high efficiency.
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 of filters that an event supports will be listed in the documentation for that 264 of filters that an event supports will be listed in the documentation for that
255 event in the "filters" section.</p> 265 event in the "filters" section.</p>
256 266
257 <p>When matching URLs (as in the example above), event filters support the same 267 <p>When matching URLs (as in the example above), event filters support the same
258 URL matching capabilities as expressible with a 268 URL matching capabilities as expressible with a
259 $ref:events.UrlFilter, except for scheme and port 269 $ref:events.UrlFilter, except for scheme and port
260 matching.</p> 270 matching.</p>
261 271
262 </div> 272 </div>
263 {{/is_apps}} 273 {{/is_apps}}
OLDNEW
« no previous file with comments | « chrome/common/extensions/api/events.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698