1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // This module implements the public-facing API functions for the
6 // <extensionview> tag.
8 var ExtensionViewInternal =
9 require('extensionViewInternal').ExtensionViewInternal;
10 var ExtensionViewImpl = require('extensionView').ExtensionViewImpl;
11 var ExtensionViewConstants =
12 require('extensionViewConstants').ExtensionViewConstants;
14 // An array of <extensionview>'s public-facing API methods.
15 var EXTENSION_VIEW_API_METHODS = [
16 // Sets the extension ID and src for the guest. Must be called every time
17 // the extension ID changes. This is the only way to set the extension ID.
21 // -----------------------------------------------------------------------------
22 // Custom API method implementations.
24 ExtensionViewImpl.prototype.connect = function(extension, src) {
27 // Sets the extension id and src.
28 this.attributes[ExtensionViewConstants.ATTRIBUTE_EXTENSION]
29 .setValueIgnoreMutation(extension);
30 this.attributes[ExtensionViewConstants.ATTRIBUTE_SRC]
31 .setValueIgnoreMutation(src);
36 // -----------------------------------------------------------------------------
38 ExtensionViewImpl.getApiMethods = function() {
39 return EXTENSION_VIEW_API_METHODS;