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

Side by Side Diff: components/security_interstitials/core/browser/resources/interstitial_common.js

Issue 2854263003: Add quiet safe browsing interstitial for WebView (Closed)
Patch Set: Address dbeam comments Created 3 years, 7 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 2017 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 is the shared code for the new (Chrome 37) security interstitials. It is
6 // used for both SSL interstitials and Safe Browsing interstitials.
7
8 // Should match security_interstitials::SecurityInterstitialCommands
Dan Beam 2017/05/16 03:37:30 /** @enum {string} */
edwardjung 2017/05/16 13:59:10 Done.
9 var securityInterstitialCommandId = {
Dan Beam 2017/05/16 03:37:30 nit: capitalize var SecurityInterstitialCommandId
edwardjung 2017/05/16 13:59:10 Done.
10 CMD_DONT_PROCEED: 0,
11 CMD_PROCEED: 1,
12 // Ways for user to get more information
13 CMD_SHOW_MORE_SECTION: 2,
14 CMD_OPEN_HELP_CENTER: 3,
15 CMD_OPEN_DIAGNOSTIC: 4,
16 // Primary button actions
17 CMD_RELOAD: 5,
18 CMD_OPEN_DATE_SETTINGS: 6,
19 CMD_OPEN_LOGIN: 7,
20 // Safe Browsing Extended Reporting
21 CMD_DO_REPORT: 8,
22 CMD_DONT_REPORT: 9,
23 CMD_OPEN_REPORTING_PRIVACY: 10,
24 CMD_OPEN_WHITEPAPER: 11,
25 // Report a phishing error.
26 CMD_REPORT_PHISHING_ERROR: 12
27 };
28
29
30 /**
31 * A convenience method for sending commands to the parent page.
32 * @param {string} cmd The command to send.
33 */
34 function sendCommand(cmd) {
35 // <if expr="not is_ios">
36 window.domAutomationController.setAutomationId(1);
37 window.domAutomationController.send(cmd);
38 // </if>
39 // <if expr="is_ios">
40 // TODO(crbug.com/565877): Revisit message passing for WKWebView.
41 var iframe = document.createElement('IFRAME');
42 iframe.setAttribute('src', 'js-command:' + cmd);
43 document.documentElement.appendChild(iframe);
44 iframe.parentNode.removeChild(iframe);
45 // </if>
46 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698