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

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
21 // -----------------------------------------------------------------------------
22 // Custom API method implementations.
23
24 ExtensionViewImpl.prototype.connect = function(extension, src) {
25 this.guest.destroy();
26
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);
32
33 this.createGuest();
34 };
35
36 // -----------------------------------------------------------------------------
37
38 ExtensionViewImpl.getApiMethods = function() {
39 return EXTENSION_VIEW_API_METHODS;
40 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698