File: safe_browsing_private.idl

package info (click to toggle)
chromium 138.0.7204.183-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,071,908 kB
  • sloc: cpp: 34,937,088; ansic: 7,176,967; javascript: 4,110,704; python: 1,419,953; asm: 946,768; xml: 739,971; pascal: 187,324; sh: 89,623; perl: 88,663; objc: 79,944; sql: 50,304; cs: 41,786; fortran: 24,137; makefile: 21,806; php: 13,980; tcl: 13,166; yacc: 8,925; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (173 lines) | stat: -rw-r--r-- 5,371 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Use the <code>chrome.safeBrowsingPrivate</code> API to observe events
// or retrieve referrer chain.
namespace safeBrowsingPrivate {

  enum URLType {
    // Ends with the final URL of the referrer chain.
    EVENT_URL,

    // One gesture away from the EVENT_URL, i.e. the user will click on the
    // LANDING_PAGE, go through zero or more CLIENT_REDIRECTS, then end up
    // at EVENT_URL.
    LANDING_PAGE,

    // One gesture away from LANDING_PAGE.
    LANDING_REFERRER,

    // The navigation is RENDER_INITIATED_WITHOUT_USER_GESTURE.
    CLIENT_REDIRECT,

    // Doesn't directly lead to the EVENT_URL, but the navigation occurred
    // recently, so it might be involved in the event.
    RECENT_NAVIGATION,

    // Triggered by a user gesture and precedes the LANDING_REFERRER.
    REFERRER
  };

  enum NavigationInitiation {
    // Typically from Chrome UI, e.g. bookmarks or omnibox.
    BROWSER_INITIATED,

    // Renderer initiated navigations involve interactions with the content
    // area, such as link clicks or JS.
    RENDERER_INITIATED_WITHOUT_USER_GESTURE,
    RENDERER_INITIATED_WITH_USER_GESTURE,

    // Navigation is initiated by the browser process and it is believed the
    // navigation is the result of the user copy and paste the address from the
    // browser into the address bar.
    COPY_PASTE_USER_INITIATED,

    // Navigation is initiated by a click on a Push Notification.
    NOTIFICATION_INITIATED
  };

  dictionary PolicySpecifiedPasswordReuse {
    // URL where this reuse happened.
    DOMString url;

    // The user name of the policy specified password.
    DOMString userName;

    // If this a phishing url.
    boolean isPhishingUrl;
  };

  dictionary DangerousDownloadInfo {
    // URL of the download.
    DOMString url;

    // File name and path of the download on user's machine.
    DOMString fileName;

    // SHA256 digest of this download.
    DOMString downloadDigestSha256;

    // User name of the profile. Empty string if user name not available.
    DOMString userName;
  };

  dictionary InterstitialInfo {
    // Top level URL that triggers this interstitial.
    DOMString url;

    // Human-readable string indicate why this interstitial is shown.
    DOMString reason;

    // Net error code.
    DOMString? netErrorCode;

    // User name of the profile. Empty string if user name not available.
    DOMString userName;
  };

  dictionary ServerRedirect {
    // Server redirect URL.
    DOMString? url;
  };

  // From ReferrerChainEntry in //src/components/safe_browsing/core/common/proto/csd.proto
  dictionary ReferrerChainEntry {
    // URL of this entry.
    DOMString url;

    // Only set if different from |url|.
    DOMString? mainFrameUrl;

    // Types of URLs, such as event url, landing page, etc.
    URLType urlType;

    // IP addresses corresponding to this host.
    DOMString[]? ipAddresses;

    // Referrer URL of this entry.
    DOMString? referrerUrl;

    // Main frame URL of referrer. Only set if different from |referrer_url|.
    DOMString? referrerMainFrameUrl;

    // If this URL loads in a different tab/frame from previous one.
    boolean? isRetargeting;

    double? navigationTimeMs;

    // Set only if server redirects happened in navigation.
    ServerRedirect[]? serverRedirectChain;

    // How this navigation is initiated.
    NavigationInitiation? navigationInitiation;

    // Whether this entry may have been launched by an external application.
    boolean? maybeLaunchedByExternalApp;

    // Whether subframe URLs are removed due to user consent restriction.
    boolean? isSubframeUrlRemoved;

    // Whether subframe referrer URLs are removed due to user consent
    // restriction.
    boolean? isSubframeReferrerUrlRemoved;

    // Whether any of the URLs are removed because the URL matches the
    // SafeBrowsingAllowlistDomains enterprise policy in Chrome.
    boolean isUrlRemovedByPolicy;
  };

  callback GetReferrerChainCallback = void(ReferrerChainEntry[] entries);

  interface Functions {
    // Gets referrer chain for the specified tab.
    // |tabId|: Id of the tab from which to retrieve the referrer.
    // |callback|: Called with the list of referrer chain entries.
    static void getReferrerChain(
        long tabId,
        GetReferrerChainCallback callback);
  };

  interface Events {
    // Fired when Chrome detects a reuse of a policy specified password.
    //
    // |reuseDetails|: Details about where the password reuse occurred.
    static void onPolicySpecifiedPasswordReuseDetected(
        PolicySpecifiedPasswordReuse reuseDetails);

    // Fired when the user changed their policy specified password.
    //
    // |userName|: The user name of the policy specified password.
    static void onPolicySpecifiedPasswordChanged(DOMString userName);

    // Fired when the user opened a dangerous download.
    static void onDangerousDownloadOpened(DangerousDownloadInfo dict);

    // Fired when a security interstitial is shown to the user.
    static void onSecurityInterstitialShown(InterstitialInfo dict);

    // Fired when the user clicked-through a security interstitial.
    static void onSecurityInterstitialProceeded(InterstitialInfo dict);
  };

};