| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This module implements experimental API for <webview>. | 5 // This module implements experimental API for <webview>. |
| 6 // See web_view.js for details. | 6 // See web_view.js for details. |
| 7 // | 7 // |
| 8 // <webview> Experimental API is only available on canary and dev channels of | 8 // <webview> Experimental API is only available on canary and dev channels of |
| 9 // Chrome. | 9 // Chrome. |
| 10 | 10 |
| 11 var ContextMenusSchema = | 11 var ContextMenusSchema = |
| 12 requireNative('schema_registry').GetSchema('contextMenus'); | 12 requireNative('schema_registry').GetSchema('contextMenus'); |
| 13 var CreateEvent = require('webView').CreateEvent; | 13 var CreateEvent = require('webViewEvents').CreateEvent; |
| 14 var EventBindings = require('event_bindings'); | 14 var EventBindings = require('event_bindings'); |
| 15 var MessagingNatives = requireNative('messaging_natives'); | 15 var MessagingNatives = requireNative('messaging_natives'); |
| 16 var WebView = require('webView').WebView; | 16 var WebView = require('webView').WebView; |
| 17 var WebViewInternal = require('webView').WebViewInternal; | 17 var WebViewInternal = require('webView').WebViewInternal; |
| 18 var WebViewSchema = requireNative('schema_registry').GetSchema('webview'); | 18 var WebViewSchema = requireNative('schema_registry').GetSchema('webview'); |
| 19 var idGeneratorNatives = requireNative('id_generator'); | 19 var idGeneratorNatives = requireNative('id_generator'); |
| 20 var utils = require('utils'); | 20 var utils = require('utils'); |
| 21 | 21 |
| 22 // WEB_VIEW_EXPERIMENTAL_EVENTS is a map of experimental <webview> DOM event | 22 // WEB_VIEW_EXPERIMENTAL_EVENTS is a map of experimental <webview> DOM event |
| 23 // names to their associated extension event descriptor objects. | 23 // names to their associated extension event descriptor objects. |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 proto.find = function(search_text, options, callback) { | 238 proto.find = function(search_text, options, callback) { |
| 239 privates(this).internal.find(search_text, options, callback); | 239 privates(this).internal.find(search_text, options, callback); |
| 240 }; | 240 }; |
| 241 | 241 |
| 242 proto.stopFinding = function(action) { | 242 proto.stopFinding = function(action) { |
| 243 privates(this).internal.stopFinding(action); | 243 privates(this).internal.stopFinding(action); |
| 244 }; | 244 }; |
| 245 }; | 245 }; |
| 246 | 246 |
| 247 /** @private */ | 247 /** @private */ |
| 248 WebViewInternal.prototype.setupExperimentalContextMenus_ = function() { | 248 WebViewInternal.prototype.setupExperimentalContextMenus = function() { |
| 249 var self = this; | 249 var self = this; |
| 250 var createContextMenus = function() { | 250 var createContextMenus = function() { |
| 251 return function() { | 251 return function() { |
| 252 if (self.contextMenus_) { | 252 if (self.contextMenus_) { |
| 253 return self.contextMenus_; | 253 return self.contextMenus_; |
| 254 } | 254 } |
| 255 | 255 |
| 256 self.contextMenus_ = new WebViewContextMenus(self.viewInstanceId); | 256 self.contextMenus_ = new WebViewContextMenus(self.viewInstanceId); |
| 257 | 257 |
| 258 // Define 'onClicked' event property on |self.contextMenus_|. | 258 // Define 'onClicked' event property on |self.contextMenus_|. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 282 | 282 |
| 283 // Expose <webview>.contextMenus object. | 283 // Expose <webview>.contextMenus object. |
| 284 Object.defineProperty( | 284 Object.defineProperty( |
| 285 this.webviewNode, | 285 this.webviewNode, |
| 286 'contextMenus', | 286 'contextMenus', |
| 287 { | 287 { |
| 288 get: createContextMenus(), | 288 get: createContextMenus(), |
| 289 enumerable: true | 289 enumerable: true |
| 290 }); | 290 }); |
| 291 }; | 291 }; |
| OLD | NEW |