Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: extensions/renderer/resources/guest_view/worker_frame.js

Issue 820513002: Renamed WorkerFrame to SurfaceWorker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed tests Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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.
4
5 // This module implements the WorkerFrame prototype.
6
7 var GuestView = require('guestView').GuestView;
8 var GuestViewContainer = require('guestViewContainer').GuestViewContainer;
9
10 function WorkerFrameImpl(workerFrameElement) {
11 GuestViewContainer.call(this, workerFrameElement, 'workerframe');
12 }
13
14 WorkerFrameImpl.prototype.__proto__ = GuestViewContainer.prototype;
15
16 WorkerFrameImpl.VIEW_TYPE = 'WorkerFrame';
17
18 // Add extra functionality to |this.element|.
19 WorkerFrameImpl.setupElement = function(proto) {
20 var apiMethods = [
21 'connect'
22 ];
23
24 // Forward proto.foo* method calls to WorkerFrameImpl.foo*.
25 GuestViewContainer.forwardApiMethods(proto, apiMethods);
26 }
27
28 WorkerFrameImpl.prototype.connect = function(url, callback) {
29 if (!this.elementAttached) {
30 if (callback) {
31 callback(false);
32 }
33 return;
34 }
35
36 this.guest.destroy();
37
38 var createParams = {
39 'url': url
40 };
41
42 this.guest.create(createParams, function() {
43 this.attachWindow();
44 if (callback) {
45 callback(true);
46 }
47 }.bind(this));
48 };
49
50 GuestViewContainer.registerElement(WorkerFrameImpl);
OLDNEW
« no previous file with comments | « extensions/renderer/resources/guest_view/surface_view.js ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698