summaryrefslogtreecommitdiff
path: root/src/org/chromium/support_lib_boundary/WebSettingsBoundaryInterface.java
blob: f3a27cedc6b4889ea2c22d1844204768f5a02d91 (plain)
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
// 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.

package org.chromium.support_lib_boundary;

// Technically this interface is not needed until we add a method to WebSettings with an
// android.webkit parameter or android.webkit return value. But for forwards compatibility all
// app-facing classes should have a boundary-interface that the WebView glue layer can build
// against.

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.Map;
import java.util.Set;

/** Boundary interface for WebSettingsCompat. */
public interface WebSettingsBoundaryInterface {
    void setOffscreenPreRaster(boolean enabled);

    boolean getOffscreenPreRaster();

    void setSafeBrowsingEnabled(boolean enabled);

    boolean getSafeBrowsingEnabled();

    void setDisabledActionModeMenuItems(int menuItems);

    int getDisabledActionModeMenuItems();

    void setWillSuppressErrorPage(boolean suppressed);

    boolean getWillSuppressErrorPage();

    void setForceDark(int forceDarkMode);

    int getForceDark();

    void setAlgorithmicDarkeningAllowed(boolean allow);

    boolean isAlgorithmicDarkeningAllowed();

    @Retention(RetentionPolicy.SOURCE)
    @interface ForceDarkBehavior {
        int FORCE_DARK_ONLY = 0;
        int MEDIA_QUERY_ONLY = 1;
        int PREFER_MEDIA_QUERY_OVER_FORCE_DARK = 2;
    }

    void setForceDarkBehavior(@ForceDarkBehavior int forceDarkBehavior);

    @ForceDarkBehavior
    int getForceDarkBehavior();

    @Retention(RetentionPolicy.SOURCE)
    @interface WebauthnSupport {
        int NONE = 0;
        int APP = 1;
        int BROWSER = 2;
    }

    void setWebauthnSupport(@WebauthnSupport int support);

    @WebauthnSupport
    int getWebauthnSupport();

    void setRequestedWithHeaderOriginAllowList(Set<String> allowedOriginRules);

    Set<String> getRequestedWithHeaderOriginAllowList();

    void setEnterpriseAuthenticationAppLinkPolicyEnabled(boolean enabled);

    boolean getEnterpriseAuthenticationAppLinkPolicyEnabled();

    void setUserAgentMetadataFromMap(Map<String, Object> uaMetadata);

    Map<String, Object> getUserAgentMetadataMap();

    @Retention(RetentionPolicy.SOURCE)
    @interface AttributionBehavior {
        int DISABLED = 0;
        int APP_SOURCE_AND_WEB_TRIGGER = 1;
        int WEB_SOURCE_AND_WEB_TRIGGER = 2;
        int APP_SOURCE_AND_APP_TRIGGER = 3;
    }

    void setAttributionBehavior(@AttributionBehavior int behavior);

    @AttributionBehavior
    int getAttributionBehavior();

    @Target(ElementType.TYPE_USE)
    @Retention(RetentionPolicy.SOURCE)
    @interface WebViewMediaIntegrityApiStatus {
        int DISABLED = 0;
        int ENABLED_WITHOUT_APP_IDENTITY = 1;
        int ENABLED = 2;
    }

    void setWebViewMediaIntegrityApiStatus(
            @WebViewMediaIntegrityApiStatus int defaultPermission,
            Map<String, @WebViewMediaIntegrityApiStatus Integer> permissionConfig);

    @WebViewMediaIntegrityApiStatus
    int getWebViewMediaIntegrityApiDefaultStatus();

    Map<String, @WebViewMediaIntegrityApiStatus Integer> getWebViewMediaIntegrityApiOverrideRules();
}