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

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

Issue 913393003: Restrict extensionview to chrome-extension:// (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months 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 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.
4
5 // This module implements the public-facing API functions for the
6 // <extensionview> tag.
7
8 var ExtensionViewInternal =
9 require('extensionViewInternal').ExtensionViewInternal;
10 var ExtensionViewImpl = require('extensionView').ExtensionViewImpl;
11 var ExtensionViewConstants =
12 require('extensionViewConstants').ExtensionViewConstants;
13
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.
18 'connect',
19
20 // Returns Chrome's internal process ID for the guest web page's current
21 // process.
22 'getProcessId',
Fady Samuel 2015/02/16 19:26:28 Do you need this?
apacible 2015/02/17 18:31:26 No. I kept this around to make a note of it but fo
23 ];
24
25 // -----------------------------------------------------------------------------
26 // Custom API method implementations.
27
28 ExtensionViewImpl.prototype.connect = function(extension, src) {
29 this.guest.destroy();
30
31 // Sets the extension id and src.
32 this.attributes[ExtensionViewConstants.ATTRIBUTE_EXTENSION]
33 .setValueIgnoreMutation(extension);
34 this.attributes[ExtensionViewConstants.ATTRIBUTE_SRC]
35 .setValueIgnoreMutation(src);
36
37 this.createGuest();
38 };
39
40 ExtensionViewImpl.prototype.getProcessId = function() {
41 return this.processId;
Fady Samuel 2015/02/16 19:26:28 What's this? How is this populated?
apacible 2015/02/17 18:31:26 Removed.
42 };
43
44 // -----------------------------------------------------------------------------
45
46 ExtensionViewImpl.getApiMethods = function() {
47 return EXTENSION_VIEW_API_METHODS;
48 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698