| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Shim that simulates a <webview> tag via Mutation Observers. | 5 // Shim that simulates a <webview> tag via Mutation Observers. |
| 6 // | 6 // |
| 7 // The actual tag is implemented via the browser plugin. The internals of this | 7 // The actual tag is implemented via the browser plugin. The internals of this |
| 8 // are hidden via Shadow DOM. | 8 // are hidden via Shadow DOM. |
| 9 | 9 |
| 10 var watchForTag = require('tagWatcher').watchForTag; | 10 var watchForTag = require("tagWatcher").watchForTag; |
| 11 | |
| 12 var chrome = requireNative('chrome').GetChrome(); | |
| 13 | 11 |
| 14 var WEB_VIEW_ATTRIBUTES = ['name', 'src', 'partition', 'autosize', 'minheight', | 12 var WEB_VIEW_ATTRIBUTES = ['name', 'src', 'partition', 'autosize', 'minheight', |
| 15 'minwidth', 'maxheight', 'maxwidth']; | 13 'minwidth', 'maxheight', 'maxwidth']; |
| 16 | 14 |
| 17 // All exposed api methods for <webview>, these are forwarded to the browser | 15 // All exposed api methods for <webview>, these are forwarded to the browser |
| 18 // plugin. | 16 // plugin. |
| 19 var WEB_VIEW_API_METHODS = [ | 17 var WEB_VIEW_API_METHODS = [ |
| 20 'back', | 18 'back', |
| 21 'canGoBack', | 19 'canGoBack', |
| 22 'canGoForward', | 20 'canGoForward', |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 var node = this.node_; | 177 var node = this.node_; |
| 180 this.objectNode_.addEventListener('-internal-' + eventname, function(e) { | 178 this.objectNode_.addEventListener('-internal-' + eventname, function(e) { |
| 181 var evt = new Event(eventname, { bubbles: true }); | 179 var evt = new Event(eventname, { bubbles: true }); |
| 182 var detail = e.detail ? JSON.parse(e.detail) : {}; | 180 var detail = e.detail ? JSON.parse(e.detail) : {}; |
| 183 attribs.forEach(function(attribName) { | 181 attribs.forEach(function(attribName) { |
| 184 evt[attribName] = detail[attribName]; | 182 evt[attribName] = detail[attribName]; |
| 185 }); | 183 }); |
| 186 node.dispatchEvent(evt); | 184 node.dispatchEvent(evt); |
| 187 }); | 185 }); |
| 188 } | 186 } |
| OLD | NEW |