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

Side by Side Diff: chrome/browser/resources/cryptotoken/googleapprovedorigins.js

Issue 799923007: Enable 3rd party support for Security Keys. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 /**
6 * @fileoverview Provides an implementation of approved origins that always
7 * (and only) allows google.com to use security keys.
8 *
9 */
10 'use strict';
11
12 /**
13 * Allows the caller to check whether the user has approved the use of
14 * security keys from an origin.
15 * @constructor
16 * @implements {ApprovedOrigins}
17 */
18 function GoogleApprovedOrigins() {}
19
20 /**
21 * Checks whether the origin is approved to use security keys. (If not, an
22 * approval prompt may be shown.)
23 * @param {string} origin The origin to approve.
24 * @param {number=} opt_tabId A tab id to display approval prompt in, if
25 * necessary.
26 * @return {Promise.<boolean>} A promise for the result of the check.
27 */
28 GoogleApprovedOrigins.prototype.isApprovedOrigin = function(origin, opt_tabId) {
29 var anchor = document.createElement('a');
30 anchor.href = origin;
31 return Promise.resolve(/google.com$/.test(anchor.hostname));
32 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698