Added documentation about the find API for https://developer.chrome.com/apps/tags/webview.

Review URL: https://codereview.chromium.org/188743005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255977 0039d316-1c4b-4281-b951-d872f2087c98
parent de732e80
......@@ -106,6 +106,46 @@
}
]
},
{
"id": "FindCallbackResults",
"type": "object",
"description": "Contains all of the results of the find request.",
"properties": {
"numberOfMatches": {
"type": "integer",
"description": "The number of times <code>searchText</code> was matched on the page."
},
"activeMatchOrdinal": {
"type": "integer",
"description": "The ordinal number of the current match."
},
"selectionRect": {
"$ref": "SelectionRect",
"description": "Describes a rectangle around the active match in screen coordinates."
},
"canceled": {
"type": "boolean",
"description": "Indicates whether this find request was canceled."
}
}
},
{
"id": "FindOptions",
"type": "object",
"description": "Options for the find request.",
"properties": {
"backward": {
"type": "boolean",
"description": "Flag to find matches in reverse order. The default value is <code>false</code>.",
"optional": true
},
"matchCase": {
"type": "boolean",
"description": "Flag to match with case-sensitivity. The default value is <code>false</code>.",
"optional": true
}
}
},
{
"id": "NewWindow",
"type": "object",
......@@ -220,6 +260,29 @@
{ "name": "deny", "description": "Deny the permission request." }
]
},
{
"id": "SelectionRect",
"type": "object",
"description": "<p>Describes a rectangle in screen coordinates.</p><p>The containment semantics are array-like; that is, the coordinate <code>(left, top)</code> is considered to be contained by the rectangle, but the coordinate <code>(left + width, top)</code> is not.</p>",
"properties": {
"left": {
"type": "integer",
"description": "Distance from the left edge of the screen to the left edge of the rectangle."
},
"top": {
"type": "integer",
"description": "Distance from the top edge of the screen to the top edge of the rectangle."
},
"width": {
"type": "integer",
"description": "Width of the rectangle."
},
"height": {
"type": "integer",
"description": "Height of the rectangle."
}
}
},
{
"id": "WebRequestEventInteface",
"type": "object",
......@@ -296,6 +359,38 @@
}
]
},
{
"name": "find",
"type": "function",
"description": "Initiates a find-in-page request.",
"parameters": [
{
"type": "string",
"name": "searchText",
"description": "The string to find in the page."
},
{
"$ref": "FindOptions",
"name": "options",
"optional": true,
"description": "Options for the find request."
},
{
"type": "function",
"name": "callback",
"description": "Called after all find results have been returned for this find request.",
"optional": true,
"parameters": [
{
"$ref": "FindCallbackResults",
"name": "results",
"description": "Contains all of the results of the find request. <code>results</code> can be omitted if it is not utilized in the callback function body; for example, if the callback is only used to discern when the find request has completed.",
"optional": true
}
]
}
]
},
{
"name": "forward",
"type": "function",
......@@ -376,6 +471,20 @@
"description": "Stops loading the current &lt;webview> navigation if in progress.",
"parameters": []
},
{
"name": "stopFinding",
"type": "function",
"description": "Ends the current find session (clearing all highlighting) and cancels all find requests in progress.",
"parameters": [
{
"type": "string",
"name": "action",
"description": "Determines what to do with the active match after the find session has ended. <code>clear</code> will clear the highlighting over the active match; <code>keep</code> will keep the active match highlighted; <code>activate</code> will keep the active match highlighted and simulate a user click on that match. The default action is <code>keep</code>.",
"optional": true,
"enum": ["clear", "keep", "activate"]
}
]
},
{
"name": "terminate",
"type": "function",
......@@ -464,6 +573,43 @@
}
]
},
{
"name": "findupdate",
"options": { "supportsDom": true },
"description": "Fired when new find results are available for an active find request. This might happen multiple times for a single find request as matches are found.",
"parameters": [
{
"name": "searchText",
"type": "string",
"description": "The string that is being searched for in the page."
},
{
"name": "numberOfMatches",
"type": "integer",
"description": "The number of matches found for <code>searchText</code> on the page so far."
},
{
"name": "activeMatchOrdinal",
"type": "integer",
"description": "The ordinal number of the current active match, if it has been found. This will be <code>0</code> until then."
},
{
"name": "selectionRect",
"$ref": "SelectionRect",
"description": "Describes a rectangle around the active match, if it has been found, in screen coordinates."
},
{
"name": "canceled",
"type": "boolean",
"description": "Indicates whether the find request was canceled."
},
{
"name": "finalUpdate",
"type": "string",
"description": "Indicates that all find requests have completed and that no more <code>findupdate</code> events will be fired until more find requests are made."
}
]
},
{
"name": "loadabort",
"options": { "supportsDom": true },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment