Commit ae03d3d6 authored by fsamuel@chromium.org's avatar fsamuel@chromium.org

<webview>: Move Find API to Stable

BUG=396730

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285112 0039d316-1c4b-4281-b951-d872f2087c98
parent a51b1846
...@@ -750,6 +750,22 @@ WebViewInternal.prototype.setUserAgentOverride = function(userAgentOverride) { ...@@ -750,6 +750,22 @@ WebViewInternal.prototype.setUserAgentOverride = function(userAgentOverride) {
WebView.overrideUserAgent(this.instanceId, userAgentOverride); WebView.overrideUserAgent(this.instanceId, userAgentOverride);
}; };
/** @private */
WebViewInternal.prototype.find = function(search_text, options, callback) {
if (!this.instanceId) {
return;
}
WebView.find(this.instanceId, search_text, options, callback);
};
/** @private */
WebViewInternal.prototype.stopFinding = function(action) {
if (!this.instanceId) {
return;
}
WebView.stopFinding(this.instanceId, action);
};
WebViewInternal.prototype.buildAttachParams = function(isNewWindow) { WebViewInternal.prototype.buildAttachParams = function(isNewWindow) {
var params = { var params = {
'api': 'webview', 'api': 'webview',
...@@ -847,6 +863,7 @@ function registerWebViewElement() { ...@@ -847,6 +863,7 @@ function registerWebViewElement() {
var methods = [ var methods = [
'back', 'back',
'find',
'forward', 'forward',
'canGoBack', 'canGoBack',
'canGoForward', 'canGoForward',
...@@ -856,6 +873,7 @@ function registerWebViewElement() { ...@@ -856,6 +873,7 @@ function registerWebViewElement() {
'print', 'print',
'reload', 'reload',
'stop', 'stop',
'stopFinding',
'terminate', 'terminate',
'executeScript', 'executeScript',
'insertCSS', 'insertCSS',
......
...@@ -69,6 +69,17 @@ var WEB_VIEW_EVENTS = { ...@@ -69,6 +69,17 @@ var WEB_VIEW_EVENTS = {
evt: CreateEvent('webViewInternal.onExit'), evt: CreateEvent('webViewInternal.onExit'),
fields: ['processId', 'reason'] fields: ['processId', 'reason']
}, },
'findupdate': {
evt: CreateEvent('webViewInternal.onFindReply'),
fields: [
'searchText',
'numberOfMatches',
'activeMatchOrdinal',
'selectionRect',
'canceled',
'finalUpdate'
]
},
'loadabort': { 'loadabort': {
cancelable: true, cancelable: true,
customHandler: function(handler, event, webViewEvent) { customHandler: function(handler, event, webViewEvent) {
......
...@@ -35,17 +35,6 @@ var utils = require('utils'); ...@@ -35,17 +35,6 @@ var utils = require('utils');
// is prevented, then its dispatch function will return false in its event // is prevented, then its dispatch function will return false in its event
// handler. The event must have a custom handler for this to be meaningful. // handler. The event must have a custom handler for this to be meaningful.
var WEB_VIEW_EXPERIMENTAL_EVENTS = { var WEB_VIEW_EXPERIMENTAL_EVENTS = {
'findupdate': {
evt: CreateEvent('webViewInternal.onFindReply'),
fields: [
'searchText',
'numberOfMatches',
'activeMatchOrdinal',
'selectionRect',
'canceled',
'finalUpdate'
]
},
'zoomchange': { 'zoomchange': {
evt: CreateEvent('webViewInternal.onZoomChange'), evt: CreateEvent('webViewInternal.onZoomChange'),
fields: ['oldZoomFactor', 'newZoomFactor'] fields: ['oldZoomFactor', 'newZoomFactor']
...@@ -207,22 +196,6 @@ WebViewInternal.prototype.captureVisibleRegion = function(spec, callback) { ...@@ -207,22 +196,6 @@ WebViewInternal.prototype.captureVisibleRegion = function(spec, callback) {
WebView.captureVisibleRegion(this.instanceId, spec, callback); WebView.captureVisibleRegion(this.instanceId, spec, callback);
}; };
/** @private */
WebViewInternal.prototype.find = function(search_text, options, callback) {
if (!this.instanceId) {
return;
}
WebView.find(this.instanceId, search_text, options, callback);
};
/** @private */
WebViewInternal.prototype.stopFinding = function(action) {
if (!this.instanceId) {
return;
}
WebView.stopFinding(this.instanceId, action);
};
WebViewInternal.maybeRegisterExperimentalAPIs = function(proto) { WebViewInternal.maybeRegisterExperimentalAPIs = function(proto) {
proto.setZoom = function(zoomFactor, callback) { proto.setZoom = function(zoomFactor, callback) {
privates(this).internal.setZoom(zoomFactor, callback); privates(this).internal.setZoom(zoomFactor, callback);
...@@ -235,14 +208,6 @@ WebViewInternal.maybeRegisterExperimentalAPIs = function(proto) { ...@@ -235,14 +208,6 @@ WebViewInternal.maybeRegisterExperimentalAPIs = function(proto) {
proto.captureVisibleRegion = function(spec, callback) { proto.captureVisibleRegion = function(spec, callback) {
privates(this).internal.captureVisibleRegion(spec, callback); privates(this).internal.captureVisibleRegion(spec, callback);
}; };
proto.find = function(search_text, options, callback) {
privates(this).internal.find(search_text, options, callback);
};
proto.stopFinding = function(action) {
privates(this).internal.stopFinding(action);
};
}; };
/** @private */ /** @private */
......
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