1 // Copyright 2014 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 SurfaceView prototype.
7 var GuestView
= require('guestView').GuestView
;
8 var GuestViewContainer
= require('guestViewContainer').GuestViewContainer
;
10 function SurfaceViewImpl(surfaceviewElement
) {
11 GuestViewContainer
.call(this, surfaceviewElement
, 'surfaceview');
14 SurfaceViewImpl
.prototype.__proto__
= GuestViewContainer
.prototype;
16 SurfaceViewImpl
.VIEW_TYPE
= 'SurfaceView';
18 // Add extra functionality to |this.element|.
19 SurfaceViewImpl
.setupElement = function(proto
) {
24 // Forward proto.foo* method calls to SurfaceViewImpl.foo*.
25 GuestViewContainer
.forwardApiMethods(proto
, apiMethods
);
28 SurfaceViewImpl
.prototype.buildContainerParams = function() {
29 return { 'url': this.url
};
32 SurfaceViewImpl
.prototype.connect = function(url
, callback
) {
33 if (!this.elementAttached
) {
44 this.guest
.create(this.buildParams(), function() {
52 GuestViewContainer
.registerElement(SurfaceViewImpl
);