Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aaecb88d34 |
@@ -1 +1 @@
|
||||
147.0.7727.102
|
||||
148.0.7778.168
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "android_webview/browser/aw_speech_recognition_manager_delegate.h"
|
||||
#include "android_webview/browser/aw_web_contents_delegate.h"
|
||||
#include "android_webview/browser/aw_web_contents_view_delegate.h"
|
||||
#include "android_webview/browser/content_restriction/aw_content_restriction_url_loader_throttle.h"
|
||||
#include "android_webview/browser/cookie_manager.h"
|
||||
#include "android_webview/browser/network_service/aw_browser_context_io_thread_handle.h"
|
||||
#include "android_webview/browser/network_service/aw_proxy_config_monitor.h"
|
||||
@@ -794,6 +795,14 @@ AwContentBrowserClient::CreateURLLoaderThrottles(
|
||||
/* async_check_tracker */ async_check_tracker,
|
||||
/*referring_app_info=*/std::nullopt));
|
||||
|
||||
if (browser_context &&
|
||||
base::FeatureList::IsEnabled(
|
||||
android_webview::features::kWebViewContentRestrictionSupport)) {
|
||||
result.push_back(std::make_unique<AwContentRestrictionURLLoaderThrottle>(
|
||||
static_cast<AwBrowserContext*>(browser_context)
|
||||
->GetContentRestrictionManagerClient()));
|
||||
}
|
||||
|
||||
if (request.destination == network::mojom::RequestDestination::kDocument) {
|
||||
const bool is_load_url =
|
||||
request.transition_type & ui::PAGE_TRANSITION_FROM_API;
|
||||
@@ -1488,7 +1497,9 @@ bool AwContentBrowserClient::IsFullCookieAccessAllowed(
|
||||
const GURL& url,
|
||||
const blink::StorageKey& storage_key,
|
||||
net::CookieSettingOverrides overrides) {
|
||||
return AreThirdPartyCookiesGenerallyAllowed(browser_context, web_contents);
|
||||
// Third-party cookie access is never allowed from opaque contexts.
|
||||
return !storage_key.ForbidsUnpartitionedStorageAccess() &&
|
||||
AreThirdPartyCookiesGenerallyAllowed(browser_context, web_contents);
|
||||
}
|
||||
|
||||
bool AwContentBrowserClient::AreThirdPartyCookiesGenerallyAllowed(
|
||||
|
||||
@@ -101,9 +101,7 @@ void AwFieldTrials::RegisterFeatureOverrides(base::FeatureList* feature_list) {
|
||||
// enable these optimizations in WebView though they are not fundamentally
|
||||
// impossible.
|
||||
aw_feature_overrides.DisableFeature(
|
||||
blink::features::kLowLatencyCanvas2dImageChromium);
|
||||
aw_feature_overrides.DisableFeature(
|
||||
blink::features::kLowLatencyWebGLImageChromium);
|
||||
blink::features::kLowLatencyUsageSupportedForCanvas);
|
||||
|
||||
// Disable Shared Storage on WebView.
|
||||
aw_feature_overrides.DisableFeature(network::features::kSharedStorageAPI);
|
||||
@@ -326,10 +324,6 @@ void AwFieldTrials::RegisterFeatureOverrides(base::FeatureList* feature_list) {
|
||||
// the WebView's host, we keep the old behavior for content:// URLs.
|
||||
aw_feature_overrides.DisableFeature(blink::features::kContentSchemeIsLocal);
|
||||
|
||||
// Disable No-Vary-Search in disk cache on WebView.
|
||||
// See https://crbug.com/382394774.
|
||||
aw_feature_overrides.DisableFeature(net::features::kHttpCacheNoVarySearch);
|
||||
|
||||
// TODO(crbug.com/489450060): Disable DirectReceiver on Viz for WebView until
|
||||
// its Viz thread is updated to handle IO.
|
||||
aw_feature_overrides.DisableFeature(
|
||||
|
||||
+119
-19
@@ -528,12 +528,14 @@ interface CSPViolationReportBody : ReportBody
|
||||
getter disposition
|
||||
getter documentURL
|
||||
getter effectiveDirective
|
||||
getter evalHash
|
||||
getter lineNumber
|
||||
getter originalPolicy
|
||||
getter referrer
|
||||
getter sample
|
||||
getter sourceFile
|
||||
getter statusCode
|
||||
getter urlHash
|
||||
method constructor
|
||||
method toJSON
|
||||
interface CSSAnimation : Animation
|
||||
@@ -1262,7 +1264,6 @@ interface CanvasRenderingContext2D
|
||||
method createMesh2DVertexBuffer
|
||||
method createPattern
|
||||
method createRadialGradient
|
||||
method drawElement
|
||||
method drawElementImage
|
||||
method drawFocusIfNeeded
|
||||
method drawImage
|
||||
@@ -1377,6 +1378,12 @@ interface CharacterData : Node
|
||||
method replaceWith
|
||||
method replaceWithHTML
|
||||
method replaceWithHTMLUnsafe
|
||||
method streamAfterHTML
|
||||
method streamAfterHTMLUnsafe
|
||||
method streamBeforeHTML
|
||||
method streamBeforeHTMLUnsafe
|
||||
method streamReplaceWithHTML
|
||||
method streamReplaceWithHTMLUnsafe
|
||||
method substringData
|
||||
setter data
|
||||
interface Clipboard : EventTarget
|
||||
@@ -1503,6 +1510,7 @@ interface CreateMonitor : EventTarget
|
||||
method constructor
|
||||
setter ondownloadprogress
|
||||
interface Credential
|
||||
static method isConditionalMediationAvailable
|
||||
attribute @@toStringTag
|
||||
getter id
|
||||
getter type
|
||||
@@ -2006,7 +2014,10 @@ interface Document : Node
|
||||
getter onmouseover
|
||||
getter onmouseup
|
||||
getter onmousewheel
|
||||
getter onoverscroll
|
||||
getter onoverscrollcancel
|
||||
getter onoverscrollchanging
|
||||
getter onoverscrollend
|
||||
getter onoverscrollstart
|
||||
getter onpaste
|
||||
getter onpause
|
||||
getter onplay
|
||||
@@ -2232,7 +2243,10 @@ interface Document : Node
|
||||
setter onmouseover
|
||||
setter onmouseup
|
||||
setter onmousewheel
|
||||
setter onoverscroll
|
||||
setter onoverscrollcancel
|
||||
setter onoverscrollchanging
|
||||
setter onoverscrollend
|
||||
setter onoverscrollstart
|
||||
setter onpaste
|
||||
setter onpause
|
||||
setter onplay
|
||||
@@ -2329,6 +2343,12 @@ interface DocumentType : Node
|
||||
method replaceWith
|
||||
method replaceWithHTML
|
||||
method replaceWithHTMLUnsafe
|
||||
method streamAfterHTML
|
||||
method streamAfterHTMLUnsafe
|
||||
method streamBeforeHTML
|
||||
method streamBeforeHTMLUnsafe
|
||||
method streamReplaceWithHTML
|
||||
method streamReplaceWithHTMLUnsafe
|
||||
interface DragEvent : MouseEvent
|
||||
attribute @@toStringTag
|
||||
getter dataTransfer
|
||||
@@ -2446,7 +2466,6 @@ interface Element : Node
|
||||
getter innerHTML
|
||||
getter lastElementChild
|
||||
getter localName
|
||||
getter marker
|
||||
getter namespaceURI
|
||||
getter nextElementSibling
|
||||
getter onbeforecopy
|
||||
@@ -2536,10 +2555,18 @@ interface Element : Node
|
||||
method setHTMLUnsafe
|
||||
method setPointerCapture
|
||||
method startViewTransition
|
||||
method streamAfterHTML
|
||||
method streamAfterHTMLUnsafe
|
||||
method streamAppendHTML
|
||||
method streamAppendHTMLUnsafe
|
||||
method streamBeforeHTML
|
||||
method streamBeforeHTMLUnsafe
|
||||
method streamHTML
|
||||
method streamHTMLUnsafe
|
||||
method streamPrependHTML
|
||||
method streamPrependHTMLUnsafe
|
||||
method streamReplaceWithHTML
|
||||
method streamReplaceWithHTMLUnsafe
|
||||
method toggleAttribute
|
||||
method webkitMatchesSelector
|
||||
method webkitRequestFullScreen
|
||||
@@ -2605,7 +2632,6 @@ interface Element : Node
|
||||
setter headingReset
|
||||
setter id
|
||||
setter innerHTML
|
||||
setter marker
|
||||
setter onbeforecopy
|
||||
setter onbeforecut
|
||||
setter onbeforepaste
|
||||
@@ -2620,6 +2646,15 @@ interface Element : Node
|
||||
setter scrollLeft
|
||||
setter scrollTop
|
||||
setter slot
|
||||
interface ElementBehavior
|
||||
attribute @@toStringTag
|
||||
method constructor
|
||||
interface ElementImage
|
||||
attribute @@toStringTag
|
||||
getter height
|
||||
getter width
|
||||
method close
|
||||
method constructor
|
||||
interface ElementInternals
|
||||
attribute @@toStringTag
|
||||
getter ariaActiveDescendantElement
|
||||
@@ -2674,6 +2709,7 @@ interface ElementInternals
|
||||
getter ariaValueNow
|
||||
getter ariaValueText
|
||||
getter ariaVirtualContent
|
||||
getter behaviors
|
||||
getter form
|
||||
getter labels
|
||||
getter role
|
||||
@@ -3681,6 +3717,7 @@ interface HTMLCanvasElement : HTMLElement
|
||||
getter layoutSubtree
|
||||
getter onpaint
|
||||
getter width
|
||||
method captureElementImage
|
||||
method captureStream
|
||||
method configureHighDynamicRange
|
||||
method constructor
|
||||
@@ -3832,7 +3869,10 @@ interface HTMLElement : Element
|
||||
getter onmouseover
|
||||
getter onmouseup
|
||||
getter onmousewheel
|
||||
getter onoverscroll
|
||||
getter onoverscrollcancel
|
||||
getter onoverscrollchanging
|
||||
getter onoverscrollend
|
||||
getter onoverscrollstart
|
||||
getter onpaste
|
||||
getter onpause
|
||||
getter onplay
|
||||
@@ -3972,7 +4012,10 @@ interface HTMLElement : Element
|
||||
setter onmouseover
|
||||
setter onmouseup
|
||||
setter onmousewheel
|
||||
setter onoverscroll
|
||||
setter onoverscrollcancel
|
||||
setter onoverscrollchanging
|
||||
setter onoverscrollend
|
||||
setter onoverscrollstart
|
||||
setter onpaste
|
||||
setter onpause
|
||||
setter onplay
|
||||
@@ -4949,6 +4992,27 @@ interface HTMLStyleElement : HTMLElement
|
||||
setter disabled
|
||||
setter media
|
||||
setter type
|
||||
interface HTMLSubmitButtonBehavior : ElementBehavior
|
||||
attribute @@toStringTag
|
||||
getter disabled
|
||||
getter form
|
||||
getter formAction
|
||||
getter formEnctype
|
||||
getter formMethod
|
||||
getter formNoValidate
|
||||
getter formTarget
|
||||
getter labels
|
||||
getter name
|
||||
getter value
|
||||
method constructor
|
||||
setter disabled
|
||||
setter formAction
|
||||
setter formEnctype
|
||||
setter formMethod
|
||||
setter formNoValidate
|
||||
setter formTarget
|
||||
setter name
|
||||
setter value
|
||||
interface HTMLTableCaptionElement : HTMLElement
|
||||
attribute @@toStringTag
|
||||
getter align
|
||||
@@ -5074,12 +5138,14 @@ interface HTMLTableSectionElement : HTMLElement
|
||||
interface HTMLTemplateElement : HTMLElement
|
||||
attribute @@toStringTag
|
||||
getter content
|
||||
getter htmlFor
|
||||
getter shadowRootClonable
|
||||
getter shadowRootCustomElementRegistry
|
||||
getter shadowRootDelegatesFocus
|
||||
getter shadowRootMode
|
||||
getter shadowRootSerializable
|
||||
method constructor
|
||||
setter htmlFor
|
||||
setter shadowRootClonable
|
||||
setter shadowRootCustomElementRegistry
|
||||
setter shadowRootDelegatesFocus
|
||||
@@ -5843,7 +5909,10 @@ interface MathMLElement : Element
|
||||
getter onmouseover
|
||||
getter onmouseup
|
||||
getter onmousewheel
|
||||
getter onoverscroll
|
||||
getter onoverscrollcancel
|
||||
getter onoverscrollchanging
|
||||
getter onoverscrollend
|
||||
getter onoverscrollstart
|
||||
getter onpaste
|
||||
getter onpause
|
||||
getter onplay
|
||||
@@ -5958,7 +6027,10 @@ interface MathMLElement : Element
|
||||
setter onmouseover
|
||||
setter onmouseup
|
||||
setter onmousewheel
|
||||
setter onoverscroll
|
||||
setter onoverscrollcancel
|
||||
setter onoverscrollchanging
|
||||
setter onoverscrollend
|
||||
setter onoverscrollstart
|
||||
setter onpaste
|
||||
setter onpause
|
||||
setter onplay
|
||||
@@ -6315,7 +6387,6 @@ interface ModelContext
|
||||
attribute @@toStringTag
|
||||
method constructor
|
||||
method registerTool
|
||||
method unregisterTool
|
||||
interface Mojo
|
||||
static method bindInterface
|
||||
static method createDataPipe
|
||||
@@ -6786,6 +6857,7 @@ interface OffscreenCanvas : EventTarget
|
||||
method constructor
|
||||
method convertToBlob
|
||||
method getContext
|
||||
method getElementTransform
|
||||
method transferToImageBitmap
|
||||
setter height
|
||||
setter oncontextlost
|
||||
@@ -6839,6 +6911,7 @@ interface OffscreenCanvasRenderingContext2D
|
||||
method createMesh2DVertexBuffer
|
||||
method createPattern
|
||||
method createRadialGradient
|
||||
method drawElementImage
|
||||
method drawImage
|
||||
method drawMesh
|
||||
method ellipse
|
||||
@@ -6955,7 +7028,8 @@ interface OverconstrainedError : DOMException
|
||||
method constructor
|
||||
interface OverscrollEvent : Event
|
||||
attribute @@toStringTag
|
||||
getter overscrollElement
|
||||
getter overscrollTarget
|
||||
getter overscrolling
|
||||
method constructor
|
||||
interface PageRevealEvent : Event
|
||||
attribute @@toStringTag
|
||||
@@ -8174,7 +8248,10 @@ interface SVGElement : Element
|
||||
getter onmouseover
|
||||
getter onmouseup
|
||||
getter onmousewheel
|
||||
getter onoverscroll
|
||||
getter onoverscrollcancel
|
||||
getter onoverscrollchanging
|
||||
getter onoverscrollend
|
||||
getter onoverscrollstart
|
||||
getter onpaste
|
||||
getter onpause
|
||||
getter onplay
|
||||
@@ -8291,7 +8368,10 @@ interface SVGElement : Element
|
||||
setter onmouseover
|
||||
setter onmouseup
|
||||
setter onmousewheel
|
||||
setter onoverscroll
|
||||
setter onoverscrollcancel
|
||||
setter onoverscrollchanging
|
||||
setter onoverscrollend
|
||||
setter onoverscrollstart
|
||||
setter onpaste
|
||||
setter onpause
|
||||
setter onplay
|
||||
@@ -9230,6 +9310,7 @@ interface SecurityPolicyViolationEvent : Event
|
||||
getter sample
|
||||
getter sourceFile
|
||||
getter statusCode
|
||||
getter urlHash
|
||||
getter violatedDirective
|
||||
method constructor
|
||||
interface Selection
|
||||
@@ -9337,7 +9418,6 @@ interface ShadowRoot : DocumentFragment
|
||||
getter fullscreenElement
|
||||
getter host
|
||||
getter innerHTML
|
||||
getter marker
|
||||
getter mode
|
||||
getter onslotchange
|
||||
getter pictureInPictureElement
|
||||
@@ -9362,6 +9442,8 @@ interface ShadowRoot : DocumentFragment
|
||||
method streamAppendHTMLUnsafe
|
||||
method streamHTML
|
||||
method streamHTMLUnsafe
|
||||
method streamPrependHTML
|
||||
method streamPrependHTMLUnsafe
|
||||
setter adoptedStyleSheets
|
||||
setter fullscreenElement
|
||||
setter innerHTML
|
||||
@@ -9376,7 +9458,6 @@ interface SharedStorage
|
||||
method constructor
|
||||
method createWorklet
|
||||
method delete
|
||||
method get
|
||||
method run
|
||||
method selectURL
|
||||
method set
|
||||
@@ -9491,6 +9572,7 @@ interface SpeechRecognition : EventTarget
|
||||
getter onspeechstart
|
||||
getter onstart
|
||||
getter processLocally
|
||||
getter quality
|
||||
method abort
|
||||
method constructor
|
||||
method start
|
||||
@@ -9512,6 +9594,7 @@ interface SpeechRecognition : EventTarget
|
||||
setter onspeechstart
|
||||
setter onstart
|
||||
setter processLocally
|
||||
setter quality
|
||||
interface SpeechRecognitionErrorEvent : Event
|
||||
attribute @@toStringTag
|
||||
getter error
|
||||
@@ -9522,6 +9605,11 @@ interface SpeechRecognitionEvent : Event
|
||||
getter resultIndex
|
||||
getter results
|
||||
method constructor
|
||||
interface SpellCheckCustomDictionary
|
||||
attribute @@toStringTag
|
||||
method addWords
|
||||
method constructor
|
||||
method removeWords
|
||||
interface StaticRange : AbstractRange
|
||||
attribute @@toStringTag
|
||||
method constructor
|
||||
@@ -11029,7 +11117,6 @@ interface WebGL2RenderingContext
|
||||
method stencilMaskSeparate
|
||||
method stencilOp
|
||||
method stencilOpSeparate
|
||||
method texElement2D
|
||||
method texElementImage2D
|
||||
method texImage2D
|
||||
method texImage3D
|
||||
@@ -11532,7 +11619,6 @@ interface WebGLRenderingContext
|
||||
method stencilMaskSeparate
|
||||
method stencilOp
|
||||
method stencilOpSeparate
|
||||
method texElement2D
|
||||
method texElementImage2D
|
||||
method texImage2D
|
||||
method texParameterf
|
||||
@@ -11714,6 +11800,7 @@ interface WebTransport
|
||||
method close
|
||||
method constructor
|
||||
method createBidirectionalStream
|
||||
method createSendGroup
|
||||
method createUnidirectionalStream
|
||||
method getStats
|
||||
interface WebTransportBidirectionalStream
|
||||
@@ -11740,6 +11827,10 @@ interface WebTransportError : DOMException
|
||||
getter source
|
||||
getter streamErrorCode
|
||||
method constructor
|
||||
interface WebTransportSendGroup
|
||||
attribute @@toStringTag
|
||||
method constructor
|
||||
method getStats
|
||||
interface WheelEvent : MouseEvent
|
||||
attribute @@toStringTag
|
||||
attribute DOM_DELTA_LINE
|
||||
@@ -12047,6 +12138,7 @@ interface webkitSpeechRecognition : EventTarget
|
||||
getter onspeechstart
|
||||
getter onstart
|
||||
getter processLocally
|
||||
getter quality
|
||||
method abort
|
||||
method constructor
|
||||
method start
|
||||
@@ -12068,6 +12160,7 @@ interface webkitSpeechRecognition : EventTarget
|
||||
setter onspeechstart
|
||||
setter onstart
|
||||
setter processLocally
|
||||
setter quality
|
||||
interface webkitSpeechRecognitionError : Event
|
||||
attribute @@toStringTag
|
||||
getter error
|
||||
@@ -12368,7 +12461,10 @@ namespace console
|
||||
getter onoffline
|
||||
getter ononline
|
||||
getter onorientationchange
|
||||
getter onoverscroll
|
||||
getter onoverscrollcancel
|
||||
getter onoverscrollchanging
|
||||
getter onoverscrollend
|
||||
getter onoverscrollstart
|
||||
getter onpagehide
|
||||
getter onpagereveal
|
||||
getter onpageshow
|
||||
@@ -12450,6 +12546,7 @@ namespace console
|
||||
getter self
|
||||
getter sessionStorage
|
||||
getter sharedStorage
|
||||
getter spellCheckCustomDictionary
|
||||
getter status
|
||||
getter statusbar
|
||||
getter styleMedia
|
||||
@@ -12594,7 +12691,10 @@ namespace console
|
||||
setter onoffline
|
||||
setter ononline
|
||||
setter onorientationchange
|
||||
setter onoverscroll
|
||||
setter onoverscrollcancel
|
||||
setter onoverscrollchanging
|
||||
setter onoverscrollend
|
||||
setter onoverscrollstart
|
||||
setter onpagehide
|
||||
setter onpagereveal
|
||||
setter onpageshow
|
||||
|
||||
@@ -94,14 +94,6 @@ by a child template that "extends" this file.
|
||||
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
|
||||
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
||||
<uses-permission-sdk-23 android:name="android.permission.READ_MEDIA_AUDIO"/>
|
||||
|
||||
<!-- Needed for handling media-viewing Intents from other apps for images and video on low end
|
||||
or managed devices (eg. crbug.com/40546519), monitoring of screenshots if permission has
|
||||
been previously granted (doesn't request independently) (crbug.com/40520892), and
|
||||
Chromium's custom photo picker used on Android S and below (crbug.com/40489056) -->
|
||||
<uses-permission-sdk-23 android:name="android.permission.READ_MEDIA_IMAGES"/>
|
||||
<uses-permission-sdk-23 android:name="android.permission.READ_MEDIA_VIDEO"/>
|
||||
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
|
||||
@@ -738,24 +730,6 @@ by a child template that "extends" this file.
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize|uiMode">
|
||||
</activity>
|
||||
|
||||
<!-- Activities for feed. -->
|
||||
<activity android:name="org.chromium.chrome.browser.app.feed.feedmanagement.FeedManagementActivity"
|
||||
android:theme="@style/Theme.Chromium.Settings"
|
||||
android:windowSoftInputMode="stateAlwaysHidden|adjustResize"
|
||||
android:exported="false"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize|uiMode">
|
||||
</activity>
|
||||
<activity android:name="org.chromium.chrome.browser.app.feed.followmanagement.FollowManagementActivity"
|
||||
android:theme="@style/Theme.Chromium.Settings"
|
||||
android:windowSoftInputMode="stateAlwaysHidden|adjustResize"
|
||||
android:exported="false"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize|uiMode">
|
||||
<intent-filter>
|
||||
<action android:name="org.chromium.chrome.browser.app.feed.followmanagement.FollowManagementActivity.ACTIVATE" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<!-- Activities for creator. -->
|
||||
<activity android:name="org.chromium.chrome.browser.app.creator.CreatorActivity"
|
||||
android:theme="@style/Theme.Chromium.Activity.Fullscreen"
|
||||
|
||||
+45
-6
@@ -42,6 +42,7 @@ import android.app.PendingIntent.CanceledException;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Network;
|
||||
import android.net.Uri;
|
||||
@@ -50,6 +51,7 @@ import android.text.TextUtils;
|
||||
import android.util.Pair;
|
||||
import android.widget.RemoteViews;
|
||||
|
||||
import androidx.annotation.ColorInt;
|
||||
import androidx.annotation.IntDef;
|
||||
import androidx.annotation.Px;
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
@@ -76,6 +78,7 @@ import org.chromium.base.DeviceInfo;
|
||||
import org.chromium.base.IntentUtils;
|
||||
import org.chromium.base.LocaleUtils;
|
||||
import org.chromium.base.Log;
|
||||
import org.chromium.base.MathUtils;
|
||||
import org.chromium.base.ResettersForTesting;
|
||||
import org.chromium.base.metrics.RecordHistogram;
|
||||
import org.chromium.base.metrics.RecordUserAction;
|
||||
@@ -95,11 +98,13 @@ import org.chromium.chrome.browser.flags.ActivityType;
|
||||
import org.chromium.chrome.browser.flags.ChromeFeatureList;
|
||||
import org.chromium.chrome.browser.flags.CustomTabProfileType;
|
||||
import org.chromium.chrome.browser.share.ShareUtils;
|
||||
import org.chromium.chrome.browser.tab.Tab;
|
||||
import org.chromium.chrome.browser.toolbar.adaptive.AdaptiveToolbarButtonVariant;
|
||||
import org.chromium.chrome.browser.ui.google_bottom_bar.GoogleBottomBarCoordinator;
|
||||
import org.chromium.chrome.browser.ui.google_bottom_bar.proto.IntentParams.GoogleBottomBarIntentParams;
|
||||
import org.chromium.chrome.browser.ui.web_app_header.WebAppHeaderUtils;
|
||||
import org.chromium.chrome.browser.util.WindowFeatures;
|
||||
import org.chromium.components.browser_ui.styles.SemanticColorUtils;
|
||||
import org.chromium.components.browser_ui.widget.TintedDrawable;
|
||||
import org.chromium.components.embedder_support.util.Origin;
|
||||
import org.chromium.components.embedder_support.util.UrlConstants;
|
||||
@@ -114,6 +119,7 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* A model class that parses the incoming intent for Custom Tabs specific customization data.
|
||||
@@ -208,6 +214,9 @@ public class CustomTabIntentDataProvider extends BrowserServicesIntentDataProvid
|
||||
static final String EXTRA_CUSTOM_CONTENT_ACTIONS =
|
||||
"androidx.browser.customtabs.extra.CUSTOM_CONTENT_ACTIONS";
|
||||
|
||||
private static final String EXTRA_TRANSLUCENT_BACKGROUND =
|
||||
"androidx.browser.customtabs.extra.TRANSLUCENT_BACKGROUND";
|
||||
|
||||
@IntDef({
|
||||
CustomTabsButtonState.BUTTON_STATE_OFF,
|
||||
CustomTabsButtonState.BUTTON_STATE_ON,
|
||||
@@ -432,13 +441,15 @@ public class CustomTabIntentDataProvider extends BrowserServicesIntentDataProvid
|
||||
int initialActivityWidth =
|
||||
getInitialActivityWidth(
|
||||
isTrustedCustomTab, getInitialActivityWidthFromIntent(intent), packageName);
|
||||
if (initialActivityHeight <= 0 && initialActivityWidth <= 0) {
|
||||
// fallback to normal Custom Tab.
|
||||
return;
|
||||
|
||||
// When scrolling up the web content, we don't want to hide the URL bar in pCCT.
|
||||
boolean isPcct = initialActivityHeight > 0 || initialActivityWidth > 0;
|
||||
if (isPcct) {
|
||||
intent.putExtra(CustomTabsIntent.EXTRA_ENABLE_URLBAR_HIDING, false);
|
||||
}
|
||||
if (isPcct || hasTranslucentBackgroundColor(intent)) {
|
||||
intent.setClassName(context, TranslucentCustomTabActivity.class.getName());
|
||||
}
|
||||
intent.setClassName(context, TranslucentCustomTabActivity.class.getName());
|
||||
// When scrolling up the web content, we don't want to hide the URL bar.
|
||||
intent.putExtra(CustomTabsIntent.EXTRA_ENABLE_URLBAR_HIDING, false);
|
||||
}
|
||||
|
||||
private static @Px int getInitialActivityHeight(
|
||||
@@ -498,6 +509,26 @@ public class CustomTabIntentDataProvider extends BrowserServicesIntentDataProvid
|
||||
: roundedCornersPosition;
|
||||
}
|
||||
|
||||
private static boolean hasTranslucentBackgroundColor(Intent intent) {
|
||||
try {
|
||||
return intent.hasExtra(EXTRA_TRANSLUCENT_BACKGROUND);
|
||||
} catch (Throwable t) {
|
||||
// Catches un-parceling exceptions.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public @ColorInt int getTranslucentBackgroundColor(Context context) {
|
||||
int defValue = SemanticColorUtils.getDefaultBgColor(context);
|
||||
int bg = IntentUtils.safeGetIntExtra(mIntent, EXTRA_TRANSLUCENT_BACKGROUND, defValue);
|
||||
if (bg == defValue) return defValue;
|
||||
|
||||
// We limit the transparency to 30%-50% == 50%-70% (128-180) alpha
|
||||
int alpha = MathUtils.clamp(Color.alpha(bg), 128, 180);
|
||||
return Color.argb(alpha, Color.red(bg), Color.green(bg), Color.blue(bg));
|
||||
}
|
||||
|
||||
private static boolean getIsCloseButtonEnabled(Intent intent, int uiType) {
|
||||
return IntentUtils.safeGetBooleanExtra(intent, EXTRA_CLOSE_BUTTON_ENABLED, true)
|
||||
&& uiType != CustomTabsUiType.POPUP;
|
||||
@@ -1956,4 +1987,12 @@ public class CustomTabIntentDataProvider extends BrowserServicesIntentDataProvid
|
||||
}
|
||||
return new WindowFeatures(bundle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void maybeAddAdditionalContentExtrasToOutboundIntent(
|
||||
Supplier<@Nullable Tab> tabProvider, Intent outboundIntent, int viewId) {
|
||||
CustomTabsConnection.getInstance()
|
||||
.maybeAddAdditionalContentExtrasToOutboundIntent(
|
||||
tabProvider, this, outboundIntent, viewId);
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+22
-16
@@ -42,7 +42,8 @@
|
||||
#include "chrome/browser/crash_upload_list/crash_upload_list.h"
|
||||
#include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h"
|
||||
#include "chrome/browser/domain_reliability/service_factory.h"
|
||||
#include "chrome/browser/downgrade/user_data_downgrade.h"
|
||||
#include "chrome/browser/downgrade/snapshot_file_collector.h"
|
||||
#include "chrome/browser/downgrade/user_data_downgrade.h" // nogncheck
|
||||
#include "chrome/browser/download/download_prefs.h"
|
||||
#include "chrome/browser/external_protocol/external_protocol_handler.h"
|
||||
#include "chrome/browser/file_system_access/chrome_file_system_access_permission_context.h"
|
||||
@@ -57,8 +58,8 @@
|
||||
#include "chrome/browser/media/webrtc/webrtc_event_log_manager.h"
|
||||
#include "chrome/browser/optimization_guide/optimization_guide_keyed_service.h"
|
||||
#include "chrome/browser/optimization_guide/optimization_guide_keyed_service_factory.h"
|
||||
#include "chrome/browser/password_manager/account_password_store_factory.h"
|
||||
#include "chrome/browser/password_manager/profile_password_store_factory.h"
|
||||
#include "chrome/browser/password_manager/factories/account_password_store_factory.h"
|
||||
#include "chrome/browser/password_manager/factories/profile_password_store_factory.h"
|
||||
#include "chrome/browser/payments/browser_binding/browser_bound_key_deleter_service.h"
|
||||
#include "chrome/browser/payments/browser_binding/browser_bound_key_deleter_service_factory.h"
|
||||
#include "chrome/browser/permissions/permission_actions_history_factory.h"
|
||||
@@ -81,7 +82,6 @@
|
||||
#include "chrome/browser/spellchecker/spellcheck_service.h"
|
||||
#include "chrome/browser/strike_database/strike_database_factory.h"
|
||||
#include "chrome/browser/sync/sync_service_factory.h"
|
||||
#include "chrome/browser/tpcd/metadata/manager_factory.h"
|
||||
#include "chrome/browser/translate/chrome_translate_client.h"
|
||||
#include "chrome/browser/ui/find_bar/find_bar_state.h"
|
||||
#include "chrome/browser/ui/find_bar/find_bar_state_factory.h"
|
||||
@@ -143,7 +143,6 @@
|
||||
#include "components/strike_database/strike_database.h"
|
||||
#include "components/sync/service/sync_service.h"
|
||||
#include "components/sync/service/sync_user_settings.h"
|
||||
#include "components/tpcd/metadata/browser/manager.h"
|
||||
#include "components/web_cache/browser/web_cache_manager.h"
|
||||
#include "components/webrtc_logging/browser/log_cleanup.h"
|
||||
#include "components/webrtc_logging/browser/text_log_list.h"
|
||||
@@ -200,14 +199,11 @@
|
||||
#endif // !BUILDFLAG(IS_ANDROID)
|
||||
|
||||
#if BUILDFLAG(ENABLE_EXTENSIONS_CORE)
|
||||
#include "chrome/browser/extensions/activity_log/activity_log.h"
|
||||
#include "extensions/browser/extension_prefs.h"
|
||||
#include "extensions/common/constants.h"
|
||||
#endif // BUILDFLAG(ENABLE_EXTENSIONS_CORE)
|
||||
|
||||
#if BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
#include "chrome/browser/extensions/activity_log/activity_log.h"
|
||||
#endif // BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
#include "chrome/browser/ash/net/system_proxy_manager.h"
|
||||
#include "chrome/browser/ash/profiles/profile_helper.h"
|
||||
@@ -433,7 +429,7 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
|
||||
language_histogram->ClearHistory(delete_begin_, delete_end_);
|
||||
}
|
||||
|
||||
#if BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
#if BUILDFLAG(ENABLE_EXTENSIONS_CORE)
|
||||
// The extension activity log contains details of which websites extensions
|
||||
// were active on. It therefore indirectly stores details of websites a
|
||||
// user has visited so best clean from here as well.
|
||||
@@ -651,11 +647,6 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
|
||||
privacy_sandbox_settings->OnCookiesCleared();
|
||||
}
|
||||
|
||||
if (tpcd::metadata::Manager* manager =
|
||||
tpcd::metadata::ManagerFactory::GetForProfile(profile_)) {
|
||||
manager->ResetCohorts();
|
||||
}
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
Java_PackageHash_onCookiesDeleted(base::android::AttachCurrentThread(),
|
||||
profile_->GetJavaObject());
|
||||
@@ -1367,10 +1358,25 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Remove data for this profile contained in any snapshots.
|
||||
if (remove_mask && filter_builder->MatchesMostOriginsAndDomains()) {
|
||||
bool delete_all =
|
||||
(((remove_mask & chrome_browsing_data_remover::WIPE_PROFILE) ==
|
||||
chrome_browsing_data_remover::WIPE_PROFILE) ||
|
||||
((remove_mask & chrome_browsing_data_remover::ALL_DATA_TYPES) ==
|
||||
chrome_browsing_data_remover::ALL_DATA_TYPES)) &&
|
||||
delete_begin_.is_null();
|
||||
std::optional<std::vector<base::FilePath>> files_to_delete;
|
||||
if (!delete_all) {
|
||||
files_to_delete.emplace();
|
||||
for (const auto& item : downgrade::CollectProfileItems()) {
|
||||
if (item.data_types & remove_mask) {
|
||||
files_to_delete->push_back(item.path);
|
||||
}
|
||||
}
|
||||
}
|
||||
base::ThreadPool::PostTaskAndReply(
|
||||
FROM_HERE, {base::TaskPriority::USER_VISIBLE, base::MayBlock()},
|
||||
base::BindOnce(&downgrade::RemoveDataForProfile, delete_begin_,
|
||||
profile_->GetPath(), remove_mask),
|
||||
profile_->GetPath(), std::move(files_to_delete)),
|
||||
CreateTaskCompletionClosure(TracingDataType::kUserDataSnapshot));
|
||||
}
|
||||
#endif // BUILDFLAG(ENABLE_DOWNGRADE_PROCESSING)
|
||||
|
||||
@@ -109,6 +109,7 @@
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
#include "chrome/browser/apps/digital_goods/digital_goods_factory_impl.h"
|
||||
#include "chrome/browser/speech/cros_speech_recognition_service_factory.h"
|
||||
#include "chromeos/ash/experiences/isolated_web_app/isolated_web_app_api_bridge_impl.h"
|
||||
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||
|
||||
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \
|
||||
@@ -517,6 +518,8 @@ void PopulateChromeFrameBinders(
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
map->Add<payments::mojom::DigitalGoodsFactory>(
|
||||
&apps::DigitalGoodsFactoryImpl::BindDigitalGoodsFactory);
|
||||
map->Add<blink::mojom::IsolatedWebAppApiBridge>(
|
||||
&ash::IsolatedWebAppApiBridgeImpl::Create);
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "base/containers/fixed_flat_set.h"
|
||||
#include "base/containers/to_vector.h"
|
||||
#include "base/dcheck_is_on.h"
|
||||
#include "base/feature_list.h"
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/functional/callback.h"
|
||||
@@ -72,6 +73,9 @@
|
||||
#include "chrome/browser/chrome_content_browser_client_parts.h"
|
||||
#include "chrome/browser/content_settings/cookie_settings_factory.h"
|
||||
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
|
||||
#include "chrome/browser/contextual_tasks/contextual_tasks_ui_service.h"
|
||||
#include "chrome/browser/contextual_tasks/contextual_tasks_ui_service_factory.h"
|
||||
#include "chrome/browser/contextual_tasks/contextual_tasks_url_loader_factory_interceptor.h"
|
||||
#include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h"
|
||||
#include "chrome/browser/data_saver/data_saver.h"
|
||||
#include "chrome/browser/defaults.h"
|
||||
@@ -95,6 +99,8 @@
|
||||
#include "chrome/browser/lifetime/browser_shutdown.h"
|
||||
#include "chrome/browser/loader/keep_alive_request_tracker.h"
|
||||
#include "chrome/browser/media/audio_service_util.h"
|
||||
#include "chrome/browser/media/autoplay_policy_status_observer.h"
|
||||
#include "chrome/browser/media/media_engagement_service.h"
|
||||
#include "chrome/browser/media/prefs/capture_device_ranking.h"
|
||||
#include "chrome/browser/media/router/media_router_feature.h"
|
||||
#include "chrome/browser/media/unified_autoplay_config.h"
|
||||
@@ -172,10 +178,10 @@
|
||||
#include "chrome/browser/ui/blocked_content/chrome_popup_navigation_delegate.h"
|
||||
#include "chrome/browser/ui/browser_navigator.h"
|
||||
#include "chrome/browser/ui/browser_navigator_params.h"
|
||||
#include "chrome/browser/ui/chrome_select_file_policy.h"
|
||||
#include "chrome/browser/ui/color/chrome_color_id.h"
|
||||
#include "chrome/browser/ui/login/http_auth_coordinator.h"
|
||||
#include "chrome/browser/ui/prefs/pref_watcher.h"
|
||||
#include "chrome/browser/ui/select_file_policy/chrome_select_file_policy.h"
|
||||
#include "chrome/browser/ui/startup/google_chrome_scheme_util.h"
|
||||
#include "chrome/browser/ui/tab_contents/chrome_web_contents_view_delegate.h"
|
||||
#include "chrome/browser/ui/ui_features.h"
|
||||
@@ -227,6 +233,7 @@
|
||||
#include "components/content_settings/core/common/content_settings_types.h"
|
||||
#include "components/content_settings/core/common/cookie_settings_base.h"
|
||||
#include "components/contextual_tasks/public/features.h"
|
||||
#include "components/contextual_tasks/public/utils.h"
|
||||
#include "components/custom_handlers/protocol_handler_registry.h"
|
||||
#include "components/custom_handlers/protocol_handler_throttle.h"
|
||||
#include "components/dom_distiller/core/dom_distiller_switches.h"
|
||||
@@ -245,6 +252,7 @@
|
||||
#include "components/error_page/common/localized_error.h"
|
||||
#include "components/google/core/common/google_switches.h"
|
||||
#include "components/google/core/common/google_util.h"
|
||||
#include "components/guest_view/browser/guest_view_base.h"
|
||||
#include "components/guest_view/buildflags/buildflags.h"
|
||||
#include "components/heap_profiling/in_process/heap_profiler_controller.h"
|
||||
#include "components/keep_alive_registry/keep_alive_types.h"
|
||||
@@ -298,6 +306,7 @@
|
||||
#include "components/safe_browsing/core/common/features.h"
|
||||
#include "components/safe_browsing/core/common/hashprefix_realtime/hash_realtime_utils.h"
|
||||
#include "components/safe_browsing/core/common/safe_browsing_prefs.h"
|
||||
#include "components/search_engines/search_engines_switches.h"
|
||||
#include "components/search_engines/template_url_service.h"
|
||||
#include "components/security_state/core/security_state.h"
|
||||
#include "components/site_isolation/features.h"
|
||||
@@ -337,6 +346,7 @@
|
||||
#include "content/public/browser/permission_descriptor_util.h"
|
||||
#include "content/public/browser/render_frame_host.h"
|
||||
#include "content/public/browser/render_process_host.h"
|
||||
#include "content/public/browser/security_principal.h"
|
||||
#include "content/public/browser/service_worker_context.h"
|
||||
#include "content/public/browser/site_isolation_mode.h"
|
||||
#include "content/public/browser/site_isolation_policy.h"
|
||||
@@ -360,6 +370,7 @@
|
||||
#include "device/vr/buildflags/buildflags.h"
|
||||
#include "extensions/browser/browser_frame_context_data.h"
|
||||
#include "extensions/buildflags/buildflags.h"
|
||||
#include "extensions/common/extension_features.h"
|
||||
#include "extensions/common/switches.h"
|
||||
#include "google_apis/gaia/gaia_urls.h"
|
||||
#include "google_apis/google_api_keys.h"
|
||||
@@ -371,6 +382,7 @@
|
||||
#include "media/mojo/mojom/speech_recognizer.mojom.h"
|
||||
#include "mojo/public/cpp/bindings/remote.h"
|
||||
#include "net/base/data_url.h"
|
||||
#include "net/base/url_util.h"
|
||||
#include "net/cookies/cookie_setting_override.h"
|
||||
#include "net/cookies/site_for_cookies.h"
|
||||
#include "net/ssl/client_cert_store.h"
|
||||
@@ -405,7 +417,6 @@
|
||||
#include "third_party/blink/public/mojom/navigation/navigation_params.mojom.h"
|
||||
#include "third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom.h"
|
||||
#include "third_party/blink/public/public_buildflags.h"
|
||||
#include "third_party/widevine/cdm/buildflags.h"
|
||||
#include "ui/base/clipboard/clipboard_format_type.h"
|
||||
#include "ui/base/clipboard/clipboard_metadata.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
@@ -466,6 +477,7 @@
|
||||
#include "chrome/browser/ash/fileapi/file_system_backend.h"
|
||||
#include "chrome/browser/ash/fileapi/mtp_file_system_backend_delegate.h"
|
||||
#include "chrome/browser/ash/login/signin_partition_manager.h"
|
||||
#include "chrome/browser/ash/login/signin_partition_manager_factory.h"
|
||||
#include "chrome/browser/ash/login/startup_utils.h"
|
||||
#include "chrome/browser/ash/net/network_health/network_health_manager.h"
|
||||
#include "chrome/browser/ash/net/system_proxy_manager.h"
|
||||
@@ -520,9 +532,6 @@
|
||||
#include "chrome/browser/actor/actor_features.h"
|
||||
#include "chrome/browser/actor/actor_keyed_service.h"
|
||||
#include "chrome/browser/actor/actor_keyed_service_factory.h"
|
||||
#include "chrome/browser/contextual_tasks/contextual_tasks_ui_service.h"
|
||||
#include "chrome/browser/contextual_tasks/contextual_tasks_ui_service_factory.h"
|
||||
#include "chrome/browser/contextual_tasks/contextual_tasks_url_loader_factory_interceptor.h"
|
||||
#include "chrome/browser/devtools/chrome_devtools_manager_delegate.h"
|
||||
#include "chrome/browser/devtools/devtools_window.h"
|
||||
#include "chrome/browser/digital_credentials/digital_identity_provider_desktop.h"
|
||||
@@ -539,6 +548,7 @@
|
||||
#include "chrome/browser/ui/browser.h"
|
||||
#include "chrome/browser/ui/browser_finder.h"
|
||||
#include "chrome/browser/ui/browser_list.h"
|
||||
#include "chrome/browser/ui/browser_window/public/browser_window_interface.h"
|
||||
#include "chrome/browser/ui/chrome_pages.h"
|
||||
#include "chrome/browser/ui/dialogs/browser_dialogs.h"
|
||||
#include "chrome/browser/ui/tabs/tab_strip_model.h"
|
||||
@@ -548,7 +558,6 @@
|
||||
#include "chrome/browser/web_applications/isolated_web_apps/chrome_content_browser_client_isolated_web_apps_part.h"
|
||||
#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_error_page.h"
|
||||
#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_url_info.h"
|
||||
#include "chrome/browser/web_applications/isolated_web_apps/iwa_permissions_policy_cache.h"
|
||||
#include "chrome/browser/web_applications/isolated_web_apps/policy/isolated_web_app_policy_manager.h"
|
||||
#include "chrome/browser/web_applications/locks/app_lock.h"
|
||||
#include "chrome/browser/web_applications/policy/web_app_policy_manager.h"
|
||||
@@ -567,7 +576,6 @@
|
||||
#include "components/password_manager/content/common/web_ui_constants.h"
|
||||
#include "components/password_manager/core/common/password_manager_features.h"
|
||||
#include "components/soda/soda_util.h"
|
||||
#include "components/webapps/isolated_web_apps/types/iwa_origin.h"
|
||||
#include "components/webapps/isolated_web_apps/url_loading/url_loader_factory.h"
|
||||
#include "services/network/public/mojom/permissions_policy/permissions_policy_feature.mojom.h"
|
||||
#include "third_party/blink/public/mojom/installedapp/related_application.mojom.h"
|
||||
@@ -628,8 +636,10 @@
|
||||
#include "extensions/common/extension.h"
|
||||
#include "extensions/common/extension_set.h"
|
||||
#include "extensions/common/manifest_handlers/background_info.h"
|
||||
#include "extensions/common/mojom/context_type.mojom.h"
|
||||
#include "extensions/common/permissions/permissions_data.h"
|
||||
#include "extensions/common/switches.h"
|
||||
#include "extensions/common/user_script.h"
|
||||
|
||||
#if BUILDFLAG(ENABLE_GUEST_VIEW)
|
||||
#include "extensions/browser/guest_view/web_view/web_view_guest.h"
|
||||
@@ -637,13 +647,14 @@
|
||||
#include "extensions/browser/guest_view/web_view/web_view_renderer_state.h"
|
||||
#endif
|
||||
|
||||
#else // !BUILDFLAG(ENABLE_EXTENSIONS_CORE)
|
||||
#elif BUILDFLAG(ENABLE_GUEST_VIEW)
|
||||
#include "components/guest_view/browser/guest_view_base.h"
|
||||
#include "components/guest_view/browser/slim_web_view/slim_web_view_url_loader_factory_interceptor.h" // nogncheck
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
#include "chrome/browser/android/guest_view/chrome_content_browser_client_guest_view_part.h"
|
||||
#endif
|
||||
#if BUILDFLAG(ENABLE_GUEST_VIEW)
|
||||
#include "components/guest_view/browser/slim_web_view/slim_web_view_url_loader_factory_interceptor.h" // nogncheck
|
||||
#endif
|
||||
|
||||
#endif // BUILDFLAG(ENABLE_EXTENSIONS_CORE)
|
||||
|
||||
#if BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
@@ -653,7 +664,6 @@
|
||||
#include "chrome/browser/ui/web_applications/app_browser_controller.h"
|
||||
#include "chrome/browser/web_applications/web_app_utils.h"
|
||||
#include "extensions/browser/api/web_request/web_request_proxying_webtransport.h"
|
||||
#include "extensions/common/user_script.h"
|
||||
#endif // BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
|
||||
#if BUILDFLAG(ENABLE_PLUGINS)
|
||||
@@ -893,11 +903,17 @@ bool IsAutoplayAllowedByPolicy(content::WebContents* contents,
|
||||
blink::mojom::AutoplayPolicy DetermineWebContentsAutoplayPolicy(
|
||||
content::WebContents* web_contents,
|
||||
blink::mojom::AutoplayPolicy current_policy) {
|
||||
using PolicyStatus = AutoplayPolicyStatusObserver::PolicyStatus;
|
||||
|
||||
Profile* profile =
|
||||
Profile::FromBrowserContext(web_contents->GetBrowserContext());
|
||||
PrefService* prefs = profile->GetPrefs();
|
||||
|
||||
AutoplayPolicyStatusObserver* observer =
|
||||
AutoplayPolicyStatusObserver::GetOrCreateForWebContents(web_contents);
|
||||
|
||||
if (IsAutoplayAllowedByPolicy(web_contents, prefs)) {
|
||||
observer->SetPolicyStatus(PolicyStatus::kAllowedByEnterprisePolicy);
|
||||
return blink::mojom::AutoplayPolicy::kNoUserGestureRequired;
|
||||
}
|
||||
|
||||
@@ -906,9 +922,13 @@ blink::mojom::AutoplayPolicy DetermineWebContentsAutoplayPolicy(
|
||||
if (base::FeatureList::IsEnabled(media::kAutoplayDisableSettings) &&
|
||||
current_policy ==
|
||||
blink::mojom::AutoplayPolicy::kDocumentUserActivationRequired) {
|
||||
return UnifiedAutoplayConfig::ShouldBlockAutoplay(profile)
|
||||
? blink::mojom::AutoplayPolicy::kDocumentUserActivationRequired
|
||||
: blink::mojom::AutoplayPolicy::kNoUserGestureRequired;
|
||||
if (UnifiedAutoplayConfig::ShouldBlockAutoplay(profile)) {
|
||||
observer->SetPolicyStatus(PolicyStatus::kBlockedByUserPreference);
|
||||
return blink::mojom::AutoplayPolicy::kDocumentUserActivationRequired;
|
||||
} else {
|
||||
observer->SetPolicyStatus(PolicyStatus::kAllowedByUserPreference);
|
||||
return blink::mojom::AutoplayPolicy::kNoUserGestureRequired;
|
||||
}
|
||||
}
|
||||
|
||||
// If the domain policy allows autoplay and has delegated that to an iframe,
|
||||
@@ -916,15 +936,19 @@ blink::mojom::AutoplayPolicy DetermineWebContentsAutoplayPolicy(
|
||||
if (web_contents->GetPrimaryMainFrame()->IsFeatureEnabled(
|
||||
network::mojom::PermissionsPolicyFeature::kAutoplay) &&
|
||||
IsAutoplayAllowedByPolicy(web_contents->GetOuterWebContents(), prefs)) {
|
||||
observer->SetPolicyStatus(
|
||||
PolicyStatus::kAllowedByDelegatedEnterprisePolicy);
|
||||
return blink::mojom::AutoplayPolicy::kNoUserGestureRequired;
|
||||
}
|
||||
|
||||
// Allow Autoplay if the user provided mic/cam access. This is for cases such
|
||||
// as received-video-call rings occurring before the user interacted with the
|
||||
// page.
|
||||
if (base::FeatureList::IsEnabled(media::kAutoplayBypassForMicCamera)) {
|
||||
const HostContentSettingsMap* const content_settings =
|
||||
HostContentSettingsMapFactory::GetForProfile(profile);
|
||||
// page. If there is no content_settings, we cannot provide autoplay (e.g.
|
||||
// System profile).
|
||||
const HostContentSettingsMap* const content_settings =
|
||||
HostContentSettingsMapFactory::GetForProfile(profile);
|
||||
if (content_settings &&
|
||||
base::FeatureList::IsEnabled(media::kAutoplayBypassForMicCamera)) {
|
||||
const GURL& url = web_contents->GetLastCommittedURL();
|
||||
|
||||
if (content_settings->GetContentSetting(
|
||||
@@ -933,6 +957,7 @@ blink::mojom::AutoplayPolicy DetermineWebContentsAutoplayPolicy(
|
||||
content_settings->GetContentSetting(
|
||||
url, url, ContentSettingsType::MEDIASTREAM_CAMERA) ==
|
||||
CONTENT_SETTING_ALLOW) {
|
||||
observer->SetPolicyStatus(PolicyStatus::kAllowedByMicCameraPermission);
|
||||
return blink::mojom::AutoplayPolicy::kNoUserGestureRequired;
|
||||
}
|
||||
}
|
||||
@@ -942,12 +967,29 @@ blink::mojom::AutoplayPolicy DetermineWebContentsAutoplayPolicy(
|
||||
if (base::FeatureList::IsEnabled(features::kAllowUnmutedAutoplayForTWA)) {
|
||||
if (auto* delegate = TabAndroid::FromWebContents(web_contents)) {
|
||||
if (delegate->IsTrustedWebActivity()) {
|
||||
observer->SetPolicyStatus(PolicyStatus::kAllowedByTWA);
|
||||
return blink::mojom::AutoplayPolicy::kNoUserGestureRequired;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
|
||||
if (MediaEngagementService::IsEnabled()) {
|
||||
MediaEngagementService* mei_service = MediaEngagementService::Get(profile);
|
||||
if (mei_service && mei_service->HasHighEngagement(url::Origin::Create(
|
||||
web_contents->GetLastCommittedURL()))) {
|
||||
if (base::FeatureList::IsEnabled(
|
||||
media::kMediaEngagementBypassAutoplayPolicies)) {
|
||||
observer->SetPolicyStatus(PolicyStatus::kAllowedByMediaEngagement);
|
||||
} else {
|
||||
observer->SetPolicyStatus(
|
||||
PolicyStatus::kWouldBeAllowedByMediaEngagement);
|
||||
}
|
||||
return current_policy;
|
||||
}
|
||||
}
|
||||
|
||||
observer->SetPolicyStatus(PolicyStatus::kDefaultPolicyApplied);
|
||||
return current_policy;
|
||||
}
|
||||
|
||||
@@ -1452,7 +1494,7 @@ ChromeContentBrowserClient::ChromeContentBrowserClient() {
|
||||
#if BUILDFLAG(ENABLE_EXTENSIONS_CORE)
|
||||
extra_parts_.push_back(
|
||||
std::make_unique<ChromeContentBrowserClientExtensionsPart>());
|
||||
#elif BUILDFLAG(IS_ANDROID)
|
||||
#elif BUILDFLAG(ENABLE_GUEST_VIEW) && BUILDFLAG(IS_ANDROID)
|
||||
extra_parts_.push_back(
|
||||
std::make_unique<android::ChromeContentBrowserClientGuestViewPart>());
|
||||
#endif
|
||||
@@ -1586,6 +1628,8 @@ void ChromeContentBrowserClient::RegisterProfilePrefs(
|
||||
|
||||
registry->RegisterBooleanPref(prefs::kWebAudioOutputBufferingEnabled, false);
|
||||
registry->RegisterBooleanPref(prefs::kSharedWorkerBlobURLFixEnabled, true);
|
||||
registry->RegisterBooleanPref(prefs::kSharedWorkerExtendedLifetimeEnabled,
|
||||
true);
|
||||
registry->RegisterBooleanPref(
|
||||
prefs::kServiceWorkerToControlSrcdocIframeEnabled, true);
|
||||
registry->RegisterBooleanPref(prefs::kReduceAcceptLanguageEnabled, true);
|
||||
@@ -2218,8 +2262,12 @@ bool ChromeContentBrowserClient::HasWebRequestAPIProxy(
|
||||
browser_context);
|
||||
if (!web_request_api) {
|
||||
return false;
|
||||
} else {
|
||||
// TODO(crbug.com/362539771): Check if the request is from guest view and
|
||||
// use HasWebRequestOrDeclarativeWebRequestExtension() instead of using
|
||||
// MayHaveProxies().
|
||||
return web_request_api->MayHaveProxies();
|
||||
}
|
||||
return web_request_api && web_request_api->MayHaveProxies();
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
@@ -2369,31 +2417,9 @@ ChromeContentBrowserClient::GetBaselinePermissionsPolicyForIsolatedApp(
|
||||
content::BrowserContext* browser_context,
|
||||
const url::Origin& app_origin) {
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
Profile* profile = Profile::FromBrowserContext(browser_context);
|
||||
web_app::IwaPermissionsPolicyCache* cache =
|
||||
web_app::IwaPermissionsPolicyCacheFactory::GetForProfile(profile);
|
||||
if (!cache) {
|
||||
return {};
|
||||
}
|
||||
|
||||
ASSIGN_OR_RETURN(
|
||||
web_app::IwaOrigin origin,
|
||||
web_app::IwaOrigin::Create(app_origin.GetURL()), [](auto) {
|
||||
return std::vector<blink::mojom::IsolatedAppPermissionPolicyEntryPtr>();
|
||||
});
|
||||
|
||||
const web_app::IwaPermissionsPolicyCache::CacheEntry* policy =
|
||||
cache->GetPolicy(origin);
|
||||
if (!policy) {
|
||||
// If we can't calculate a baseline permissions policy for a valid IWA
|
||||
// origin for some reason, use a strict fallback.
|
||||
return {};
|
||||
}
|
||||
|
||||
return base::ToVector(*policy, [](const auto& entry) {
|
||||
return blink::mojom::IsolatedAppPermissionPolicyEntry::New(
|
||||
entry.feature, entry.allowed_origins);
|
||||
});
|
||||
return ChromeContentBrowserClientIsolatedWebAppsPart::
|
||||
GetBaselinePermissionsPolicyForIsolatedWebApp(browser_context,
|
||||
app_origin);
|
||||
#else
|
||||
return {};
|
||||
#endif
|
||||
@@ -3312,6 +3338,14 @@ bool ChromeContentBrowserClient::AllowSharedWorkerBlobURLFix(
|
||||
return profile->GetPrefs()->GetBoolean(prefs::kSharedWorkerBlobURLFixEnabled);
|
||||
}
|
||||
|
||||
bool ChromeContentBrowserClient::AllowSharedWorkerExtendedLifetime(
|
||||
content::BrowserContext* browser_context) {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
Profile* profile = Profile::FromBrowserContext(browser_context);
|
||||
return profile->GetPrefs()->GetBoolean(
|
||||
prefs::kSharedWorkerExtendedLifetimeEnabled);
|
||||
}
|
||||
|
||||
void ChromeContentBrowserClient::RequestFilesAccess(
|
||||
const std::vector<base::FilePath>& files,
|
||||
const GURL& destination_url,
|
||||
@@ -3451,40 +3485,6 @@ bool ChromeContentBrowserClient::AllowWorkerWebLocks(
|
||||
storage_key);
|
||||
}
|
||||
|
||||
ChromeContentBrowserClient::AllowWebBluetoothResult
|
||||
ChromeContentBrowserClient::AllowWebBluetooth(
|
||||
content::BrowserContext* browser_context,
|
||||
const url::Origin& requesting_origin,
|
||||
const url::Origin& embedding_origin) {
|
||||
// TODO(crbug.com/40462828): Don't disable if
|
||||
// base::CommandLine::ForCurrentProcess()->
|
||||
// HasSwitch(switches::kEnableWebBluetooth) is true.
|
||||
if (base::GetFieldTrialParamValue(
|
||||
permissions::ContentSettingPermissionContextBase::
|
||||
kPermissionsKillSwitchFieldStudy,
|
||||
"Bluetooth") == permissions::ContentSettingPermissionContextBase::
|
||||
kPermissionsKillSwitchBlockedValue) {
|
||||
// The kill switch is enabled for this permission. Block requests.
|
||||
return AllowWebBluetoothResult::BLOCK_GLOBALLY_DISABLED;
|
||||
}
|
||||
|
||||
const HostContentSettingsMap* const content_settings =
|
||||
HostContentSettingsMapFactory::GetForProfile(
|
||||
Profile::FromBrowserContext(browser_context));
|
||||
|
||||
if (content_settings->GetContentSetting(
|
||||
requesting_origin.GetURL(), embedding_origin.GetURL(),
|
||||
ContentSettingsType::BLUETOOTH_GUARD) == CONTENT_SETTING_BLOCK) {
|
||||
return AllowWebBluetoothResult::BLOCK_POLICY;
|
||||
}
|
||||
return AllowWebBluetoothResult::ALLOW;
|
||||
}
|
||||
|
||||
std::string ChromeContentBrowserClient::GetWebBluetoothBlocklist() {
|
||||
return base::GetFieldTrialParamValue("WebBluetoothBlocklist",
|
||||
"blocklist_additions");
|
||||
}
|
||||
|
||||
bool ChromeContentBrowserClient::IsInterestGroupAPIAllowed(
|
||||
content::BrowserContext* browser_context,
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
@@ -3698,25 +3698,6 @@ bool ChromeContentBrowserClient::IsSharedStorageSelectURLAllowed(
|
||||
out_block_is_site_setting_specific);
|
||||
}
|
||||
|
||||
bool ChromeContentBrowserClient::IsFencedStorageReadAllowed(
|
||||
content::BrowserContext* browser_context,
|
||||
content::RenderFrameHost* rfh,
|
||||
const url::Origin& top_frame_origin,
|
||||
const url::Origin& accessing_origin) {
|
||||
Profile* profile = Profile::FromBrowserContext(browser_context);
|
||||
auto* privacy_sandbox_settings =
|
||||
PrivacySandboxSettingsFactory::GetForProfile(profile);
|
||||
DCHECK(privacy_sandbox_settings);
|
||||
bool allowed = privacy_sandbox_settings->IsFencedStorageReadAllowed(
|
||||
top_frame_origin, accessing_origin, rfh);
|
||||
if (rfh) {
|
||||
content_settings::PageSpecificContentSettings::BrowsingDataAccessed(
|
||||
rfh, blink::StorageKey::CreateFirstParty(accessing_origin),
|
||||
BrowsingDataModel::StorageType::kSharedStorage, !allowed);
|
||||
}
|
||||
return allowed;
|
||||
}
|
||||
|
||||
bool ChromeContentBrowserClient::IsPrivateAggregationAllowed(
|
||||
content::BrowserContext* browser_context,
|
||||
const url::Origin& top_frame_origin,
|
||||
@@ -3803,24 +3784,6 @@ bool ChromeContentBrowserClient::IsServiceWorkerSyntheticResponseAllowed(
|
||||
return true;
|
||||
}
|
||||
|
||||
void ChromeContentBrowserClient::GrantCookieAccessDueToHeuristic(
|
||||
content::BrowserContext* browser_context,
|
||||
const net::SchemefulSite& top_frame_site,
|
||||
const net::SchemefulSite& accessing_site,
|
||||
base::TimeDelta ttl,
|
||||
bool ignore_schemes) {
|
||||
scoped_refptr<content_settings::CookieSettings> cookie_settings =
|
||||
CookieSettingsFactory::GetForProfile(
|
||||
Profile::FromBrowserContext(browser_context));
|
||||
if (!cookie_settings) {
|
||||
return;
|
||||
}
|
||||
|
||||
cookie_settings->SetTemporaryCookieGrantForHeuristic(
|
||||
accessing_site.GetURL(), top_frame_site.GetURL(), ttl,
|
||||
/*use_schemeless_patterns=*/ignore_schemes);
|
||||
}
|
||||
|
||||
bool ChromeContentBrowserClient::AreThirdPartyCookiesGenerallyAllowed(
|
||||
content::BrowserContext* browser_context,
|
||||
content::WebContents* web_contents) {
|
||||
@@ -4115,26 +4078,28 @@ blink::mojom::PreferredColorScheme ToBlinkPreferredColorScheme(
|
||||
std::tuple<blink::mojom::PreferredColorScheme,
|
||||
blink::mojom::PreferredColorScheme>
|
||||
GetPreferredColorScheme(const WebPreferences& web_prefs,
|
||||
const GURL& url,
|
||||
const content::SecurityPrincipal& security_principal,
|
||||
WebContents* web_contents) {
|
||||
blink::mojom::PreferredColorScheme preferred_color_scheme;
|
||||
blink::mojom::PreferredColorScheme preferred_root_scrollbar_color_scheme;
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
preferred_color_scheme = web_prefs.preferred_color_scheme;
|
||||
preferred_root_scrollbar_color_scheme =
|
||||
web_prefs.preferred_root_scrollbar_color_scheme;
|
||||
|
||||
if (TabAndroid::FromWebContents(web_contents)) {
|
||||
if (auto* delegate = static_cast<android::TabWebContentsDelegateAndroid*>(
|
||||
web_contents->GetDelegate())) {
|
||||
const auto preferred_color_scheme =
|
||||
delegate->IsNightModeEnabled()
|
||||
? blink::mojom::PreferredColorScheme::kDark
|
||||
: blink::mojom::PreferredColorScheme::kLight;
|
||||
return {preferred_color_scheme, preferred_color_scheme};
|
||||
preferred_color_scheme = delegate->IsNightModeEnabled()
|
||||
? blink::mojom::PreferredColorScheme::kDark
|
||||
: blink::mojom::PreferredColorScheme::kLight;
|
||||
preferred_root_scrollbar_color_scheme = preferred_color_scheme;
|
||||
}
|
||||
}
|
||||
return {web_prefs.preferred_color_scheme,
|
||||
web_prefs.preferred_root_scrollbar_color_scheme};
|
||||
#else
|
||||
blink::mojom::PreferredColorScheme preferred_color_scheme;
|
||||
#else // !BUILDFLAG(IS_ANDROID)
|
||||
if (Profile::FromBrowserContext(web_contents->GetBrowserContext())
|
||||
->IsIncognitoProfile() &&
|
||||
!content::HasWebUIScheme(url)) {
|
||||
!security_principal.IsWebUI()) {
|
||||
// Incognito contents follow the device color mode.
|
||||
preferred_color_scheme = ToBlinkPreferredColorScheme(
|
||||
ui::NativeTheme::GetInstanceForWeb()->preferred_color_scheme());
|
||||
@@ -4146,27 +4111,48 @@ GetPreferredColorScheme(const WebPreferences& web_prefs,
|
||||
? blink::mojom::PreferredColorScheme::kLight
|
||||
: blink::mojom::PreferredColorScheme::kDark;
|
||||
}
|
||||
// Update the preferred root scrollbar color based on the lightness level of
|
||||
// the toolbar's color.
|
||||
preferred_root_scrollbar_color_scheme =
|
||||
color_utils::IsDark(
|
||||
web_contents->GetColorProvider().GetColor(kColorToolbar))
|
||||
? blink::mojom::PreferredColorScheme::kDark
|
||||
: blink::mojom::PreferredColorScheme::kLight;
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(ENABLE_GUEST_VIEW)
|
||||
// Guest contents uses the same color scheme as the owner contents.
|
||||
content::WebContents* owner_contents =
|
||||
guest_view::GuestViewBase::GetTopLevelWebContents(web_contents);
|
||||
// If the top-level WebContents is the same as the guest, then
|
||||
// `web_contents` is *not* a guest.
|
||||
if (owner_contents != web_contents) {
|
||||
preferred_color_scheme =
|
||||
owner_contents->GetOrCreateWebPreferences().preferred_color_scheme;
|
||||
const auto& preferences = owner_contents->GetOrCreateWebPreferences();
|
||||
preferred_color_scheme = preferences.preferred_color_scheme;
|
||||
preferred_root_scrollbar_color_scheme =
|
||||
preferences.preferred_root_scrollbar_color_scheme;
|
||||
}
|
||||
#endif // BUILDFLAG(ENABLE_GUEST_VIEW)
|
||||
|
||||
// Update the preferred root scrollbar color based on the lightness level of
|
||||
// the toolbar's color.
|
||||
const auto preferred_root_scrollbar_color_scheme =
|
||||
color_utils::IsDark(
|
||||
web_contents->GetColorProvider().GetColor(kColorToolbar))
|
||||
? blink::mojom::PreferredColorScheme::kDark
|
||||
: blink::mojom::PreferredColorScheme::kLight;
|
||||
|
||||
// To prevent a UI flicker when the CS param is enforcing dark mode, force set
|
||||
// the blink renderer so the initial load respects the prefers-color-scheme
|
||||
// media query.
|
||||
// TODO(crbug.com/506209287): Investigate if there is a feature specific place
|
||||
// to add this logic to prevent flick on initial render.
|
||||
if (web_contents) {
|
||||
GURL url = web_contents->GetVisibleURL();
|
||||
if (url.SchemeIs(content::kChromeUIScheme) &&
|
||||
url.host() == chrome::kChromeUIContextualTasksHost) {
|
||||
std::optional<bool> is_dark_mode =
|
||||
contextual_tasks::GetDarkModeFromUrl(url);
|
||||
if (is_dark_mode.has_value()) {
|
||||
preferred_color_scheme =
|
||||
is_dark_mode.value() ? blink::mojom::PreferredColorScheme::kDark
|
||||
: blink::mojom::PreferredColorScheme::kLight;
|
||||
}
|
||||
}
|
||||
}
|
||||
return {preferred_color_scheme, preferred_root_scrollbar_color_scheme};
|
||||
#endif
|
||||
}
|
||||
|
||||
std::optional<SkColor> GetRootScrollbarThemeColor(WebContents* web_contents) {
|
||||
@@ -4277,7 +4263,7 @@ base::OnceClosure ChromeContentBrowserClient::SelectClientCertificate(
|
||||
content::StoragePartition* storage_partition =
|
||||
profile->GetStoragePartition(web_contents->GetSiteInstance());
|
||||
auto* signin_partition_manager =
|
||||
ash::login::SigninPartitionManager::Factory::GetForBrowserContext(
|
||||
ash::login::SigninPartitionManagerFactory::GetForBrowserContext(
|
||||
profile);
|
||||
if (!signin_partition_manager->IsCurrentSigninStoragePartition(
|
||||
storage_partition)) {
|
||||
@@ -4400,6 +4386,59 @@ ChromeContentBrowserClient::GetFeatureObserverClient() {
|
||||
->GetFeatureObserverClient();
|
||||
}
|
||||
|
||||
// These values are persisted to logs and used for histograms.
|
||||
enum class PopupBypassType {
|
||||
kContentScript = 0,
|
||||
kExtensionProcess = 1,
|
||||
kPrivilegedWebPage = 2,
|
||||
kMaxValue = kPrivilegedWebPage,
|
||||
};
|
||||
|
||||
bool ChromeContentBrowserClient::IsPopupBypassAllowed(
|
||||
content::RenderFrameHost* render_frame_host) {
|
||||
#if BUILDFLAG(ENABLE_EXTENSIONS_CORE)
|
||||
content::RenderProcessHost* process = render_frame_host->GetProcess();
|
||||
content::BrowserContext* browser_context = process->GetBrowserContext();
|
||||
extensions::ProcessMap* process_map =
|
||||
extensions::ProcessMap::Get(browser_context);
|
||||
if (!process_map) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Allow if it is an authorized extension process.
|
||||
const extensions::Extension* extension =
|
||||
process_map->GetEnabledExtensionByProcessID(process->GetID().value());
|
||||
if (process_map->CanProcessHostContextType(
|
||||
extension, *process,
|
||||
extensions::mojom::ContextType::kPrivilegedExtension)) {
|
||||
base::UmaHistogramEnumeration("Security.PopupBypassAllowedType",
|
||||
PopupBypassType::kExtensionProcess);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Allow if it is a privileged web page (e.g., hosted app) in an outermost
|
||||
// main frame.
|
||||
if (!render_frame_host->GetParentOrOuterDocument() &&
|
||||
process_map->CanProcessHostContextType(
|
||||
extension, *process,
|
||||
extensions::mojom::ContextType::kPrivilegedWebPage)) {
|
||||
base::UmaHistogramEnumeration("Security.PopupBypassAllowedType",
|
||||
PopupBypassType::kPrivilegedWebPage);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Allow if an extension ran a content script in this process.
|
||||
if (!extensions::ScriptInjectionTracker::
|
||||
GetExtensionsThatRanContentScriptsInProcess(*process)
|
||||
.empty()) {
|
||||
base::UmaHistogramEnumeration("Security.PopupBypassAllowedType",
|
||||
PopupBypassType::kContentScript);
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ChromeContentBrowserClient::CanCreateWindow(
|
||||
RenderFrameHost* opener,
|
||||
const GURL& opener_url,
|
||||
@@ -4424,7 +4463,6 @@ bool ChromeContentBrowserClient::CanCreateWindow(
|
||||
DCHECK(profile);
|
||||
*no_javascript_access = false;
|
||||
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
// This block gives the Contextual Tasks feature the opportunity to intercept
|
||||
// tab creation in the event it doesn't go directly through the feature's
|
||||
// navigation throttle. When a new tab/window is created, it is done before
|
||||
@@ -4448,7 +4486,6 @@ bool ChromeContentBrowserClient::CanCreateWindow(
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endif // !BUILDFLAG(IS_ANDROID)
|
||||
|
||||
// If the opener is trying to create a background window but doesn't have
|
||||
// the appropriate permission, fail the attempt.
|
||||
@@ -4755,11 +4792,14 @@ void ChromeContentBrowserClient::OverrideWebPreferences(
|
||||
// if the app navigates off scope. This is not a problem because we still
|
||||
// want to use the scope of the app associated with the window, not the
|
||||
// WebContents.
|
||||
Browser* browser = chrome::FindBrowserWithTab(web_contents);
|
||||
if (browser && browser->app_controller()) {
|
||||
BrowserWindowInterface* browser =
|
||||
chrome::FindBrowserWithTab(web_contents);
|
||||
web_app::AppBrowserController* app_controller =
|
||||
browser ? web_app::AppBrowserController::From(browser) : nullptr;
|
||||
if (app_controller) {
|
||||
web_app::WebAppProvider* const web_app_provider =
|
||||
web_app::WebAppProvider::GetForLocalAppsUnchecked(profile);
|
||||
const webapps::AppId& app_id = browser->app_controller()->app_id();
|
||||
const webapps::AppId& app_id = app_controller->app_id();
|
||||
const web_app::WebAppRegistrar& registrar =
|
||||
web_app_provider->registrar_unsafe();
|
||||
if (registrar.AppMatches(app_id,
|
||||
@@ -4769,7 +4809,7 @@ void ChromeContentBrowserClient::OverrideWebPreferences(
|
||||
|
||||
// IWA with window management permission can close windows and
|
||||
// focus windows without user gesture.
|
||||
if (browser->app_controller()->IsIsolatedWebApp() &&
|
||||
if (app_controller->IsIsolatedWebApp() &&
|
||||
profile->GetPermissionController()
|
||||
->GetPermissionStatusForCurrentDocument(
|
||||
content::PermissionDescriptorUtil::
|
||||
@@ -4778,10 +4818,10 @@ void ChromeContentBrowserClient::OverrideWebPreferences(
|
||||
web_contents->GetPrimaryMainFrame()) ==
|
||||
blink::mojom::PermissionStatus::GRANTED) {
|
||||
web_prefs->allow_scripts_to_close_windows = true;
|
||||
web_prefs->allow_window_focus_without_user_gesture = true;
|
||||
web_prefs->allow_unrestricted_window_focus = true;
|
||||
}
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
auto* system_app = browser->app_controller()->system_app();
|
||||
auto* system_app = app_controller->system_app();
|
||||
if (system_app) {
|
||||
web_prefs->allow_scripts_to_close_windows =
|
||||
system_app->ShouldAllowScriptsToCloseWindows();
|
||||
@@ -4844,8 +4884,8 @@ void ChromeContentBrowserClient::OverrideWebPreferences(
|
||||
|
||||
std::tie(web_prefs->preferred_color_scheme,
|
||||
web_prefs->preferred_root_scrollbar_color_scheme) =
|
||||
GetPreferredColorScheme(*web_prefs, main_frame_site.GetSiteURL(),
|
||||
web_contents);
|
||||
GetPreferredColorScheme(
|
||||
*web_prefs, main_frame_site.GetSecurityPrincipal(), web_contents);
|
||||
|
||||
web_prefs->root_scrollbar_theme_color =
|
||||
GetRootScrollbarThemeColor(web_contents);
|
||||
@@ -4953,8 +4993,8 @@ bool ChromeContentBrowserClient::OverrideWebPreferencesAfterNavigation(
|
||||
web_prefs->preferred_root_scrollbar_color_scheme;
|
||||
std::tie(web_prefs->preferred_color_scheme,
|
||||
web_prefs->preferred_root_scrollbar_color_scheme) =
|
||||
GetPreferredColorScheme(*web_prefs, main_frame_site.GetSiteURL(),
|
||||
web_contents);
|
||||
GetPreferredColorScheme(
|
||||
*web_prefs, main_frame_site.GetSecurityPrincipal(), web_contents);
|
||||
prefs_changed |=
|
||||
web_prefs->preferred_color_scheme != old_preferred_color_scheme ||
|
||||
web_prefs->preferred_root_scrollbar_color_scheme !=
|
||||
@@ -5004,7 +5044,7 @@ bool ChromeContentBrowserClient::
|
||||
GetForcedColorsForWebContent(&web_contents) !=
|
||||
std::tie(prefs.in_forced_colors,
|
||||
prefs.is_forced_colors_disabled) ||
|
||||
GetPreferredColorScheme(prefs, main_frame_site.GetSiteURL(),
|
||||
GetPreferredColorScheme(prefs, main_frame_site.GetSecurityPrincipal(),
|
||||
&web_contents) !=
|
||||
std::tie(prefs.preferred_color_scheme,
|
||||
prefs.preferred_root_scrollbar_color_scheme) ||
|
||||
@@ -6308,7 +6348,8 @@ void AddChromeSchemeFactories(
|
||||
content::WebContents* web_contents,
|
||||
const extensions::Extension* extension,
|
||||
ChromeContentBrowserClient::NonNetworkURLLoaderFactoryMap* factories) {
|
||||
#if BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
// Android does not support instant.
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
Profile* profile =
|
||||
Profile::FromBrowserContext(web_contents->GetBrowserContext());
|
||||
InstantService* instant_service =
|
||||
@@ -6326,7 +6367,7 @@ void AddChromeSchemeFactories(
|
||||
frame_host, chrome::kChromeSearchScheme,
|
||||
/*allowed_hosts=*/base::flat_set<std::string>()));
|
||||
}
|
||||
#endif // BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
#endif // !BUILDFLAG(IS_ANDROID)
|
||||
|
||||
extensions::ExtensionWebContentsObserver* web_observer =
|
||||
extensions::ExtensionWebContentsObserver::GetForWebContents(web_contents);
|
||||
@@ -6521,16 +6562,16 @@ void ChromeContentBrowserClient::WillCreateURLLoaderFactory(
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
#if BUILDFLAG(ENABLE_GUEST_VIEW)
|
||||
#if BUILDFLAG(ENABLE_EXTENSIONS_CORE)
|
||||
if (base::FeatureList::IsEnabled(contextual_tasks::kContextualTasks)) {
|
||||
contextual_tasks::MaybeInterceptURLLoaderFactory(frame, factory_builder);
|
||||
}
|
||||
#endif // !BUILDFLAG(IS_ANDROID)
|
||||
|
||||
#if BUILDFLAG(ENABLE_GUEST_VIEW) && !BUILDFLAG(ENABLE_EXTENSIONS_CORE)
|
||||
#else // !BUILDFLAG (ENABLE_EXTENSIONS_CORE)
|
||||
guest_view::MaybeInterceptURLLoaderFactoryForSlimWebView(
|
||||
frame, factory_builder, header_client);
|
||||
#endif
|
||||
#endif // BUILDFLAG (ENABLE_EXTENSIONS_CORE)
|
||||
#endif // BUILDFLAG(ENABLE_GUEST_VIEW)
|
||||
|
||||
// WARNING: This must be the last interceptor in the chain as the proxying
|
||||
// URLLoaderFactory installed by this needs to be the one actually sending
|
||||
@@ -6606,10 +6647,9 @@ bool ChromeContentBrowserClient::WillInterceptWebSocket(
|
||||
// BrowserContextKeyedAPI factories for e.g. WebRequest.
|
||||
if (!web_request_api) {
|
||||
return false;
|
||||
} else {
|
||||
return web_request_api->MayHaveProxiesForFrame(frame);
|
||||
}
|
||||
|
||||
return (web_request_api->MayHaveProxies() ||
|
||||
web_request_api->IsAvailableToWebViewEmbedderFrame(frame));
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
@@ -6779,7 +6819,7 @@ bool ChromeContentBrowserClient::ShouldForceDownloadResource(
|
||||
content::BrowserContext* browser_context,
|
||||
const GURL& url,
|
||||
const std::string& mime_type) {
|
||||
#if BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
#if BUILDFLAG(ENABLE_EXTENSIONS_CORE)
|
||||
// Special-case user scripts to get downloaded instead of viewed.
|
||||
if (extensions::UserScript::IsURLUserScript(url, mime_type)) {
|
||||
return true;
|
||||
@@ -6803,7 +6843,7 @@ bool ChromeContentBrowserClient::ShouldForceDownloadResource(
|
||||
}
|
||||
}
|
||||
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||
#endif // BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
#endif // BUILDFLAG(ENABLE_EXTENSIONS_CORE)
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -7153,6 +7193,16 @@ bool ChromeContentBrowserClient::HandleWebUI(
|
||||
replacements.SetPathStr(chrome::kChromeUIContactInfoPath);
|
||||
*url = url->ReplaceComponents(replacements);
|
||||
}
|
||||
|
||||
// Rewrite chrome://settings/searchEngines to chrome://settings/search.
|
||||
if (url->SchemeIs(content::kChromeUIScheme) &&
|
||||
url->GetHost() == chrome::kChromeUISettingsHost &&
|
||||
(url->GetPath() == chrome::kChromeUISearchEngineSettingsPath) &&
|
||||
base::FeatureList::IsEnabled(switches::kSearchSettingsUpdate)) {
|
||||
GURL::Replacements replacements;
|
||||
replacements.SetPathStr(chrome::kChromeUISearchSettingsPath);
|
||||
*url = url->ReplaceComponents(replacements);
|
||||
}
|
||||
#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) ||
|
||||
// BUILDFLAG(IS_CHROMEOS)
|
||||
|
||||
@@ -7619,36 +7669,6 @@ int ChromeContentBrowserClient::NumVersionsInTopicsEpochs(
|
||||
main_frame->GetLastCommittedOrigin());
|
||||
}
|
||||
|
||||
bool ChromeContentBrowserClient::IsBluetoothScanningBlocked(
|
||||
content::BrowserContext* browser_context,
|
||||
const url::Origin& requesting_origin,
|
||||
const url::Origin& embedding_origin) {
|
||||
const HostContentSettingsMap* const content_settings =
|
||||
HostContentSettingsMapFactory::GetForProfile(
|
||||
Profile::FromBrowserContext(browser_context));
|
||||
|
||||
if (content_settings->GetContentSetting(
|
||||
requesting_origin.GetURL(), embedding_origin.GetURL(),
|
||||
ContentSettingsType::BLUETOOTH_SCANNING) == CONTENT_SETTING_BLOCK) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void ChromeContentBrowserClient::BlockBluetoothScanning(
|
||||
content::BrowserContext* browser_context,
|
||||
const url::Origin& requesting_origin,
|
||||
const url::Origin& embedding_origin) {
|
||||
HostContentSettingsMap* const content_settings =
|
||||
HostContentSettingsMapFactory::GetForProfile(
|
||||
Profile::FromBrowserContext(browser_context));
|
||||
|
||||
content_settings->SetContentSettingDefaultScope(
|
||||
requesting_origin.GetURL(), embedding_origin.GetURL(),
|
||||
ContentSettingsType::BLUETOOTH_SCANNING, CONTENT_SETTING_BLOCK);
|
||||
}
|
||||
|
||||
void ChromeContentBrowserClient::GetMediaDeviceIDSalt(
|
||||
content::RenderFrameHost* rfh,
|
||||
const net::SiteForCookies& site_for_cookies,
|
||||
@@ -7956,6 +7976,13 @@ bool ChromeContentBrowserClient::AreV8OptimizationsEnabledForSite(
|
||||
site_url, site_url, ContentSettingsType::JAVASCRIPT_OPTIMIZER,
|
||||
&content_setting_info);
|
||||
|
||||
content_settings::ProviderType default_content_setting_provider;
|
||||
map->GetDefaultContentSetting(ContentSettingsType::JAVASCRIPT_OPTIMIZER,
|
||||
&default_content_setting_provider);
|
||||
auto default_content_setting_source =
|
||||
content_settings::GetSettingSourceFromProviderType(
|
||||
default_content_setting_provider);
|
||||
|
||||
// `default_javascript_optimizer_setting` is determined based on the user's
|
||||
// selection in chrome://settings, whether the site-familiarity-feature is
|
||||
// enabled, and enterprise policy. `default_javascript_optimizer_setting`
|
||||
@@ -7968,7 +7995,8 @@ bool ChromeContentBrowserClient::AreV8OptimizationsEnabledForSite(
|
||||
// Invariant guaranteed by ComputeDefaultJavascriptOptimizerSetting().
|
||||
CHECK(default_javascript_optimizer_setting !=
|
||||
JavascriptOptimizerSetting::kBlockedForUnfamiliarSites ||
|
||||
content_setting_info.source == content_settings::SettingSource::kUser);
|
||||
default_content_setting_source ==
|
||||
content_settings::SettingSource::kUser);
|
||||
|
||||
if (default_javascript_optimizer_setting !=
|
||||
JavascriptOptimizerSetting::kBlockedForUnfamiliarSites) {
|
||||
@@ -8269,8 +8297,8 @@ bool ChromeContentBrowserClient::ShouldPreconnectNavigation(
|
||||
const auto* web_request_api =
|
||||
extensions::BrowserContextKeyedAPIFactory<extensions::WebRequestAPI>::Get(
|
||||
browser_context);
|
||||
if (!web_request_api || web_request_api->MayHaveProxies() ||
|
||||
web_request_api->IsAvailableToWebViewEmbedderFrame(render_frame_host)) {
|
||||
if (!web_request_api ||
|
||||
web_request_api->MayHaveProxiesForFrame(render_frame_host)) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
@@ -8977,7 +9005,9 @@ ChromeContentBrowserClient::GetClipboardTypesIfPolicyApplied(
|
||||
|
||||
bool ChromeContentBrowserClient::UsePrefetchPrerenderIntegration() {
|
||||
return base::FeatureList::IsEnabled(features::kBookmarkTriggerForPrefetch) ||
|
||||
base::FeatureList::IsEnabled(features::kNewTabPageTriggerForPrefetch);
|
||||
base::FeatureList::IsEnabled(
|
||||
features::kNewTabPageTriggerForPrefetch) ||
|
||||
base::FeatureList::IsEnabled(features::kDsePreload2);
|
||||
}
|
||||
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
@@ -9125,3 +9155,21 @@ void ChromeContentBrowserClient::UpdateCorsExemptHeaderForPrefetch(
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool ChromeContentBrowserClient::IsAttributionInternalsWebUIEnabled() {
|
||||
return !base::FeatureList::IsEnabled(
|
||||
privacy_sandbox::kPrivacySandboxAdPrivacyUxDeprecation);
|
||||
}
|
||||
|
||||
bool ChromeContentBrowserClient::IsFullscreenAllowedForUnfocusedWebContents(
|
||||
content::WebContents* unfocused_web_contents) {
|
||||
guest_view::GuestViewBase* guest =
|
||||
guest_view::GuestViewBase::FromWebContents(unfocused_web_contents);
|
||||
if (!guest) {
|
||||
return false;
|
||||
}
|
||||
if (guest->IsOwnedByControlledFrameEmbedder()) {
|
||||
return guest->embedder_web_contents()->ContainsOrIsFocusedWebContents();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
+9
-6
@@ -11,6 +11,7 @@
|
||||
#include "chrome/browser/actor/actor_navigation_throttle.h"
|
||||
#include "chrome/browser/autocomplete/aim_eligibility_refresh_navigation_throttle.h"
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/contextual_tasks/contextual_tasks_navigation_throttle.h"
|
||||
#include "chrome/browser/custom_handlers/chrome_protocol_handler_navigation_throttle.h"
|
||||
#include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h"
|
||||
#include "chrome/browser/data_sharing/data_sharing_navigation_throttle.h"
|
||||
@@ -24,6 +25,7 @@
|
||||
#include "chrome/browser/policy/chrome_policy_blocklist_service_factory.h"
|
||||
#include "chrome/browser/policy/policy_util.h"
|
||||
#include "chrome/browser/preloading/prefetch/no_state_prefetch/chrome_no_state_prefetch_contents_delegate.h"
|
||||
#include "chrome/browser/preloading/prerender/dse_prewarm_navigation_throttle.h"
|
||||
#include "chrome/browser/privacy_sandbox/privacy_sandbox_settings_factory.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/browser/ssl/chrome_security_blocking_page_factory.h"
|
||||
@@ -90,7 +92,6 @@
|
||||
#else // BUILDFLAG(IS_ANDROID)
|
||||
#include "chrome/browser/apps/link_capturing/link_capturing_navigation_throttle.h"
|
||||
#include "chrome/browser/apps/link_capturing/web_app_link_capturing_delegate.h"
|
||||
#include "chrome/browser/contextual_tasks/contextual_tasks_navigation_throttle.h"
|
||||
#include "chrome/browser/devtools/devtools_window.h"
|
||||
#include "chrome/browser/page_info/web_view_side_panel_throttle.h"
|
||||
#include "chrome/browser/preloading/preview/preview_navigation_throttle.h"
|
||||
@@ -165,7 +166,7 @@
|
||||
#include "chrome/browser/offline_pages/offline_page_navigation_throttle.h"
|
||||
#endif // BUILDFLAG(ENABLE_OFFLINE_PAGES)
|
||||
|
||||
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
|
||||
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_ANDROID)
|
||||
#include "chrome/browser/enterprise/platform_auth/platform_auth_navigation_throttle.h"
|
||||
#endif
|
||||
|
||||
@@ -187,7 +188,7 @@ namespace {
|
||||
// parameters.
|
||||
void HandleSSLErrorWrapper(
|
||||
content::WebContents* web_contents,
|
||||
int cert_error,
|
||||
net::Error cert_error,
|
||||
const net::SSLInfo& ssl_info,
|
||||
const GURL& request_url,
|
||||
SSLErrorHandler::BlockingPageReadyCallback blocking_page_ready_callback) {
|
||||
@@ -287,6 +288,8 @@ void CreateAndAddChromeThrottlesForNavigation(
|
||||
page_load_metrics::MetricsNavigationThrottle::CreateAndAdd(registry);
|
||||
}
|
||||
|
||||
DSEPrewarmNavigationThrottle::MaybeCreateAndAdd(registry);
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
// TODO(davidben): This is insufficient to integrate with prerender properly.
|
||||
// https://crbug.com/40364296
|
||||
@@ -463,7 +466,6 @@ void CreateAndAddChromeThrottlesForNavigation(
|
||||
// before ContextualTasksNavigationThrottle intercepts them.
|
||||
AimEligibilityRefreshNavigationThrottle::MaybeCreateAndAdd(registry);
|
||||
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
if (base::FeatureList::IsEnabled(contextual_tasks::kContextualTasks) ||
|
||||
base::FeatureList::IsEnabled(
|
||||
contextual_tasks::kContextualTasksUrlRedirectToAimUrl)) {
|
||||
@@ -471,6 +473,7 @@ void CreateAndAddChromeThrottlesForNavigation(
|
||||
registry);
|
||||
}
|
||||
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
DevToolsWindow::MaybeCreateAndAddNavigationThrottle(registry);
|
||||
|
||||
if (base::FeatureList::IsEnabled(features::kInstantUsesSpareRenderer)) {
|
||||
@@ -571,13 +574,13 @@ void CreateAndAddChromeThrottlesForNavigation(
|
||||
registry);
|
||||
}
|
||||
|
||||
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
|
||||
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_ANDROID)
|
||||
// Don't perform platform authentication in incognito and guest profiles.
|
||||
if (profile && !profile->IsOffTheRecord()) {
|
||||
enterprise_auth::PlatformAuthNavigationThrottle::MaybeCreateAndAdd(
|
||||
registry);
|
||||
}
|
||||
#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
|
||||
#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_ANDROID)
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
// TODO(b:296844164) Handle captive portal signin properly.
|
||||
|
||||
+147
-96
@@ -157,6 +157,7 @@ public abstract class ChromeFeatureList {
|
||||
// LINT.IfChange(FeaturesExposedToJava)
|
||||
// keep-sorted start group_prefixes=["public static final String"]
|
||||
|
||||
public static final String AAPM_BLOCKS_WEB_GPU = "AAPMBlocksWebGPU";
|
||||
public static final String ABORT_NAVIGATIONS_FROM_TAB_CLOSURES =
|
||||
"AbortNavigationsFromTabClosures";
|
||||
public static final String ACCOUNT_FOR_SUPPRESSED_KEYBOARD_INSETS =
|
||||
@@ -176,14 +177,14 @@ public abstract class ChromeFeatureList {
|
||||
public static final String ANDROID_APP_INTEGRATION_MODULE = "AndroidAppIntegrationModule";
|
||||
public static final String ANDROID_APP_INTEGRATION_MULTI_DATA_SOURCE =
|
||||
"AndroidAppIntegrationMultiDataSource";
|
||||
public static final String ANDROID_APP_RATING_PROMPT = "AndroidAppRatingPrompt";
|
||||
public static final String ANDROID_AUTOFILL_SUPPORT_FOR_HTTP_AUTH =
|
||||
"AndroidAutofillSupportForHttpAuth";
|
||||
public static final String ANDROID_AUTO_MINTED_TWA = "AndroidAutoMintedTWA";
|
||||
public static final String ANDROID_BOOKMARK_BAR = "AndroidBookmarkBar";
|
||||
public static final String ANDROID_BOOKMARK_BAR_FAST_FOLLOW = "AndroidBookmarkBarFastFollow";
|
||||
public static final String ANDROID_BOTTOM_BAR = "AndroidBottomBar";
|
||||
public static final String ANDROID_BOTTOM_TOOLBAR_V2 = "AndroidBottomToolbarV2";
|
||||
public static final String ANDROID_COMPOSEPLATE = "AndroidComposeplate";
|
||||
public static final String ANDROID_COMPOSEPLATE_LFF = "AndroidComposeplateLFF";
|
||||
public static final String ANDROID_CONTEXT_MENU_DUPLICATE_TABS =
|
||||
"AndroidContextMenuDuplicateTabs";
|
||||
public static final String ANDROID_DATA_IMPORTER_SERVICE = "AndroidDataImporterService";
|
||||
@@ -197,11 +198,12 @@ public abstract class ChromeFeatureList {
|
||||
public static final String ANDROID_OMNIBOX_FOCUSED_NEW_TAB_PAGE =
|
||||
"AndroidOmniboxFocusedNewTabPage";
|
||||
public static final String ANDROID_OPEN_INCOGNITO_AS_WINDOW = "AndroidOpenIncognitoAsWindow";
|
||||
public static final String ANDROID_PINNED_TABS = "AndroidPinnedTabs";
|
||||
public static final String ANDROID_PINNED_TABS_TABLET_TAB_STRIP =
|
||||
"AndroidPinnedTabsTabletTabStrip";
|
||||
public static final String ANDROID_PAGE_INFO_AS_APP_MENU_ITEM = "AndroidPageInfoAsAppMenuItem";
|
||||
public static final String ANDROID_PROGRESS_BAR_VISUAL_UPDATE =
|
||||
"AndroidProgressBarVisualUpdate";
|
||||
public static final String ANDROID_SAVE_CARD_NON_BLOCKING_DIALOG =
|
||||
"AndroidSaveCardNonBlockingDialog";
|
||||
public static final String ANDROID_SELF_OCCLUSION_TRACKING = "AndroidSelfOcclusionTracking";
|
||||
public static final String ANDROID_SETTINGS_CONTAINMENT = "AndroidSettingsContainment";
|
||||
public static final String ANDROID_SETUP_LIST = "AndroidSetupList";
|
||||
public static final String ANDROID_SURFACE_COLOR_UPDATE = "AndroidSurfaceColorUpdate";
|
||||
@@ -224,20 +226,33 @@ public abstract class ChromeFeatureList {
|
||||
"AndroidWindowPopupPredictFinalBounds";
|
||||
public static final String ANDROID_WINDOW_POPUP_RESIZE_AFTER_SPAWN =
|
||||
"AndroidWindowPopupResizeAfterSpawn";
|
||||
public static final String ANDROID_XR_IMMERSIVE_PLAYER = "AndroidXrImmersivePlayer";
|
||||
public static final String ANDROID_XR_USES_SURFACE_CONTROL = "AndroidXRUsesSurfaceControl";
|
||||
public static final String ANDROID_ZOOM_IMMERSIVE = "AndroidZoomImmersive";
|
||||
public static final String ANIMATED_GIF_REFACTOR = "AnimatedGifRefactor";
|
||||
public static final String ANIMATED_IMAGE_DRAG_SHADOW = "AnimatedImageDragShadow";
|
||||
public static final String ANNOTATED_PAGE_CONTENTS_VIRTUAL_STRUCTURE =
|
||||
"AnnotatedPageContentsVirtualStructure";
|
||||
public static final String APB144_PATCH1 = "Apb144Patch1";
|
||||
public static final String APB144_PATCH2 = "Apb144Patch2";
|
||||
public static final String APB144_PATCH3 = "Apb144Patch3";
|
||||
public static final String APB144_PATCH4 = "Apb144Patch4";
|
||||
public static final String APB144_PATCH5 = "Apb144Patch5";
|
||||
public static final String APB144_PATCH6 = "Apb144Patch6";
|
||||
public static final String APB144_PATCH7 = "Apb144Patch7";
|
||||
public static final String APB144_PATCH8 = "Apb144Patch8";
|
||||
public static final String APB144_PATCH9 = "Apb144Patch9";
|
||||
public static final String APP_SPECIFIC_HISTORY = "AppSpecificHistory";
|
||||
public static final String APP_SPECIFIC_HISTORY_VIEW_INTENT = "AppSpecificHistoryViewIntent";
|
||||
public static final String ASYNC_NOTIFICATION_MANAGER = "AsyncNotificationManager";
|
||||
public static final String ASYNC_NOTIFICATION_MANAGER_FOR_DOWNLOAD =
|
||||
"AsyncNotificationManagerForDownload";
|
||||
public static final String AUTOFILL_AI_AVAILABLE_BY_DEFAULT = "AutofillAiAvailableByDefault";
|
||||
public static final String AUTOFILL_AI_CREATE_ENTITY_DATA_MANAGER =
|
||||
"AutofillAiCreateEntityDataManager";
|
||||
public static final String AUTOFILL_AI_REAUTH_REQUIRED = "AutofillAiReauthRequired";
|
||||
public static final String AUTOFILL_AI_SHOW_WALLET_DISABLED_BANNER =
|
||||
"AutofillAiShowWalletDisabledBanner";
|
||||
public static final String AUTOFILL_AI_WITH_DATA_SCHEMA = "AutofillAiWithDataSchema";
|
||||
public static final String AUTOFILL_ALLOW_NON_HTTP_ACTIVATION =
|
||||
"AutofillAllowNonHttpActivation";
|
||||
@@ -256,7 +271,6 @@ public abstract class ChromeFeatureList {
|
||||
"AutofillEnableCardBenefitsForAmericanExpress";
|
||||
public static final String AUTOFILL_ENABLE_CARD_BENEFITS_FOR_BMO =
|
||||
"AutofillEnableCardBenefitsForBmo";
|
||||
public static final String AUTOFILL_ENABLE_CVC_STORAGE = "AutofillEnableCvcStorageAndFilling";
|
||||
public static final String AUTOFILL_ENABLE_FLAT_RATE_CARD_BENEFITS_FROM_CURINOS =
|
||||
"AutofillEnableFlatRateCardBenefitsFromCurinos";
|
||||
public static final String AUTOFILL_ENABLE_KEYBOARD_ACCESSORY_CHIP_REDESIGN =
|
||||
@@ -264,8 +278,6 @@ public abstract class ChromeFeatureList {
|
||||
public static final String AUTOFILL_ENABLE_KEYBOARD_ACCESSORY_CHIP_WIDTH_ADJUSTMENT =
|
||||
"AutofillEnableKeyboardAccessoryChipWidthAdjustment";
|
||||
public static final String AUTOFILL_ENABLE_LOCAL_IBAN = "AutofillEnableLocalIban";
|
||||
public static final String AUTOFILL_ENABLE_LOYALTY_CARDS_FILLING =
|
||||
"AutofillEnableLoyaltyCardsFilling";
|
||||
public static final String AUTOFILL_ENABLE_NEW_CARD_BENEFITS_TOGGLE_TEXT =
|
||||
"AutofillEnableNewCardBenefitsToggleText";
|
||||
public static final String AUTOFILL_ENABLE_NEW_FOP_DISPLAY_ANDROID =
|
||||
@@ -278,6 +290,8 @@ public abstract class ChromeFeatureList {
|
||||
public static final String AUTOFILL_ENABLE_SUPPORT_FOR_HOME_AND_WORK =
|
||||
"AutofillEnableSupportForHomeAndWork";
|
||||
public static final String AUTOFILL_ENABLE_WALLET_BRANDING = "AutofillEnableWalletBranding";
|
||||
public static final String AUTOFILL_ENABLE_WALLET_BRANDING_V2 =
|
||||
"AutofillEnableWalletBrandingV2";
|
||||
public static final String AUTOFILL_RETRY_IMAGE_FETCH_ON_FAILURE =
|
||||
"AutofillRetryImageFetchOnFailure";
|
||||
public static final String AUTOFILL_SYNC_EWALLET_ACCOUNTS = "AutofillSyncEwalletAccounts";
|
||||
@@ -343,6 +357,8 @@ public abstract class ChromeFeatureList {
|
||||
"CCTOpenInBrowserButtonIfAllowedByEmbedder";
|
||||
public static final String CCT_OPEN_IN_BROWSER_BUTTON_IF_ENABLED_BY_EMBEDDER =
|
||||
"CCTOpenInBrowserButtonIfEnabledByEmbedder";
|
||||
public static final String CCT_PAGE_CONTENT_REQUEST_ALLOWED = "CCTPageContentRequestAllowed";
|
||||
public static final String CCT_PAGE_CONTENT_REQUEST_ENABLED = "CCTPageContentRequestEnabled";
|
||||
public static final String CCT_REALTIME_ENGAGEMENT_EVENTS_IN_BACKGROUND =
|
||||
"CCTRealtimeEngagementEventsInBackground";
|
||||
public static final String CCT_REPORT_PARALLEL_REQUEST_STATUS =
|
||||
@@ -391,6 +407,7 @@ public abstract class ChromeFeatureList {
|
||||
public static final String CROSS_DEVICE_PREF_TRACKER_EXTRA_LOGS =
|
||||
"CrossDevicePrefTrackerExtraLogs";
|
||||
public static final String CROSS_DEVICE_TAB_PANE_ANDROID = "CrossDeviceTabPaneAndroid";
|
||||
public static final String CROSS_DEVICE_TASK_HANDOFF = "CrossDeviceTaskHandoff";
|
||||
public static final String DARKEN_WEBSITES_CHECKBOX_IN_THEMES_SETTING =
|
||||
"DarkenWebsitesCheckboxInThemesSetting";
|
||||
public static final String DATA_SHARING = "DataSharing";
|
||||
@@ -447,13 +464,13 @@ public abstract class ChromeFeatureList {
|
||||
public static final String ENABLE_TOOLBAR_SWIPE_ON_NON_DESKTOP_LFF =
|
||||
"EnableToolbarSwipeOnNonDesktopLff";
|
||||
public static final String ENABLE_X_AXIS_ACTIVITY_TRANSITION = "EnableXAxisActivityTransition";
|
||||
public static final String ENFORCE_INCOGNITO_ISOLATION = "EnforceIncognitoIsolation";
|
||||
public static final String ESC_CANCEL_DRAG = "EscCancelDrag";
|
||||
public static final String FACILITATED_PAYMENTS_ENABLE_A2A_PAYMENT =
|
||||
"FacilitatedPaymentsEnableA2APayment";
|
||||
public static final String FEED_AUDIO_OVERVIEWS = "FeedAudioOverviews";
|
||||
public static final String FEED_CONTAINMENT = "FeedContainment";
|
||||
public static final String FEED_FOLLOW_UI_UPDATE = "FeedFollowUiUpdate";
|
||||
public static final String FEED_HEADER_REMOVAL = "FeedHeaderRemoval";
|
||||
public static final String FEED_IMAGE_MEMORY_CACHE_SIZE_PERCENTAGE =
|
||||
"FeedImageMemoryCacheSizePercentage";
|
||||
public static final String FEED_LOADING_PLACEHOLDER = "FeedLoadingPlaceholder";
|
||||
@@ -468,6 +485,7 @@ public abstract class ChromeFeatureList {
|
||||
"FullscreenInsetsApiMigrationOnAutomotive";
|
||||
public static final String FULLSCREEN_VIDEO_PICTURE_IN_PICTURE =
|
||||
"FullscreenVideoPictureInPicture";
|
||||
public static final String GESTURE_USER_EDUCATION_BACK_SWIPE = "GestureUserEducationBackSwipe";
|
||||
public static final String GLIC = "Glic";
|
||||
public static final String GRID_TAB_SWITCHER_SURFACE_COLOR_UPDATE =
|
||||
"GridTabSwitcherSurfaceColorUpdate";
|
||||
@@ -498,10 +516,10 @@ public abstract class ChromeFeatureList {
|
||||
public static final String LOCK_TOP_CONTROLS_ON_LARGE_TABLETS = "LockTopControlsOnLargeTablets";
|
||||
public static final String LOCK_TOP_CONTROLS_ON_LARGE_TABLETS_V2 =
|
||||
"LockTopControlsOnLargeTabletsV2";
|
||||
public static final String LOGO_VIEW_REFACTOR = "LogoViewRefactor";
|
||||
public static final String LOOKALIKE_NAVIGATION_URL_SUGGESTIONS_UI =
|
||||
"LookalikeUrlNavigationSuggestionsUI";
|
||||
public static final String LOW_END_MEMORY_EXPERIMENT = BaseFeatures.LOW_END_MEMORY_EXPERIMENT;
|
||||
public static final String MAGIC_STACK_ANDROID = "MagicStackAndroid";
|
||||
public static final String MALICIOUS_APK_DOWNLOAD_CHECK = "MaliciousApkDownloadCheck";
|
||||
public static final String MAYLAUNCHURL_USES_SEPARATE_STORAGE_PARTITION =
|
||||
"MayLaunchUrlUsesSeparateStoragePartition";
|
||||
@@ -554,10 +572,10 @@ public abstract class ChromeFeatureList {
|
||||
public static final String PRERENDER2 = "Prerender2";
|
||||
public static final String PRICE_ANNOTATIONS = "PriceAnnotations";
|
||||
public static final String PRICE_CHANGE_MODULE = "PriceChangeModule";
|
||||
public static final String PRIVACY_SANDBOX_ACTIVITY_TYPE_STORAGE =
|
||||
"PrivacySandboxActivityTypeStorage";
|
||||
public static final String PRIVACY_SANDBOX_ADS_API_UX_ENHANCEMENTS =
|
||||
"PrivacySandboxAdsApiUxEnhancements";
|
||||
public static final String PRIVACY_SANDBOX_AD_PRIVACY_UX_DEPRECATION =
|
||||
"PrivacySandboxAdPrivacyUxDeprecation";
|
||||
public static final String PRIVACY_SANDBOX_AD_TOPICS_CONTENT_PARITY =
|
||||
"PrivacySandboxAdTopicsContentParity";
|
||||
public static final String PRIVACY_SANDBOX_SETTINGS_4 = "PrivacySandboxSettings4";
|
||||
@@ -573,7 +591,6 @@ public abstract class ChromeFeatureList {
|
||||
public static final String READALOUD_IPH_MENU_BUTTON_HIGHLIGHT_CCT =
|
||||
"ReadAloudIPHMenuButtonHighlightCCT";
|
||||
public static final String READALOUD_PLAYBACK = "ReadAloudPlayback";
|
||||
public static final String RECENTLY_CLOSED_TABS_AND_WINDOWS = "RecentlyClosedTabsAndWindows";
|
||||
public static final String RECORD_INCOGNITO_NTP_TIME_TO_FIRST_NAVIGATION_METRIC =
|
||||
"RecordIncognitoNtpTimeToFirstNavigationMetric";
|
||||
public static final String RECORD_SUPPRESSION_METRICS = "RecordSuppressionMetrics";
|
||||
@@ -590,7 +607,6 @@ public abstract class ChromeFeatureList {
|
||||
"RestrictLegacySearchEnginePromoOnFormFactors";
|
||||
public static final String RIGHT_EDGE_GOES_FORWARD_GESTURE_NAV =
|
||||
"RightEdgeGoesForwardGestureNav";
|
||||
public static final String ROBUST_WINDOW_MANAGEMENT = "RobustWindowManagement";
|
||||
public static final String ROBUST_WINDOW_MANAGEMENT_EXPERIMENTAL =
|
||||
"RobustWindowManagementExperimental";
|
||||
public static final String SAFETY_HUB = "SafetyHub";
|
||||
@@ -604,6 +620,7 @@ public abstract class ChromeFeatureList {
|
||||
public static final String SAFE_BROWSING_DELAYED_WARNINGS = "SafeBrowsingDelayedWarnings";
|
||||
public static final String SAFE_BROWSING_EXTENDED_REPORTING_REMOVE_PREF_DEPENDENCY =
|
||||
"ExtendedReportingRemovePrefDependency";
|
||||
public static final String SCHEDULE_WINDOW_CLEANING = "ScheduleWindowCleaning";
|
||||
public static final String SEARCH_IN_CCT = "SearchInCCT";
|
||||
public static final String SEARCH_IN_CCT_ALTERNATE_TAP_HANDLING =
|
||||
"SearchInCCTAlternateTapHandling";
|
||||
@@ -612,7 +629,6 @@ public abstract class ChromeFeatureList {
|
||||
public static final String SEARCH_IN_CCT_IF_ENABLED_BY_EMBEDDER =
|
||||
"SearchInCCTIfEnabledByEmbedder";
|
||||
public static final String SEARCH_IN_SETTINGS = "SearchInSettings";
|
||||
public static final String SEARCH_RESUMPTION_MODULE_ANDROID = "SearchResumptionModuleAndroid";
|
||||
public static final String SEED_ACCOUNTS_REVAMP = "SeedAccountsRevamp";
|
||||
public static final String SEGMENTATION_PLATFORM_ANDROID_HOME_MODULE_RANKER =
|
||||
"SegmentationPlatformAndroidHomeModuleRanker";
|
||||
@@ -676,7 +692,7 @@ public abstract class ChromeFeatureList {
|
||||
public static final String TASK_MANAGER_CLANK = "TaskManagerClank";
|
||||
public static final String TEST_DEFAULT_DISABLED = "TestDefaultDisabled";
|
||||
public static final String TEST_DEFAULT_ENABLED = "TestDefaultEnabled";
|
||||
public static final String TINKER_TANK_BOTTOM_SHEET = "TinkerTankBottomSheet";
|
||||
public static final String THREE_DOT_MENU_BACK_BUTTON = "ThreeDotMenuBackButton";
|
||||
public static final String TOOLBAR_PHONE_ANIMATION_REFACTOR = "ToolbarPhoneAnimationRefactor";
|
||||
public static final String TOOLBAR_SCROLL_ABLATION = "AndroidToolbarScrollAblation";
|
||||
public static final String TOOLBAR_SNAPSHOT_REFACTOR = "ToolbarSnapshotRefactor";
|
||||
@@ -690,7 +706,6 @@ public abstract class ChromeFeatureList {
|
||||
public static final String TRUSTED_WEB_ACTIVITY_CONTACTS_DELEGATION =
|
||||
"TrustedWebActivityContactsDelegation";
|
||||
public static final String UMA_SESSION_CORRECTNESS_FIXES = "UmaSessionCorrectnessFixes";
|
||||
public static final String UNO_PHASE_2_FOLLOW_UP = "UnoPhase2FollowUp";
|
||||
public static final String UNPARCEL_INTENT_FILE_DESCRIPTORS = "UnparcelIntentFileDescriptors";
|
||||
public static final String UPDATE_COMPOSTIROR_FOR_SURFACE_CONTROL =
|
||||
"UpdateCompositorForSurfaceControl";
|
||||
@@ -727,17 +742,29 @@ public abstract class ChromeFeatureList {
|
||||
public static final CachedFlag sAndroidAnimatedProgressBarInBrowser =
|
||||
newCachedFlag(ANDROID_ANIMATED_PROGRESS_BAR_IN_BROWSER, true);
|
||||
public static final CachedFlag sAndroidApb144Patch1 = newCachedFlag(APB144_PATCH1, true);
|
||||
public static final CachedFlag sAndroidApb144Patch2 = newCachedFlag(APB144_PATCH2, true);
|
||||
public static final CachedFlag sAndroidApb144Patch3 = newCachedFlag(APB144_PATCH3, true);
|
||||
public static final CachedFlag sAndroidApb144Patch4 = newCachedFlag(APB144_PATCH4, true);
|
||||
public static final CachedFlag sAndroidApb144Patch5 = newCachedFlag(APB144_PATCH5, true);
|
||||
public static final CachedFlag sAndroidApb144Patch6 = newCachedFlag(APB144_PATCH6, true);
|
||||
public static final CachedFlag sAndroidApb144Patch7 = newCachedFlag(APB144_PATCH7, true);
|
||||
public static final CachedFlag sAndroidApb144Patch8 = newCachedFlag(APB144_PATCH8, true);
|
||||
public static final CachedFlag sAndroidApb144Patch9 = newCachedFlag(APB144_PATCH9, true);
|
||||
public static final CachedFlag sAndroidAppIntegrationModule =
|
||||
newCachedFlag(ANDROID_APP_INTEGRATION_MODULE, true);
|
||||
public static final CachedFlag sAndroidAppIntegrationMultiDataSource =
|
||||
newCachedFlag(ANDROID_APP_INTEGRATION_MULTI_DATA_SOURCE, true);
|
||||
public static final CachedFlag sAndroidAppRatingPrompt =
|
||||
newCachedFlag(
|
||||
ANDROID_APP_RATING_PROMPT,
|
||||
/* defaultValue= */ false,
|
||||
/* defaultValueInTests= */ true);
|
||||
public static final CachedFlag sAndroidAutoMintedTwa =
|
||||
newCachedFlag(ANDROID_AUTO_MINTED_TWA, false);
|
||||
public static final CachedFlag sAndroidBottomBar =
|
||||
newCachedFlag(ANDROID_BOTTOM_BAR, false, /* defaultValueInTests= */ false);
|
||||
public static final CachedFlag sAndroidBottomToolbarV2 =
|
||||
newCachedFlag(ANDROID_BOTTOM_TOOLBAR_V2, false, true);
|
||||
public static final CachedFlag sAndroidComposeplate = newCachedFlag(ANDROID_COMPOSEPLATE, true);
|
||||
public static final CachedFlag sAndroidComposeplateLFF =
|
||||
newCachedFlag(ANDROID_COMPOSEPLATE_LFF, /* defaultValue= */ true);
|
||||
public static final CachedFlag sAndroidDataImporterService =
|
||||
newCachedFlag(ANDROID_DATA_IMPORTER_SERVICE, true);
|
||||
public static final CachedFlag sAndroidDesktopDensity =
|
||||
@@ -748,15 +775,19 @@ public abstract class ChromeFeatureList {
|
||||
newCachedFlag(ANDROID_NEW_MEDIA_PICKER, false);
|
||||
public static final CachedFlag sAndroidOpenIncognitoAsWindow =
|
||||
newCachedFlag(ANDROID_OPEN_INCOGNITO_AS_WINDOW, BuildConfig.IS_DESKTOP_ANDROID, true);
|
||||
public static final CachedFlag sAndroidPageInfoAsAppMenuItem =
|
||||
newCachedFlag(ANDROID_PAGE_INFO_AS_APP_MENU_ITEM, false);
|
||||
public static final CachedFlag sAndroidProgressBarVisualUpdate =
|
||||
newCachedFlag(
|
||||
ANDROID_PROGRESS_BAR_VISUAL_UPDATE,
|
||||
/* defaultValue= */ false,
|
||||
/* defaultValueInTests= */ false);
|
||||
public static final CachedFlag sAndroidSelfOcclusionTracking =
|
||||
newCachedFlag(ANDROID_SELF_OCCLUSION_TRACKING, false);
|
||||
public static final CachedFlag sAndroidSettingsContainment =
|
||||
newCachedFlag(
|
||||
ANDROID_SETTINGS_CONTAINMENT,
|
||||
/* defaultValue= */ false,
|
||||
/* defaultValue= */ true,
|
||||
/* defaultValueInTests= */ true);
|
||||
public static final CachedFlag sAndroidSetupList =
|
||||
newCachedFlag(
|
||||
@@ -785,13 +816,15 @@ public abstract class ChromeFeatureList {
|
||||
/* defaultValue= */ false,
|
||||
/* defaultValueInTests= */ true);
|
||||
public static final CachedFlag sAndroidWindowPopupCustomTabUi =
|
||||
newCachedFlag(ANDROID_WINDOW_POPUP_CUSTOM_TAB_UI, false, true);
|
||||
newCachedFlag(ANDROID_WINDOW_POPUP_CUSTOM_TAB_UI, true);
|
||||
public static final CachedFlag sAndroidWindowPopupLargeScreen =
|
||||
newCachedFlag(ANDROID_WINDOW_POPUP_LARGE_SCREEN, false, true);
|
||||
newCachedFlag(ANDROID_WINDOW_POPUP_LARGE_SCREEN, true);
|
||||
public static final CachedFlag sAndroidWindowPopupPredictFinalBounds =
|
||||
newCachedFlag(ANDROID_WINDOW_POPUP_PREDICT_FINAL_BOUNDS, false, true);
|
||||
newCachedFlag(ANDROID_WINDOW_POPUP_PREDICT_FINAL_BOUNDS, true);
|
||||
public static final CachedFlag sAndroidWindowPopupResizeAfterSpawn =
|
||||
newCachedFlag(ANDROID_WINDOW_POPUP_RESIZE_AFTER_SPAWN, false, true);
|
||||
newCachedFlag(ANDROID_WINDOW_POPUP_RESIZE_AFTER_SPAWN, true);
|
||||
public static final CachedFlag sAndroidXrImmersivePlayer =
|
||||
newCachedFlag(ANDROID_XR_IMMERSIVE_PLAYER, false);
|
||||
public static final CachedFlag sAppSpecificHistory = newCachedFlag(APP_SPECIFIC_HISTORY, true);
|
||||
public static final CachedFlag sAppSpecificHistoryViewIntent =
|
||||
newCachedFlag(APP_SPECIFIC_HISTORY_VIEW_INTENT, true);
|
||||
@@ -856,6 +889,10 @@ public abstract class ChromeFeatureList {
|
||||
newCachedFlag(CCT_OPEN_IN_BROWSER_BUTTON_IF_ALLOWED_BY_EMBEDDER, false);
|
||||
public static final CachedFlag sCctOpenInBrowserButtonIfEnabledByEmbedder =
|
||||
newCachedFlag(CCT_OPEN_IN_BROWSER_BUTTON_IF_ENABLED_BY_EMBEDDER, true);
|
||||
public static final CachedFlag sCctPageContentRequestAllowed =
|
||||
newCachedFlag(CCT_PAGE_CONTENT_REQUEST_ALLOWED, true);
|
||||
public static final CachedFlag sCctPageContentRequestEnabled =
|
||||
newCachedFlag(CCT_PAGE_CONTENT_REQUEST_ENABLED, false);
|
||||
public static final CachedFlag sCctRealtimeEngagementEventsInBackground =
|
||||
newCachedFlag(CCT_REALTIME_ENGAGEMENT_EVENTS_IN_BACKGROUND, true);
|
||||
public static final CachedFlag sCctResetTimeoutAllowed =
|
||||
@@ -892,8 +929,6 @@ public abstract class ChromeFeatureList {
|
||||
DEFAULT_BROWSER_PROMO_ENTRY_POINT,
|
||||
/* defaultValue= */ false,
|
||||
/* defaultValueInTests= */ true);
|
||||
public static final CachedFlag sDefaultBrowserPromoFre =
|
||||
newCachedFlag(DEFAULT_BROWSER_PROMO_FRE, false);
|
||||
public static final CachedFlag sDesktopAndroidLinkCapturing =
|
||||
newCachedFlag(DESKTOP_ANDROID_LINK_CAPTURING, false);
|
||||
public static final CachedFlag sDesktopUAOnConnectedDisplay =
|
||||
@@ -920,7 +955,24 @@ public abstract class ChromeFeatureList {
|
||||
public static final CachedFlag sEducationalTipDefaultBrowserPromoCard =
|
||||
newCachedFlag(EDUCATIONAL_TIP_DEFAULT_BROWSER_PROMO_CARD, false, true);
|
||||
public static final CachedFlag sEnableAndroidSidePanel =
|
||||
newCachedFlag(ENABLE_ANDROID_SIDE_PANEL, false);
|
||||
newCachedFlag(
|
||||
ENABLE_ANDROID_SIDE_PANEL,
|
||||
/* defaultValue= */ false,
|
||||
// In http://crrev.com/c/7689838, "defaultValueInTests" was set to
|
||||
// true for testing purposes. Detailed reasons are in that CL's commit message.
|
||||
//
|
||||
// However, it caused the flag to be also enabled in non-official or
|
||||
// non-Chrome-branded browser app APKs on _mobile_ Android where there should be
|
||||
// no side panel (see CachedFlag.java for details).
|
||||
//
|
||||
// To avoid affecting non-official or non-Chrome-branded _mobile_ Android in
|
||||
// non-testing environments, we use BuildConfig.IS_FOR_TEST to truly limit the
|
||||
// "true" value in tests.
|
||||
//
|
||||
// In the long-term, this flag will be enabled for all form factors, and the
|
||||
// code behind it should decide whether the side panel UI should appear, based
|
||||
// on factors like window size.
|
||||
/* defaultValueInTests= */ BuildConfig.IS_FOR_TEST);
|
||||
public static final CachedFlag sEnableAndroidSidePanelDevFeature =
|
||||
newCachedFlag(ENABLE_ANDROID_SIDE_PANEL_DEV_FEATURE, false);
|
||||
public static final CachedFlag sEnableBrowserWindowInterfaceForCustomTabActivity =
|
||||
@@ -943,6 +995,11 @@ public abstract class ChromeFeatureList {
|
||||
newCachedFlag(FULLSCREEN_INSETS_API_MIGRATION_ON_AUTOMOTIVE, true);
|
||||
public static final CachedFlag sFullscreenVideoPictureInPicture =
|
||||
newCachedFlag(FULLSCREEN_VIDEO_PICTURE_IN_PICTURE, true);
|
||||
public static final CachedFlag sGestureUserEducationBackSwipe =
|
||||
newCachedFlag(
|
||||
GESTURE_USER_EDUCATION_BACK_SWIPE,
|
||||
/* defaultValue= */ false,
|
||||
/* defaultValueInTests= */ false);
|
||||
public static final CachedFlag sGlic = newCachedFlag(GLIC, false);
|
||||
public static final CachedFlag sGridTabSwitcherSurfaceColorUpdate =
|
||||
newCachedFlag(
|
||||
@@ -981,7 +1038,6 @@ public abstract class ChromeFeatureList {
|
||||
LOCK_TOP_CONTROLS_ON_LARGE_TABLETS_V2,
|
||||
/* defaultValue= */ false,
|
||||
/* defaultValueInTests= */ true);
|
||||
public static final CachedFlag sMagicStackAndroid = newCachedFlag(MAGIC_STACK_ANDROID, true);
|
||||
public static final CachedFlag sMaliciousApkDownloadCheck =
|
||||
newCachedFlag(
|
||||
MALICIOUS_APK_DOWNLOAD_CHECK,
|
||||
@@ -1000,7 +1056,7 @@ public abstract class ChromeFeatureList {
|
||||
/* defaultValue= */ false,
|
||||
/* defaultValueInTests= */ true);
|
||||
public static final CachedFlag sMultiInstanceSharedPrefsMigration =
|
||||
newCachedFlag(MULTI_INSTANCE_SHARED_PREFS_MIGRATION, false);
|
||||
newCachedFlag(MULTI_INSTANCE_SHARED_PREFS_MIGRATION, true);
|
||||
public static final CachedFlag sMvcUpdateViewWhenModelChanged =
|
||||
newCachedFlag(
|
||||
MVC_UPDATE_VIEW_WHEN_MODEL_CHANGED,
|
||||
@@ -1028,7 +1084,7 @@ public abstract class ChromeFeatureList {
|
||||
public static final CachedFlag sPCctMinimumHeight = newCachedFlag(PCCT_MINIMUM_HEIGHT, true);
|
||||
public static final CachedFlag sPaintPreviewDemo = newCachedFlag(PAINT_PREVIEW_DEMO, false);
|
||||
public static final CachedFlag sPersistAcrossReboots =
|
||||
newCachedFlag(PERSIST_ACROSS_REBOOTS, false);
|
||||
newCachedFlag(PERSIST_ACROSS_REBOOTS, true);
|
||||
public static final CachedFlag sPersistAcrossRebootsDebugLogs =
|
||||
newCachedFlag(PERSIST_ACROSS_REBOOTS_DEBUG_LOGS, false);
|
||||
public static final CachedFlag sPostGetMyMemoryStateToBackground =
|
||||
@@ -1092,6 +1148,11 @@ public abstract class ChromeFeatureList {
|
||||
public static final CachedFlag sTestDefaultDisabled =
|
||||
newCachedFlag(TEST_DEFAULT_DISABLED, false);
|
||||
public static final CachedFlag sTestDefaultEnabled = newCachedFlag(TEST_DEFAULT_ENABLED, true);
|
||||
public static final CachedFlag sThreeDotMenuBackButton =
|
||||
newCachedFlag(
|
||||
THREE_DOT_MENU_BACK_BUTTON,
|
||||
/* defaultValue= */ false,
|
||||
/* defaultValueInTests= */ false);
|
||||
public static final CachedFlag sToolbarPhoneAnimationRefactor =
|
||||
newCachedFlag(
|
||||
TOOLBAR_PHONE_ANIMATION_REFACTOR,
|
||||
@@ -1144,18 +1205,28 @@ public abstract class ChromeFeatureList {
|
||||
sAccountForSuppressedKeyboardInsets,
|
||||
sAndroidAnimatedProgressBarInBrowser,
|
||||
sAndroidApb144Patch1,
|
||||
sAndroidApb144Patch2,
|
||||
sAndroidApb144Patch3,
|
||||
sAndroidApb144Patch4,
|
||||
sAndroidApb144Patch5,
|
||||
sAndroidApb144Patch6,
|
||||
sAndroidApb144Patch7,
|
||||
sAndroidApb144Patch8,
|
||||
sAndroidApb144Patch9,
|
||||
sAndroidAppIntegrationModule,
|
||||
sAndroidAppIntegrationMultiDataSource,
|
||||
sAndroidAppRatingPrompt,
|
||||
sAndroidAutoMintedTwa,
|
||||
sAndroidBottomBar,
|
||||
sAndroidBottomToolbarV2,
|
||||
sAndroidComposeplate,
|
||||
sAndroidComposeplateLFF,
|
||||
sAndroidDataImporterService,
|
||||
sAndroidDesktopDensity,
|
||||
sAndroidElegantTextHeight,
|
||||
sAndroidNewMediaPicker,
|
||||
sAndroidOpenIncognitoAsWindow,
|
||||
sAndroidPageInfoAsAppMenuItem,
|
||||
sAndroidProgressBarVisualUpdate,
|
||||
sAndroidSelfOcclusionTracking,
|
||||
sAndroidSettingsContainment,
|
||||
sAndroidSetupList,
|
||||
sAndroidSurfaceColorUpdate,
|
||||
@@ -1171,6 +1242,7 @@ public abstract class ChromeFeatureList {
|
||||
sAndroidWindowPopupLargeScreen,
|
||||
sAndroidWindowPopupPredictFinalBounds,
|
||||
sAndroidWindowPopupResizeAfterSpawn,
|
||||
sAndroidXrImmersivePlayer,
|
||||
sAppSpecificHistory,
|
||||
sAppSpecificHistoryViewIntent,
|
||||
sAsyncNotificationManager,
|
||||
@@ -1199,6 +1271,8 @@ public abstract class ChromeFeatureList {
|
||||
sCctNestedSecurityIcon,
|
||||
sCctOpenInBrowserButtonIfAllowedByEmbedder,
|
||||
sCctOpenInBrowserButtonIfEnabledByEmbedder,
|
||||
sCctPageContentRequestAllowed,
|
||||
sCctPageContentRequestEnabled,
|
||||
sCctRealtimeEngagementEventsInBackground,
|
||||
sCctResetTimeoutAllowed,
|
||||
sCctResetTimeoutEnabled,
|
||||
@@ -1215,7 +1289,6 @@ public abstract class ChromeFeatureList {
|
||||
sCpaTabGroupingButton,
|
||||
sCrossDeviceTabPaneAndroid,
|
||||
sDefaultBrowserPromoEntryPoint,
|
||||
sDefaultBrowserPromoFre,
|
||||
sDesktopAndroidLinkCapturing,
|
||||
sDesktopUAOnConnectedDisplay,
|
||||
sDocumentPictureInPictureAPI,
|
||||
@@ -1238,6 +1311,7 @@ public abstract class ChromeFeatureList {
|
||||
sFullscreenInsetsApiMigration,
|
||||
sFullscreenInsetsApiMigrationOnAutomotive,
|
||||
sFullscreenVideoPictureInPicture,
|
||||
sGestureUserEducationBackSwipe,
|
||||
sGlic,
|
||||
sGridTabSwitcherSurfaceColorUpdate,
|
||||
sHistoryPaneAndroid,
|
||||
@@ -1248,7 +1322,6 @@ public abstract class ChromeFeatureList {
|
||||
sLoadNativeEarly,
|
||||
sLockBackPressHandlerAtStart,
|
||||
sLockTopControlsOnLargeTabletsV2,
|
||||
sMagicStackAndroid,
|
||||
sMaliciousApkDownloadCheck,
|
||||
sMostVisitedTilesCustomization,
|
||||
sMostVisitedTilesReselect,
|
||||
@@ -1288,6 +1361,7 @@ public abstract class ChromeFeatureList {
|
||||
sTabStorageSqlitePrototype,
|
||||
sTabStripDensityChangeAndroid,
|
||||
sTabWindowManagerReportIndicesMismatch,
|
||||
sThreeDotMenuBackButton,
|
||||
sToolbarPhoneAnimationRefactor,
|
||||
sToolbarSnapshotRefactor,
|
||||
sToolbarStaleCaptureBugFix,
|
||||
@@ -1331,14 +1405,12 @@ public abstract class ChromeFeatureList {
|
||||
newMutableFlagWithSafeDefault(ANDROID_BOOKMARK_BAR_FAST_FOLLOW, true);
|
||||
public static final MutableFlagWithSafeDefault sAndroidContextMenuDuplicateTabs =
|
||||
newMutableFlagWithSafeDefault(ANDROID_CONTEXT_MENU_DUPLICATE_TABS, false);
|
||||
public static final MutableFlagWithSafeDefault sAndroidPinnedTabs =
|
||||
newMutableFlagWithSafeDefault(ANDROID_PINNED_TABS, true);
|
||||
public static final MutableFlagWithSafeDefault sAndroidPinnedTabsTabletTabStrip =
|
||||
newMutableFlagWithSafeDefault(ANDROID_PINNED_TABS_TABLET_TAB_STRIP, true);
|
||||
public static final MutableFlagWithSafeDefault sAndroidTipsNotifications =
|
||||
newMutableFlagWithSafeDefault(ANDROID_TIPS_NOTIFICATIONS, false);
|
||||
public static final MutableFlagWithSafeDefault sAndroidTipsNotificationsV2 =
|
||||
newMutableFlagWithSafeDefault(ANDROID_TIPS_NOTIFICATIONS_V2, false);
|
||||
public static final MutableFlagWithSafeDefault sAndroidZoomImmersive =
|
||||
newMutableFlagWithSafeDefault(ANDROID_ZOOM_IMMERSIVE, false);
|
||||
public static final MutableFlagWithSafeDefault sBrowserControlsEarlyResize =
|
||||
newMutableFlagWithSafeDefault(BROWSER_CONTROLS_EARLY_RESIZE, false);
|
||||
public static final MutableFlagWithSafeDefault sBrowserControlsPersistsOnCvh =
|
||||
@@ -1347,9 +1419,9 @@ public abstract class ChromeFeatureList {
|
||||
public static final MutableFlagWithSafeDefault sBrowserControlsRenderDrivenShowConstraint =
|
||||
newMutableFlagWithSafeDefault(BROWSER_CONTROLS_RENDER_DRIVEN_SHOW_CONSTRAINT, false);
|
||||
public static final MutableFlagWithSafeDefault sBrowserWindowInterfaceMobile =
|
||||
newMutableFlagWithSafeDefault(BROWSER_WINDOW_INTERFACE_MOBILE, false);
|
||||
newMutableFlagWithSafeDefault(BROWSER_WINDOW_INTERFACE_MOBILE, true);
|
||||
public static final MutableFlagWithSafeDefault sCompositorViewHolderObscuring =
|
||||
newMutableFlagWithSafeDefault(COMPOSITOR_VIEW_HOLDER_OBSCURING, true);
|
||||
newMutableFlagWithSafeDefault(COMPOSITOR_VIEW_HOLDER_OBSCURING, false);
|
||||
public static final MutableFlagWithSafeDefault sControlsVisibilityFromNavigations =
|
||||
newMutableFlagWithSafeDefault(CONTROLS_VISIBILITY_FROM_NAVIGATIONS, true);
|
||||
// Defaulted to true in native, but since it is being used as a kill switch set the default
|
||||
@@ -1363,11 +1435,13 @@ public abstract class ChromeFeatureList {
|
||||
public static final MutableFlagWithSafeDefault sEnableToolbarPositioningInResizeMode =
|
||||
newMutableFlagWithSafeDefault(ENABLE_TOOLBAR_POSITIONING_IN_RESIZE_MODE, true);
|
||||
public static final MutableFlagWithSafeDefault sEscCancelDrag =
|
||||
newMutableFlagWithSafeDefault(ESC_CANCEL_DRAG, false);
|
||||
newMutableFlagWithSafeDefault(ESC_CANCEL_DRAG, true);
|
||||
public static final MutableFlagWithSafeDefault sIncognitoNtpSmallIcon =
|
||||
newMutableFlagWithSafeDefault(INCOGNITO_NTP_SMALL_ICON, false);
|
||||
public static final MutableFlagWithSafeDefault sIncognitoScreenshot =
|
||||
newMutableFlagWithSafeDefault(INCOGNITO_SCREENSHOT, false);
|
||||
public static final MutableFlagWithSafeDefault sInlinePdfV2 =
|
||||
newMutableFlagWithSafeDefault(INLINE_PDF_V2, false);
|
||||
public static final MutableFlagWithSafeDefault sLockTopControlsOnLargeTablets =
|
||||
newMutableFlagWithSafeDefault(LOCK_TOP_CONTROLS_ON_LARGE_TABLETS, false);
|
||||
public static final MutableFlagWithSafeDefault sMediaIndicatorsAndroid =
|
||||
@@ -1378,15 +1452,13 @@ public abstract class ChromeFeatureList {
|
||||
newMutableFlagWithSafeDefault(OMNIBOX_AUTOFOCUS_ON_INCOGNITO_NTP, false);
|
||||
public static final MutableFlagWithSafeDefault sOnDemandBackgroundTabContextCapture =
|
||||
newMutableFlagWithSafeDefault(ON_DEMAND_BACKGROUND_TAB_CONTEXT_CAPTURE, false);
|
||||
public static final MutableFlagWithSafeDefault sRecentlyClosedTabsAndWindows =
|
||||
newMutableFlagWithSafeDefault(RECENTLY_CLOSED_TABS_AND_WINDOWS, true);
|
||||
public static final MutableFlagWithSafeDefault sRecordIncognitoNtpTimeToFirstNavigationMetric =
|
||||
newMutableFlagWithSafeDefault(
|
||||
RECORD_INCOGNITO_NTP_TIME_TO_FIRST_NAVIGATION_METRIC, true);
|
||||
public static final MutableFlagWithSafeDefault sRecordSuppressionMetrics =
|
||||
newMutableFlagWithSafeDefault(RECORD_SUPPRESSION_METRICS, true);
|
||||
public static final MutableFlagWithSafeDefault sRobustWindowManagement =
|
||||
newMutableFlagWithSafeDefault(ROBUST_WINDOW_MANAGEMENT, true);
|
||||
public static final MutableFlagWithSafeDefault sScheduleWindowCleaning =
|
||||
newMutableFlagWithSafeDefault(SCHEDULE_WINDOW_CLEANING, false);
|
||||
public static final MutableFlagWithSafeDefault sShowTabListAnimations =
|
||||
newMutableFlagWithSafeDefault(SHOW_TAB_LIST_ANIMATIONS, false);
|
||||
public static final MutableFlagWithSafeDefault sSuppressToolbarCapturesAtGestureEnd =
|
||||
@@ -1431,6 +1503,9 @@ public abstract class ChromeFeatureList {
|
||||
public static final BooleanCachedFeatureParam sAndroidAppIntegrationModuleShowThirdPartyCard =
|
||||
newBooleanCachedFeatureParam(
|
||||
ANDROID_APP_INTEGRATION_MODULE, "show_third_party_card", false);
|
||||
|
||||
public static final BooleanCachedFeatureParam sAndroidAppRatingPromptBypassChecks =
|
||||
newBooleanCachedFeatureParam(ANDROID_APP_RATING_PROMPT, "bypass_checks", false);
|
||||
public static final BooleanCachedFeatureParam
|
||||
sAndroidAppIntegrationMultiDataSourceSkipSchemaCheck =
|
||||
newBooleanCachedFeatureParam(
|
||||
@@ -1447,8 +1522,12 @@ public abstract class ChromeFeatureList {
|
||||
public static final BooleanCachedFeatureParam sAndroidBookmarkBarShowBookmarkBar =
|
||||
newBooleanCachedFeatureParam(ANDROID_BOOKMARK_BAR, "show_bookmark_bar", false);
|
||||
|
||||
public static final BooleanCachedFeatureParam sAndroidComposeplateSkipLocaleCheck =
|
||||
newBooleanCachedFeatureParam(ANDROID_COMPOSEPLATE, "skip_locale_check", false);
|
||||
public static final BooleanCachedFeatureParam sAndroidBottomBarKeepAppMenuInToolbar =
|
||||
newBooleanCachedFeatureParam(ANDROID_BOTTOM_BAR, "keep_app_menu_in_toolbar", false);
|
||||
public static final BooleanCachedFeatureParam sAndroidBottomBarKeepHomeButtonInToolbar =
|
||||
newBooleanCachedFeatureParam(ANDROID_BOTTOM_BAR, "keep_home_button_in_toolbar", false);
|
||||
public static final BooleanCachedFeatureParam sAndroidBottomBarShowBottomBarOnGts =
|
||||
newBooleanCachedFeatureParam(ANDROID_BOTTOM_BAR, "show_bottom_bar_on_gts", false);
|
||||
|
||||
public static final BooleanCachedFeatureParam
|
||||
sAndroidBottomToolbarV2ForceBottomForFocusedOmnibox =
|
||||
@@ -1459,6 +1538,17 @@ public abstract class ChromeFeatureList {
|
||||
newBooleanCachedFeatureParam(
|
||||
ANDROID_BOTTOM_TOOLBAR_V2, "reverse_order_suggestions_list", false);
|
||||
|
||||
public static final BooleanCachedFeatureParam sAndroidSelfOcclusionTrackingForwarding =
|
||||
newBooleanCachedFeatureParam(
|
||||
ANDROID_SELF_OCCLUSION_TRACKING, "occlusion_state_forwarding", false);
|
||||
|
||||
public static final IntCachedFeatureParam
|
||||
sAndroidSelfOcclusionTrackingMinimumVisibilitySizeThreshold =
|
||||
newIntCachedFeatureParam(
|
||||
ANDROID_SELF_OCCLUSION_TRACKING,
|
||||
"minimum_visibility_size_threshold",
|
||||
0);
|
||||
|
||||
public static final IntCachedFeatureParam sBackgroundThreadPoolFieldTrialConfig =
|
||||
newIntCachedFeatureParam(BACKGROUND_THREAD_POOL_FIELD_TRIAL, "config", 4);
|
||||
|
||||
@@ -1563,10 +1653,6 @@ public abstract class ChromeFeatureList {
|
||||
newStringCachedFeatureParam(
|
||||
CCT_RESIZABLE_FOR_THIRD_PARTIES, "default_policy", "use-denylist");
|
||||
|
||||
public static final StringCachedFeatureParam sDefaultBrowserPromoFreArm =
|
||||
newStringCachedFeatureParam(
|
||||
DEFAULT_BROWSER_PROMO_FRE, "fre_promo_arm", "rmd_direct_invocation");
|
||||
|
||||
/**
|
||||
* A cached parameter representing the amount of latency to inject during Clank startup based on
|
||||
* experiment configuration.
|
||||
@@ -1619,14 +1705,6 @@ public abstract class ChromeFeatureList {
|
||||
public static final BooleanCachedFeatureParam sNewTabPageCustomizationV2EnableLogs =
|
||||
newBooleanCachedFeatureParam(NEW_TAB_PAGE_CUSTOMIZATION_V2, "enable_logs", false);
|
||||
|
||||
/**
|
||||
* Param for the OEMs that need an exception for min versions. Its value should be a comma
|
||||
* separated list of integers, and its index should match {@link #sEdgeToEdgeBottomChinOemList}.
|
||||
*/
|
||||
public static final StringCachedFeatureParam sEdgeToEdgeBottomChinOemMinVersions =
|
||||
newStringCachedFeatureParam(
|
||||
EDGE_TO_EDGE_BOTTOM_CHIN, "e2e_field_trial_oem_min_versions", "34,34");
|
||||
|
||||
public static final StringCachedFeatureParam sEdgeToEdgeEverywhereOemMinVersions =
|
||||
newStringCachedFeatureParam(
|
||||
EDGE_TO_EDGE_EVERYWHERE, "e2e_field_trial_oem_min_versions", "35");
|
||||
@@ -1637,15 +1715,6 @@ public abstract class ChromeFeatureList {
|
||||
"e2e_backup_navbar_insets_oem_min_versions",
|
||||
"");
|
||||
|
||||
/**
|
||||
* Param for the OEMs that need an exception for min versions. Its value should be a comma
|
||||
* separated list of manufacturer, and its index should match {@link
|
||||
* #sEdgeToEdgeBottomChinOemMinVersions}.
|
||||
*/
|
||||
public static final StringCachedFeatureParam sEdgeToEdgeBottomChinOemList =
|
||||
newStringCachedFeatureParam(
|
||||
EDGE_TO_EDGE_BOTTOM_CHIN, "e2e_field_trial_oem_list", "oppo,xiaomi");
|
||||
|
||||
public static final StringCachedFeatureParam sEdgeToEdgeEverywhereOemList =
|
||||
newStringCachedFeatureParam(
|
||||
EDGE_TO_EDGE_EVERYWHERE, "e2e_field_trial_oem_list", "realme");
|
||||
@@ -1672,8 +1741,6 @@ public abstract class ChromeFeatureList {
|
||||
newBooleanCachedFeatureParam(
|
||||
GRID_TAB_SWITCHER_SURFACE_COLOR_UPDATE, "tab_group_list_containment", true);
|
||||
|
||||
public static final BooleanCachedFeatureParam sMagicStackAndroidShowAllModules =
|
||||
newBooleanCachedFeatureParam(MAGIC_STACK_ANDROID, "show_all_modules", false);
|
||||
public static final BooleanCachedFeatureParam sMaliciousApkDownloadCheckTelemetryOnly =
|
||||
newBooleanCachedFeatureParam(MALICIOUS_APK_DOWNLOAD_CHECK, "telemetry_only", false);
|
||||
public static final BooleanCachedFeatureParam sMostVisitedTilesReselectLaxSchemeHost =
|
||||
@@ -1735,14 +1802,8 @@ public abstract class ChromeFeatureList {
|
||||
"start_surface_return_time_on_tablet_seconds",
|
||||
14400); // 4 hours
|
||||
|
||||
public static final BooleanCachedFeatureParam sTabStorageSqlitePrototypeAllowFullMigration =
|
||||
newBooleanCachedFeatureParam(
|
||||
TAB_STORAGE_SQLITE_PROTOTYPE, "allow_full_migration", false);
|
||||
|
||||
public static final BooleanCachedFeatureParam
|
||||
sTabStorageSqlitePrototypeAuthoritativeReadSource =
|
||||
newBooleanCachedFeatureParam(
|
||||
TAB_STORAGE_SQLITE_PROTOTYPE, "authoritative_read_source", false);
|
||||
public static final StringCachedFeatureParam sTabStorageSqlitePrototypePhase =
|
||||
newStringCachedFeatureParam(TAB_STORAGE_SQLITE_PROTOTYPE, "phase", "");
|
||||
|
||||
public static final IntCachedFeatureParam
|
||||
sTabWindowManagerReportIndicesMismatchTimeDiffThresholdMs =
|
||||
@@ -1784,10 +1845,15 @@ public abstract class ChromeFeatureList {
|
||||
sAndroidAppIntegrationModuleShowThirdPartyCard,
|
||||
sAndroidAppIntegrationMultiDataSourceSkipDeviceCheck,
|
||||
sAndroidAppIntegrationMultiDataSourceSkipSchemaCheck,
|
||||
sAndroidAppRatingPromptBypassChecks,
|
||||
sAndroidBookmarkBarShowBookmarkBar,
|
||||
sAndroidBottomBarKeepAppMenuInToolbar,
|
||||
sAndroidBottomBarKeepHomeButtonInToolbar,
|
||||
sAndroidBottomBarShowBottomBarOnGts,
|
||||
sAndroidBottomToolbarV2ForceBottomForFocusedOmnibox,
|
||||
sAndroidBottomToolbarV2ReverseOrderSuggestionsList,
|
||||
sAndroidComposeplateSkipLocaleCheck,
|
||||
sAndroidSelfOcclusionTrackingForwarding,
|
||||
sAndroidSelfOcclusionTrackingMinimumVisibilitySizeThreshold,
|
||||
sAndroidThemeModuleForceDependencies,
|
||||
sAndroidThemeResourceProviderForceLight,
|
||||
sAndroidTipsNotificationsAlwaysShowOptInPromo,
|
||||
@@ -1813,10 +1879,7 @@ public abstract class ChromeFeatureList {
|
||||
sClampAutomotiveScalingMaxScalingPercentage,
|
||||
sClankStartupLatencyInjectionAmountMs,
|
||||
sDefaultBrowserPromoEntryPointShowAppMenu,
|
||||
sDefaultBrowserPromoFreArm,
|
||||
sDesktopUAAllowedOnExternalDisplayForOem,
|
||||
sEdgeToEdgeBottomChinOemList,
|
||||
sEdgeToEdgeBottomChinOemMinVersions,
|
||||
sEdgeToEdgeEverywhereOemList,
|
||||
sEdgeToEdgeEverywhereOemMinVersions,
|
||||
sEdgeToEdgeTabletInvisibleBottomChinMinWidth,
|
||||
@@ -1827,7 +1890,6 @@ public abstract class ChromeFeatureList {
|
||||
sInitFeatureListEarly,
|
||||
sLockTopControlsForceAdjustHeightOnStartup,
|
||||
sLowMemoryDeviceThresholdMb,
|
||||
sMagicStackAndroidShowAllModules,
|
||||
sMaliciousApkDownloadCheckTelemetryOnly,
|
||||
sMostVisitedTilesReselectLaxPath,
|
||||
sMostVisitedTilesReselectLaxQuery,
|
||||
@@ -1852,8 +1914,7 @@ public abstract class ChromeFeatureList {
|
||||
sShouldConsiderLanguageInOverviewReadability,
|
||||
sStartSurfaceReturnTimeTabletSecs,
|
||||
sTabGroupListContainment,
|
||||
sTabStorageSqlitePrototypeAllowFullMigration,
|
||||
sTabStorageSqlitePrototypeAuthoritativeReadSource,
|
||||
sTabStorageSqlitePrototypePhase,
|
||||
sTabWindowManagerReportIndicesMismatchTimeDiffThresholdMs,
|
||||
sTopControlsRefactorNarrowWidthTransitionThreshold,
|
||||
sTouchToSearchCalloutIph,
|
||||
@@ -1866,13 +1927,6 @@ public abstract class ChromeFeatureList {
|
||||
// Mutable*ParamWithSafeDefault instances.
|
||||
/* Alphabetical: */
|
||||
|
||||
public static final MutableBooleanParamWithSafeDefault sAndroidPinnedTabsSearchBoxMovement =
|
||||
sAndroidPinnedTabs.newBooleanParam("search_box_movement", true);
|
||||
|
||||
public static final MutableBooleanParamWithSafeDefault
|
||||
sAndroidPinnedTabsSearchBoxSquishAnimation =
|
||||
sAndroidPinnedTabs.newBooleanParam("search_box_squish_animation", true);
|
||||
|
||||
public static final MutableBooleanParamWithSafeDefault
|
||||
sOmniboxAutofocusOnIncognitoNtpNotFirstTab =
|
||||
sOmniboxAutofocusOnIncognitoNtp.newBooleanParam("not_first_tab", false);
|
||||
@@ -1894,7 +1948,4 @@ public abstract class ChromeFeatureList {
|
||||
sTabBottomSheet.newBooleanParam("dont_show_fusebox", false);
|
||||
public static final MutableBooleanParamWithSafeDefault sTabBottomSheetResizeWebview =
|
||||
sTabBottomSheet.newBooleanParam("resize_webview", false);
|
||||
|
||||
public static final MutableBooleanParamWithSafeDefault sRobustWindowManagementBulkClose =
|
||||
sRobustWindowManagement.newBooleanParam("bulk_close", true);
|
||||
}
|
||||
|
||||
@@ -25,14 +25,15 @@
|
||||
#include "chrome/browser/browser_process_impl.h"
|
||||
#include "chrome/browser/chrome_content_browser_client.h"
|
||||
#include "chrome/browser/component_updater/component_updater_prefs.h"
|
||||
#include "chrome/browser/contextual_cueing/contextual_cueing_prefs.h"
|
||||
#include "chrome/browser/download/download_prefs.h"
|
||||
#include "chrome/browser/engagement/important_sites_util.h"
|
||||
#include "chrome/browser/enterprise/reporting/prefs.h"
|
||||
#include "chrome/browser/enterprise/util/managed_browser_utils.h"
|
||||
#include "chrome/browser/external_protocol/external_protocol_handler.h"
|
||||
#include "chrome/browser/finds/core/finds_service.h"
|
||||
#include "chrome/browser/first_run/first_run.h"
|
||||
#include "chrome/browser/glic/glic_pref_names.h"
|
||||
#include "chrome/browser/glic/suggestions/contextual_cueing_prefs.h"
|
||||
#include "chrome/browser/gpu/gpu_mode_manager.h"
|
||||
#include "chrome/browser/lifetime/browser_shutdown.h"
|
||||
#include "chrome/browser/login_detection/login_detection_prefs.h"
|
||||
@@ -186,7 +187,6 @@
|
||||
#include "components/subresource_filter/content/browser/ruleset_service.h"
|
||||
#include "components/subresource_filter/core/common/constants.h"
|
||||
#include "components/supervised_user/core/browser/supervised_user_preferences.h"
|
||||
#include "components/supervised_user/core/common/pref_names.h"
|
||||
#include "components/sync/base/pref_names.h"
|
||||
#include "components/sync/service/device_statistics_scheduler.h"
|
||||
#include "components/sync/service/glue/sync_transport_data_prefs.h"
|
||||
@@ -242,6 +242,10 @@
|
||||
|
||||
#include "chrome/browser/media/unified_autoplay_config.h"
|
||||
|
||||
#if !BUILDFLAG(IS_ANDROID) || BUILDFLAG(ENABLE_EXTENSIONS_CORE)
|
||||
#include "chrome/browser/ui/webui/management/management_ui.h"
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
#include "chrome/browser/accessibility/accessibility_prefs/android/accessibility_prefs_controller.h"
|
||||
#include "chrome/browser/android/ntp/recent_tabs_page_prefs.h"
|
||||
@@ -275,7 +279,6 @@
|
||||
#include "chrome/browser/nearby_sharing/common/nearby_share_prefs.h"
|
||||
#include "chrome/browser/new_tab_page/modules/file_suggestion/drive_service.h"
|
||||
#include "chrome/browser/new_tab_page/modules/file_suggestion/microsoft_files_page_handler.h"
|
||||
#include "chrome/browser/new_tab_page/modules/safe_browsing/safe_browsing_handler.h"
|
||||
#include "chrome/browser/new_tab_page/modules/v2/authentication/microsoft_auth_page_handler.h"
|
||||
#include "chrome/browser/new_tab_page/modules/v2/calendar/google_calendar_page_handler.h"
|
||||
#include "chrome/browser/new_tab_page/modules/v2/calendar/outlook_calendar_page_handler.h"
|
||||
@@ -293,14 +296,12 @@
|
||||
#include "chrome/browser/ui/send_tab_to_self/send_tab_to_self_bubble.h"
|
||||
#include "chrome/browser/ui/side_panel/side_panel_prefs.h"
|
||||
#include "chrome/browser/ui/startup/startup_browser_creator.h"
|
||||
#include "chrome/browser/ui/tabs/organization/prefs.h"
|
||||
#include "chrome/browser/ui/tabs/pinned_tab_codec.h"
|
||||
#include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_pref_names.h"
|
||||
#include "chrome/browser/ui/tabs/tab_strip_prefs.h"
|
||||
#include "chrome/browser/ui/webui/certificate_manager/certificate_manager_handler.h"
|
||||
#include "chrome/browser/ui/webui/cr_components/theme_color_picker/theme_color_picker_handler.h"
|
||||
#include "chrome/browser/ui/webui/history/foreign_session_handler.h"
|
||||
#include "chrome/browser/ui/webui/management/management_ui.h"
|
||||
#include "chrome/browser/ui/webui/new_tab_footer/new_tab_footer_ui.h"
|
||||
#include "chrome/browser/ui/webui/new_tab_page/new_tab_page_handler.h"
|
||||
#include "chrome/browser/ui/webui/new_tab_page/new_tab_page_ui.h"
|
||||
@@ -328,6 +329,7 @@
|
||||
#include "ash/constants/ash_constants.h"
|
||||
#include "ash/constants/ash_pref_names.h"
|
||||
#include "ash/public/cpp/ash_prefs.h"
|
||||
#include "base/check_deref.h"
|
||||
#include "chrome/browser/apps/app_discovery_service/almanac_fetcher.h"
|
||||
#include "chrome/browser/apps/app_preload_service/app_preload_service.h"
|
||||
#include "chrome/browser/apps/app_service/metrics/app_platform_metrics_service.h"
|
||||
@@ -374,6 +376,7 @@
|
||||
#include "chrome/browser/ash/login/reporting/login_logout_reporter.h"
|
||||
#include "chrome/browser/ash/login/saml/saml_profile_prefs.h"
|
||||
#include "chrome/browser/ash/login/screens/enable_adb_sideloading_screen.h"
|
||||
#include "chrome/browser/ash/login/screens/hid_detection_screen.h"
|
||||
#include "chrome/browser/ash/login/screens/reset_screen.h"
|
||||
#include "chrome/browser/ash/login/security_token_session_controller.h"
|
||||
#include "chrome/browser/ash/login/session/chrome_session_manager.h"
|
||||
@@ -401,6 +404,7 @@
|
||||
#include "chrome/browser/ash/policy/handlers/tpm_auto_update_mode_policy_handler.h"
|
||||
#include "chrome/browser/ash/policy/networking/euicc_status_uploader.h"
|
||||
#include "chrome/browser/ash/policy/remote_commands/crd/crd_admin_session_controller.h"
|
||||
#include "chrome/browser/ash/policy/remote_commands/device_command_query_geolocation_job.h"
|
||||
#include "chrome/browser/ash/policy/reporting/app_install_event_log_manager_wrapper.h"
|
||||
#include "chrome/browser/ash/policy/reporting/arc_app_install_event_logger.h"
|
||||
#include "chrome/browser/ash/policy/reporting/metrics_reporting/metric_reporting_prefs.h"
|
||||
@@ -497,10 +501,13 @@
|
||||
#include "chrome/browser/webnn/webnn_prefs.h"
|
||||
#endif // BUILDFLAG(IS_WIN)
|
||||
|
||||
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
|
||||
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_ANDROID)
|
||||
#include "chrome/browser/enterprise/platform_auth/platform_auth_policy_observer.h"
|
||||
#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_ANDROID)
|
||||
|
||||
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
|
||||
#include "components/os_crypt/sync/os_crypt.h" // nogncheck
|
||||
#endif
|
||||
#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
|
||||
|
||||
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
|
||||
BUILDFLAG(IS_CHROMEOS)
|
||||
@@ -517,7 +524,7 @@
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(ENABLE_DOWNGRADE_PROCESSING)
|
||||
#include "chrome/browser/downgrade/downgrade_prefs.h"
|
||||
#include "chrome/browser/downgrade/downgrade_prefs.h" // nogncheck
|
||||
#endif
|
||||
|
||||
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS)
|
||||
@@ -556,81 +563,6 @@ namespace {
|
||||
// Please keep the list of deprecated prefs in chronological order. i.e. Add to
|
||||
// the bottom of the list, not here at the top.
|
||||
|
||||
// Deprecated 01/2025.
|
||||
inline constexpr char kCompactModeEnabled[] = "compact_mode";
|
||||
|
||||
// Deprecated 01/2025.
|
||||
inline constexpr char kSafeBrowsingAutomaticDeepScanningIPHSeen[] =
|
||||
"safebrowsing.automatic_deep_scanning_iph_seen";
|
||||
inline constexpr char kSafeBrowsingAutomaticDeepScanPerformed[] =
|
||||
"safe_browsing.automatic_deep_scan_performed";
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
// Deprecated 01/2025.
|
||||
inline constexpr char kUsedPolicyCertificates[] =
|
||||
"policy.used_policy_certificates";
|
||||
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||
|
||||
// Deprecated 02/2025.
|
||||
inline constexpr char kUserAgentClientHintsGREASEUpdateEnabled[] =
|
||||
"policy.user_agent_client_hints_grease_update_enabled";
|
||||
|
||||
// Deprecated 02/2025.
|
||||
inline constexpr char kDefaultSearchProviderKeywordsUseExtendedList[] =
|
||||
"default_search_provider.keywords_use_extended_list";
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
// Deprecated 2/2025.
|
||||
inline constexpr char kLocalPasswordsMigrationWarningShownTimestamp[] =
|
||||
"local_passwords_migration_warning_shown_timestamp";
|
||||
inline constexpr char kLocalPasswordMigrationWarningShownAtStartup[] =
|
||||
"local_passwords_migration_warning_shown_at_startup";
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
// Deprecated 2/2025.
|
||||
inline constexpr char kLiveCaptionUserMicrophoneEnabled[] =
|
||||
"accessibility.captions.user_microphone_captioning_enabled";
|
||||
inline constexpr char kUserMicrophoneCaptionLanguageCode[] =
|
||||
"accessibility.captions.user_microphone_language_code";
|
||||
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||
|
||||
// Deprecated 03/2025.
|
||||
inline constexpr char kPasswordChangeFlowNoticeAgreement[] =
|
||||
"password_manager.password_change_flow_notice_agreement";
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
// Deprecated 02/2025.
|
||||
constexpr char kScannerFeedbackEnabled[] = "ash.scanner.feedback_enabled";
|
||||
constexpr char kHmrFeedbackAllowed[] = "settings.mahi_feedback_allowed";
|
||||
constexpr char kSharedStorage[] = "shared_storage";
|
||||
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
// Deprecated 02/2025.
|
||||
inline constexpr char kRootSecretPrefName[] =
|
||||
"webauthn.authenticator_root_secret";
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
// Deprecated 03/2025.
|
||||
inline constexpr char kShouldAutoEnroll[] = "ShouldAutoEnroll";
|
||||
inline constexpr char kShouldRetrieveDeviceState[] =
|
||||
"ShouldRetrieveDeviceState";
|
||||
inline constexpr char kAutoEnrollmentPowerLimit[] = "AutoEnrollmentPowerLimit";
|
||||
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
// Deprecated 03/2025.
|
||||
inline constexpr char kDeviceRestrictionScheduleHighestSeenTime[] =
|
||||
"device_restriction_schedule_highest_seen_time";
|
||||
constexpr char kSunfishEnabled[] = "ash.capture_mode.sunfish_enabled";
|
||||
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||
|
||||
// Deprecated 03/2025.
|
||||
inline constexpr char kRecurrentSSLInterstitial[] =
|
||||
"profile.ssl_recurrent_interstitial";
|
||||
|
||||
// Deprecated 04/2025.
|
||||
inline constexpr char kDefaultSearchProviderChoiceScreenShuffleMilestone[] =
|
||||
"default_search_provider.choice_screen_shuffle_milestone";
|
||||
@@ -1003,30 +935,50 @@ constexpr char kTabOrganizationFeature[] = "tab_organization.feature";
|
||||
// Deprecated 03/2026.
|
||||
constexpr char kTabDeclutterUsageCount[] = "tab_declutter.usage_count";
|
||||
|
||||
// Deprecated 03/2026.
|
||||
inline constexpr char kTabSearchTabIndex[] = "tab_search.tab_index";
|
||||
|
||||
// Deprecated 03/2026.
|
||||
constexpr char kGlicMultiInstanceEnabledBySubscriptionTier[] =
|
||||
"glic.multi_instance_enabled_by_tier";
|
||||
|
||||
// Deprecated 03/2026
|
||||
constexpr char kSigninFromBookmarksBubbleSyntheticTrialGroupNamePref[] =
|
||||
"UnoDesktopBookmarksEnabledInAccountFromBubbleGroup";
|
||||
constexpr char kBookmarksBubblePromoShownSyntheticTrialGroupNamePref[] =
|
||||
"UnoDesktopBookmarksBubblePromoShownGroup";
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
// Deprecated 03/2026.
|
||||
constexpr char kPrivacySandboxActivityTypeRecord2[] =
|
||||
"privacy_sandbox.activity_type.record2";
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
|
||||
// Deprecated 03/2026.
|
||||
constexpr char kTabOrganizationNudgeBackoffCount[] =
|
||||
"tab_organization.nudge_backoff_count";
|
||||
constexpr char kTabOrganizationShowFRE[] = "tab_organization.show_fre_2";
|
||||
constexpr char kTabOrganizationModelStrategy[] =
|
||||
"tab_organization.model_strategy";
|
||||
|
||||
// Deprecated 03/2026.
|
||||
constexpr char kNtpContextMenuClickCount[] = "ntp.context_menu_click_count";
|
||||
|
||||
// Deprecated 03/2026.
|
||||
constexpr char kNtpPromoPrefLastSnoozed[] =
|
||||
"in_product_help.ntp_promos.last_snoozed";
|
||||
|
||||
// Deprecated 03/2026.
|
||||
constexpr char kSafeBrowsingModuleShownCount[] =
|
||||
"safebrowsing.ntp.module_shown_count";
|
||||
constexpr char kSafeBrowsingModuleLastCooldownStartAt[] =
|
||||
"safebrowsing.ntp.last_cooldown_start_timestamp";
|
||||
constexpr char kSafeBrowsingModuleOpened[] =
|
||||
"safebrowsing.ntp.user_opened_module";
|
||||
|
||||
// Register local state used only for migration (clearing or moving to a new
|
||||
// key).
|
||||
void RegisterLocalStatePrefsForMigration(PrefRegistrySimple* registry) {
|
||||
// Deprecated 02/2025.
|
||||
registry->RegisterBooleanPref(kUserAgentClientHintsGREASEUpdateEnabled, true);
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
// Deprecated 02/2025.
|
||||
registry->RegisterStringPref(kRootSecretPrefName, std::string());
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
// Deprecated 03/2025.
|
||||
registry->RegisterBooleanPref(kShouldRetrieveDeviceState, false);
|
||||
registry->RegisterBooleanPref(kShouldAutoEnroll, false);
|
||||
registry->RegisterIntegerPref(kAutoEnrollmentPowerLimit, -1);
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
// Deprecated 03/2025.
|
||||
registry->RegisterTimePref(kDeviceRestrictionScheduleHighestSeenTime,
|
||||
base::Time());
|
||||
#endif
|
||||
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
// Deprecated 04/2025.
|
||||
registry->RegisterListPref(
|
||||
@@ -1090,6 +1042,10 @@ void RegisterLocalStatePrefsForMigration(PrefRegistrySimple* registry) {
|
||||
registry->RegisterIntegerPref(kPrivacyBudgetGeneration, 0);
|
||||
registry->RegisterStringPref(kPrivacyBudgetSeenSurfaces, std::string());
|
||||
registry->RegisterStringPref(kPrivacyBudgetSelectedOffsets, std::string());
|
||||
|
||||
// Deprecated 03/2026.
|
||||
registry->RegisterBooleanPref(kGlicMultiInstanceEnabledBySubscriptionTier,
|
||||
false);
|
||||
registry->RegisterIntegerPref(kPrivacyBudgetSelectedBlock, -1);
|
||||
registry->RegisterDoublePref(kPrivacyBudgetMetaExperimentActivationSalt, 0);
|
||||
|
||||
@@ -1132,55 +1088,6 @@ void RegisterLocalStatePrefsForMigration(PrefRegistrySimple* registry) {
|
||||
// Register prefs used only for migration (clearing or moving to a new key).
|
||||
void RegisterProfilePrefsForMigration(
|
||||
user_prefs::PrefRegistrySyncable* registry) {
|
||||
// Deprecated 01/2025.
|
||||
registry->RegisterBooleanPref(kCompactModeEnabled, false);
|
||||
|
||||
// Deprecated 01/2025.
|
||||
registry->RegisterBooleanPref(kSafeBrowsingAutomaticDeepScanningIPHSeen,
|
||||
false);
|
||||
registry->RegisterBooleanPref(kSafeBrowsingAutomaticDeepScanPerformed, false);
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
// Deprecated 01/2025.
|
||||
registry->RegisterBooleanPref(kUsedPolicyCertificates, false);
|
||||
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||
|
||||
// Deprecated 02/2025.
|
||||
registry->RegisterBooleanPref(kDefaultSearchProviderKeywordsUseExtendedList,
|
||||
false);
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
// Deprecated 02/2025.
|
||||
registry->RegisterTimePref(kLocalPasswordsMigrationWarningShownTimestamp,
|
||||
base::Time());
|
||||
registry->RegisterBooleanPref(kLocalPasswordMigrationWarningShownAtStartup,
|
||||
false);
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
// Deprecated 02/2025.
|
||||
registry->RegisterBooleanPref(kLiveCaptionUserMicrophoneEnabled, false);
|
||||
registry->RegisterStringPref(kUserMicrophoneCaptionLanguageCode, "");
|
||||
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
// Deprecated 02/2025.
|
||||
registry->RegisterBooleanPref(kScannerFeedbackEnabled, true);
|
||||
registry->RegisterBooleanPref(kHmrFeedbackAllowed, true);
|
||||
registry->RegisterDictionaryPref(kSharedStorage);
|
||||
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||
|
||||
// Deprecated 03/2025.
|
||||
registry->RegisterBooleanPref(kPasswordChangeFlowNoticeAgreement, false);
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
// Deprecated 03/2025.
|
||||
registry->RegisterBooleanPref(kSunfishEnabled, true);
|
||||
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||
|
||||
// Deprecated 03/2025
|
||||
registry->RegisterDictionaryPref(kRecurrentSSLInterstitial);
|
||||
|
||||
// Deprecated 04/2025.
|
||||
registry->RegisterIntegerPref(
|
||||
kDefaultSearchProviderChoiceScreenShuffleMilestone, 0);
|
||||
@@ -1401,6 +1308,36 @@ void RegisterProfilePrefsForMigration(
|
||||
|
||||
// Deprecated 03/2026.
|
||||
registry->RegisterIntegerPref(kTabDeclutterUsageCount, 0);
|
||||
|
||||
// Deprecated 03/2026.
|
||||
registry->RegisterIntegerPref(kTabSearchTabIndex, 1);
|
||||
|
||||
// Deprecated 03/2026.
|
||||
registry->RegisterStringPref(
|
||||
kSigninFromBookmarksBubbleSyntheticTrialGroupNamePref, std::string());
|
||||
registry->RegisterStringPref(
|
||||
kBookmarksBubblePromoShownSyntheticTrialGroupNamePref, std::string());
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
// Deprecated 03/2026.
|
||||
registry->RegisterListPref(kPrivacySandboxActivityTypeRecord2);
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
|
||||
// Deprecated 03/2026.
|
||||
registry->RegisterIntegerPref(kTabOrganizationNudgeBackoffCount, 0);
|
||||
registry->RegisterBooleanPref(kTabOrganizationShowFRE, true);
|
||||
registry->RegisterIntegerPref(kTabOrganizationModelStrategy, 0);
|
||||
|
||||
// Deprecated 03/2026.
|
||||
registry->RegisterIntegerPref(kNtpContextMenuClickCount, 0);
|
||||
|
||||
// Deprecated 03/2026.
|
||||
registry->RegisterTimePref(kNtpPromoPrefLastSnoozed, base::Time());
|
||||
|
||||
// Deprecated 03/2026.
|
||||
registry->RegisterIntegerPref(kSafeBrowsingModuleShownCount, 0);
|
||||
registry->RegisterInt64Pref(kSafeBrowsingModuleLastCooldownStartAt, 0);
|
||||
registry->RegisterBooleanPref(kSafeBrowsingModuleOpened, false);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
@@ -1431,7 +1368,6 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
|
||||
chrome_labs_prefs::RegisterLocalStatePrefs(registry);
|
||||
chrome_urls::RegisterPrefs(registry);
|
||||
ChromeMetricsServiceClient::RegisterPrefs(registry);
|
||||
ChromeSigninClient::RegisterLocalStatePrefs(registry);
|
||||
enterprise_connectors::RegisterLocalStatePrefs(registry);
|
||||
enterprise_util::RegisterLocalStatePrefs(registry);
|
||||
component_updater::RegisterPrefs(registry);
|
||||
@@ -1491,6 +1427,9 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
|
||||
// Individual preferences. If you have multiple preferences that should
|
||||
// clearly be grouped together, please group them together into a helper
|
||||
// function called above. Please keep this list alphabetized.
|
||||
|
||||
registry->RegisterTimePref(prefs::kAudioInputStreamLastTimeCreated,
|
||||
base::Time(), PrefRegistry::LOSSY_PREF);
|
||||
registry->RegisterBooleanPref(
|
||||
policy::policy_prefs::kIntensiveWakeUpThrottlingEnabled, false);
|
||||
#if BUILDFLAG(IS_WIN) && BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
||||
@@ -1530,8 +1469,8 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
|
||||
registry->RegisterIntegerPref(prefs::kLastWhatsNewVersion, 0);
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
|
||||
#if BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
extensions::ExtensionPrefs::RegisterBrowserPrefs(registry);
|
||||
#if BUILDFLAG(ENABLE_EXTENSIONS_CORE)
|
||||
extensions::ExtensionPrefs::RegisterLocalStatePrefs(registry);
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(ENABLE_ON_DEVICE_TRANSLATION)
|
||||
@@ -1569,6 +1508,7 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
|
||||
ash::report::ReportController::RegisterPrefs(registry);
|
||||
ash::EnableDebuggingScreenHandler::RegisterPrefs(registry);
|
||||
ash::FastTransitionObserver::RegisterPrefs(registry);
|
||||
ash::HIDDetectionScreen::RegisterLocalStatePrefs(registry);
|
||||
ash::HWDataUsageController::RegisterLocalStatePrefs(registry);
|
||||
ash::KerberosCredentialsManager::RegisterLocalStatePrefs(registry);
|
||||
ash::KioskController::RegisterLocalStatePrefs(registry);
|
||||
@@ -1603,6 +1543,7 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
|
||||
policy::AdbSideloadingAllowanceModePolicyHandler::RegisterPrefs(registry);
|
||||
policy::BrowserPolicyConnectorAsh::RegisterPrefs(registry);
|
||||
policy::CrdAdminSessionController::RegisterLocalStatePrefs(registry);
|
||||
policy::DeviceCommandQueryGeolocationJob::RegisterPrefs(registry);
|
||||
policy::DeviceCloudPolicyManagerAsh::RegisterPrefs(registry);
|
||||
policy::DeviceRestrictionScheduleController::RegisterLocalStatePrefs(
|
||||
registry);
|
||||
@@ -1668,9 +1609,9 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
|
||||
screen_ai::RegisterLocalStatePrefs(registry);
|
||||
#endif // !BUILDFLAG(IS_ANDROID)
|
||||
|
||||
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
|
||||
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_ANDROID)
|
||||
PlatformAuthPolicyObserver::RegisterPrefs(registry);
|
||||
#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
|
||||
#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_ANDROID)
|
||||
|
||||
// Platform-specific and compile-time conditional individual preferences.
|
||||
// If you have multiple preferences that should clearly be grouped together,
|
||||
@@ -1747,7 +1688,6 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
|
||||
chrome_browser_net::NetErrorTabHelper::RegisterProfilePrefs(registry);
|
||||
chrome_prefs::RegisterProfilePrefs(registry);
|
||||
collaboration::prefs::RegisterProfilePrefs(registry);
|
||||
contextual_cueing::prefs::RegisterProfilePrefs(registry);
|
||||
commerce::RegisterProfilePrefs(registry);
|
||||
contextual_search::ContextualSearchService::RegisterProfilePrefs(registry);
|
||||
registry->RegisterIntegerPref(prefs::kContextualTasksNextPanelOpenCount, 0);
|
||||
@@ -1758,7 +1698,9 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
|
||||
enterprise_reporting::RegisterProfilePrefs(registry);
|
||||
dom_distiller::DistilledPagePrefs::RegisterProfilePrefs(registry);
|
||||
DownloadPrefs::RegisterProfilePrefs(registry);
|
||||
finds::FindsService::RegisterProfilePrefs(registry);
|
||||
glic::prefs::RegisterProfilePrefs(registry);
|
||||
glic::contextual_cueing::prefs::RegisterProfilePrefs(registry);
|
||||
permissions::PermissionHatsTriggerHelper::RegisterProfilePrefs(registry);
|
||||
history_clusters::prefs::RegisterProfilePrefs(registry);
|
||||
HostContentSettingsMap::RegisterProfilePrefs(registry);
|
||||
@@ -1868,6 +1810,11 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
|
||||
extensions_ui_prefs::RegisterProfilePrefs(registry);
|
||||
ExtensionUrlOverrides::RegisterProfilePrefs(registry);
|
||||
update_client::RegisterProfilePrefs(registry);
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
registry->RegisterBooleanPref(prefs::kPinExtensionsMenuButton, true);
|
||||
#endif
|
||||
|
||||
#endif // BUILDFLAG(ENABLE_EXTENSIONS_CORE)
|
||||
|
||||
#if BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
@@ -1932,7 +1879,6 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
|
||||
GoogleCalendarPageHandler::RegisterProfilePrefs(registry);
|
||||
HatsServiceDesktop::RegisterProfilePrefs(registry);
|
||||
lens::prefs::RegisterProfilePrefs(registry);
|
||||
ManagementUI::RegisterProfilePrefs(registry);
|
||||
media_router::RegisterAccessCodeProfilePrefs(registry);
|
||||
media_router::RegisterProfilePrefs(registry);
|
||||
MicrosoftAuthPageHandler::RegisterProfilePrefs(registry);
|
||||
@@ -1940,7 +1886,6 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
|
||||
NewTabFooterUI::RegisterProfilePrefs(registry);
|
||||
NewTabPageHandler::RegisterProfilePrefs(registry);
|
||||
NewTabPageUI::RegisterProfilePrefs(registry);
|
||||
ntp::SafeBrowsingHandler::RegisterProfilePrefs(registry);
|
||||
OutlookCalendarPageHandler::RegisterProfilePrefs(registry);
|
||||
PinnedTabCodec::RegisterProfilePrefs(registry);
|
||||
promos_utils::RegisterProfilePrefs(registry);
|
||||
@@ -1953,13 +1898,16 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
|
||||
MostRelevantTabResumptionPageHandler::RegisterProfilePrefs(registry);
|
||||
TabGroupsPageHandler::RegisterProfilePrefs(registry);
|
||||
tab_groups::saved_tab_groups::prefs::RegisterProfilePrefs(registry);
|
||||
tab_organization_prefs::RegisterProfilePrefs(registry);
|
||||
tab_search_prefs::RegisterProfilePrefs(registry);
|
||||
ThemeColorPickerHandler::RegisterProfilePrefs(registry);
|
||||
ThemeService::RegisterProfilePrefs(registry);
|
||||
toolbar::RegisterProfilePrefs(registry);
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
|
||||
#if !BUILDFLAG(IS_ANDROID) || BUILDFLAG(ENABLE_EXTENSIONS_CORE)
|
||||
ManagementUI::RegisterProfilePrefs(registry);
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(ENABLE_DEVTOOLS_FRONTEND)
|
||||
DevToolsWindow::RegisterProfilePrefs(registry);
|
||||
#endif // BUILDFLAG(ENABLE_DEVTOOLS_FRONTEND)
|
||||
@@ -2035,7 +1983,8 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
|
||||
ash::HelpAppNotificationController::RegisterProfilePrefs(registry);
|
||||
ash::quick_unlock::FingerprintStorage::RegisterProfilePrefs(registry);
|
||||
ash::quick_unlock::PinStoragePrefs::RegisterProfilePrefs(registry);
|
||||
ash::Preferences::RegisterProfilePrefs(registry);
|
||||
ash::Preferences::RegisterProfilePrefs(
|
||||
CHECK_DEREF(g_browser_process->local_state()), registry);
|
||||
ash::EnterprisePrintersProvider::RegisterProfilePrefs(registry);
|
||||
ash::parent_access::ParentAccessService::RegisterProfilePrefs(registry);
|
||||
quick_answers::prefs::RegisterProfilePrefs(registry);
|
||||
@@ -2162,6 +2111,9 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
|
||||
prefs::kManagedLocalNetworkAccessRestrictionsTemporaryOptOut, false);
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
registry->RegisterBooleanPref(
|
||||
prefs::kAppRatingPromptShown, false,
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
||||
registry->RegisterBooleanPref(prefs::kVirtualKeyboardResizesLayoutByDefault,
|
||||
false);
|
||||
#endif
|
||||
@@ -2270,31 +2222,11 @@ void MigrateObsoleteLocalStatePrefs(PrefService* local_state) {
|
||||
// BEGIN_MIGRATE_OBSOLETE_LOCAL_STATE_PREFS
|
||||
// Please don't delete the preceding line. It is used by PRESUBMIT.py.
|
||||
|
||||
// Added 02/2025.
|
||||
local_state->ClearPref(kUserAgentClientHintsGREASEUpdateEnabled);
|
||||
|
||||
// Added 02/2025
|
||||
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS)
|
||||
local_state->ClearPref(prefs::kDefaultBrowserPromptRefreshStudyGroup);
|
||||
#endif
|
||||
|
||||
// Added 02/2025
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
local_state->ClearPref(kRootSecretPrefName);
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
|
||||
// Added 03/2025.
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
local_state->ClearPref(kShouldRetrieveDeviceState);
|
||||
local_state->ClearPref(kShouldAutoEnroll);
|
||||
local_state->ClearPref(kAutoEnrollmentPowerLimit);
|
||||
#endif
|
||||
|
||||
// Added 03/2025.
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
local_state->ClearPref(kDeviceRestrictionScheduleHighestSeenTime);
|
||||
#endif
|
||||
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
local_state->ClearPref(
|
||||
kPerformanceInterventionNotificationAcceptHistoryDeprecated);
|
||||
@@ -2408,6 +2340,9 @@ void MigrateObsoleteLocalStatePrefs(PrefService* local_state) {
|
||||
local_state->ClearPref(kProfilesDeletedOld);
|
||||
}
|
||||
|
||||
// Added 03/2026.
|
||||
local_state->ClearPref(kGlicMultiInstanceEnabledBySubscriptionTier);
|
||||
|
||||
// Please don't delete the following line. It is used by PRESUBMIT.py.
|
||||
// END_MIGRATE_OBSOLETE_LOCAL_STATE_PREFS
|
||||
|
||||
@@ -2463,56 +2398,6 @@ void MigrateObsoleteProfilePrefs(PrefService* profile_prefs,
|
||||
MigrateDefaultBrowserLastDeclinedPref(profile_prefs);
|
||||
#endif
|
||||
|
||||
// Added 01/2025.
|
||||
profile_prefs->ClearPref(kCompactModeEnabled);
|
||||
|
||||
// Added 01/2025.
|
||||
profile_prefs->ClearPref(kSafeBrowsingAutomaticDeepScanPerformed);
|
||||
profile_prefs->ClearPref(kSafeBrowsingAutomaticDeepScanningIPHSeen);
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
// Added 01/2025.
|
||||
profile_prefs->ClearPref(kUsedPolicyCertificates);
|
||||
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||
|
||||
// Added 02/2025.
|
||||
profile_prefs->ClearPref(kDefaultSearchProviderKeywordsUseExtendedList);
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
// Added 02/2025.
|
||||
profile_prefs->ClearPref(kLocalPasswordsMigrationWarningShownTimestamp);
|
||||
profile_prefs->ClearPref(kLocalPasswordMigrationWarningShownAtStartup);
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
// Deprecated 02/2025.
|
||||
profile_prefs->ClearPref(kLiveCaptionUserMicrophoneEnabled);
|
||||
profile_prefs->ClearPref(kUserMicrophoneCaptionLanguageCode);
|
||||
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
// Added 02/2025.
|
||||
profile_prefs->ClearPref(kScannerFeedbackEnabled);
|
||||
profile_prefs->ClearPref(kHmrFeedbackAllowed);
|
||||
profile_prefs->ClearPref(kSharedStorage);
|
||||
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||
|
||||
// Added 03/2025.
|
||||
profile_prefs->ClearPref(kPasswordChangeFlowNoticeAgreement);
|
||||
|
||||
#if !BUILDFLAG(IS_CHROMEOS)
|
||||
// Added 03/2025.
|
||||
profile_prefs->ClearPref(prefs::kChildAccountStatusKnown);
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
// Added 03/2025.
|
||||
profile_prefs->ClearPref(kSunfishEnabled);
|
||||
#endif
|
||||
|
||||
// Added 03/2025.
|
||||
profile_prefs->ClearPref(kRecurrentSSLInterstitial);
|
||||
|
||||
// Added 04/2025.
|
||||
profile_prefs->ClearPref(kDefaultSearchProviderChoiceScreenShuffleMilestone);
|
||||
|
||||
@@ -2704,11 +2589,44 @@ void MigrateObsoleteProfilePrefs(PrefService* profile_prefs,
|
||||
// Added 03/2026.
|
||||
profile_prefs->ClearPref(kTabDeclutterUsageCount);
|
||||
|
||||
// Added 03/2026.
|
||||
profile_prefs->ClearPref(kTabSearchTabIndex);
|
||||
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
// Added 02/2026.
|
||||
tabs::MigrateTabSearchPref(profile_prefs);
|
||||
#endif // !BUILDFLAG(IS_ANDROID)
|
||||
|
||||
// Added 03/2026
|
||||
profile_prefs->ClearPref(
|
||||
kSigninFromBookmarksBubbleSyntheticTrialGroupNamePref);
|
||||
profile_prefs->ClearPref(
|
||||
kBookmarksBubblePromoShownSyntheticTrialGroupNamePref);
|
||||
|
||||
// Added 03/2026.
|
||||
profile_prefs->ClearPref(kSafeBrowsingModuleShownCount);
|
||||
profile_prefs->ClearPref(kSafeBrowsingModuleLastCooldownStartAt);
|
||||
profile_prefs->ClearPref(kSafeBrowsingModuleOpened);
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
// Added 03/2026.
|
||||
profile_prefs->ClearPref(kPrivacySandboxActivityTypeRecord2);
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
|
||||
// Added 03/2026.
|
||||
profile_prefs->ClearPref(kTabOrganizationNudgeBackoffCount);
|
||||
profile_prefs->ClearPref(kTabOrganizationShowFRE);
|
||||
profile_prefs->ClearPref(kTabOrganizationModelStrategy);
|
||||
|
||||
// Added 03/2026.
|
||||
profile_prefs->ClearPref(kNtpContextMenuClickCount);
|
||||
|
||||
// Added 03/2026.
|
||||
privacy_sandbox::ClearAdPrivacyPrefs(profile_prefs);
|
||||
|
||||
// Added 03/2026.
|
||||
profile_prefs->ClearPref(kNtpPromoPrefLastSnoozed);
|
||||
|
||||
// Please don't delete the following line. It is used by PRESUBMIT.py.
|
||||
// END_MIGRATE_OBSOLETE_PROFILE_PREFS
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "chrome/browser/file_system_access/file_system_access_features.h"
|
||||
#include "chrome/browser/file_system_access/file_system_access_permission_request_manager.h"
|
||||
#include "chrome/browser/file_system_access/file_system_access_tab_helper.h"
|
||||
#include "chrome/browser/finds/core/finds_features.h"
|
||||
#include "chrome/browser/finds/core/finds_tab_helper.h"
|
||||
#include "chrome/browser/finds/finds_service_factory.h"
|
||||
#include "chrome/browser/history/history_tab_helper.h"
|
||||
@@ -66,6 +67,7 @@
|
||||
#include "chrome/browser/profiles/profile_key.h"
|
||||
#include "chrome/browser/resource_coordinator/tab_helper.h"
|
||||
#include "chrome/browser/safe_browsing/safe_browsing_navigation_observer_manager_factory.h"
|
||||
#include "chrome/browser/search_engines/template_url_service_factory.h"
|
||||
#include "chrome/browser/sessions/session_tab_helper_factory.h"
|
||||
#include "chrome/browser/site_protection/site_protection_metrics_observer.h"
|
||||
#include "chrome/browser/ssl/chrome_security_blocking_page_factory.h"
|
||||
@@ -81,7 +83,6 @@
|
||||
#include "chrome/browser/sync/sessions/sync_sessions_web_contents_router_factory.h"
|
||||
#include "chrome/browser/tab_contents/navigation_metrics_recorder.h"
|
||||
#include "chrome/browser/task_manager/web_contents_tags.h"
|
||||
#include "chrome/browser/tpcd/metadata/devtools_observer.h"
|
||||
#include "chrome/browser/translate/chrome_translate_client.h"
|
||||
#include "chrome/browser/trusted_vault/trusted_vault_encryption_keys_tab_helper.h"
|
||||
#include "chrome/browser/ui/autofill/autofill_client_provider.h"
|
||||
@@ -142,6 +143,7 @@
|
||||
#include "components/safe_browsing/content/browser/ui_manager.h"
|
||||
#include "components/safe_browsing/core/common/features.h"
|
||||
#include "components/search/ntp_features.h"
|
||||
#include "components/signin/public/base/signin_buildflags.h"
|
||||
#include "components/site_engagement/content/site_engagement_helper.h"
|
||||
#include "components/site_engagement/content/site_engagement_service.h"
|
||||
#include "components/tabs/public/tab_interface.h"
|
||||
@@ -214,6 +216,7 @@
|
||||
#include "chrome/browser/chromeos/policy/dlp/dlp_content_tab_helper.h"
|
||||
#include "chrome/browser/chromeos/printing/print_preview/printing_init_cros.h"
|
||||
#include "chrome/browser/ui/ash/google_one/google_one_offer_iph_tab_helper.h"
|
||||
#include "chromeos/ash/experiences/isolated_web_app/cros_isolated_web_app_enabler.h"
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
|
||||
@@ -282,6 +285,12 @@
|
||||
#include "components/safe_browsing/content/browser/safe_browsing_tab_observer.h"
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(ENABLE_DICE_SUPPORT)
|
||||
#include "chrome/browser/contextual_tasks/search_ai_mode_promo_tab_helper.h"
|
||||
#include "components/contextual_tasks/public/features.h"
|
||||
#include "components/signin/public/base/signin_switches.h"
|
||||
#endif // BUILDFLAG(ENABLE_DICE_SUPPORT)
|
||||
|
||||
using content::WebContents;
|
||||
|
||||
namespace {
|
||||
@@ -581,6 +590,13 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
|
||||
#endif // BUILDFLAG(SAFE_BROWSING_AVAILABLE)
|
||||
SafetyTipWebContentsObserver::CreateForWebContents(web_contents);
|
||||
SearchEngineTabHelper::CreateForWebContents(web_contents);
|
||||
#if BUILDFLAG(ENABLE_DICE_SUPPORT)
|
||||
if (base::FeatureList::IsEnabled(switches::kEnableSearchAIModeSigninPromo) &&
|
||||
base::FeatureList::IsEnabled(contextual_tasks::kContextualTasks)) {
|
||||
contextual_tasks::SearchAiModePromoTabHelper::CreateForWebContents(
|
||||
web_contents);
|
||||
}
|
||||
#endif // BUILDFLAG(ENABLE_DICE_SUPPORT)
|
||||
if (site_engagement::SiteEngagementService::IsEnabled()) {
|
||||
site_engagement::SiteEngagementService::Helper::CreateForWebContents(
|
||||
web_contents,
|
||||
@@ -603,8 +619,6 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
|
||||
}
|
||||
#endif
|
||||
tasks::TaskTabHelper::CreateForWebContents(web_contents);
|
||||
tpcd::metadata::TpcdMetadataDevtoolsObserver::CreateForWebContents(
|
||||
web_contents);
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
TabCaptureContentsBorderHelper::CreateForWebContents(web_contents);
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
@@ -636,9 +650,15 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
|
||||
}
|
||||
ContextMenuHelper::CreateForWebContents(web_contents);
|
||||
|
||||
if (base::FeatureList::IsEnabled(chrome::android::kChromeFinds)) {
|
||||
finds::FindsTabHelper::CreateForWebContents(
|
||||
web_contents, finds::FindsServiceFactory::GetForProfile(profile));
|
||||
if (base::FeatureList::IsEnabled(finds::features::kChromeFinds)) {
|
||||
if (auto* finds_service =
|
||||
finds::FindsServiceFactory::GetForProfile(profile)) {
|
||||
finds::FindsTabHelper::CreateForWebContents(
|
||||
web_contents, finds_service,
|
||||
OptimizationGuideKeyedServiceFactory::GetForProfile(profile),
|
||||
TemplateURLServiceFactory::GetForProfile(profile),
|
||||
profile->GetPrefs());
|
||||
}
|
||||
}
|
||||
|
||||
if (base::FeatureList::IsEnabled(
|
||||
@@ -715,6 +735,7 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
|
||||
ash::BootTimesRecorderTabHelper::MaybeCreateForWebContents(web_contents);
|
||||
|
||||
CrosAppsTabHelper::MaybeCreateForWebContents(web_contents);
|
||||
ash::CrosIsolatedWebAppEnabler::CreateForWebContents(web_contents);
|
||||
GeminiAppTabHelper::MaybeCreateForWebContents(web_contents);
|
||||
mahi::MahiTabHelper::MaybeCreateForWebContents(web_contents);
|
||||
policy::DlpContentTabHelper::MaybeCreateForWebContents(web_contents);
|
||||
|
||||
+4
-2
@@ -10,6 +10,7 @@
|
||||
#include "components/prefs/pref_service.h"
|
||||
#include "content/public/browser/navigation_controller.h"
|
||||
#include "content/public/browser/navigation_entry.h"
|
||||
#include "content/public/browser/security_principal.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
#include "extensions/common/constants.h"
|
||||
#include "third_party/blink/public/common/web_preferences/web_preferences.h"
|
||||
@@ -95,8 +96,9 @@ bool ChromeContentBrowserClientWebUiPart::OverrideWebPreferencesAfterNavigation(
|
||||
}
|
||||
|
||||
// Extensions are handled by ChromeContentBrowserClientExtensionsPart.
|
||||
const GURL& site_url = main_frame_site.GetSiteURL();
|
||||
if (site_url.SchemeIs(extensions::kExtensionScheme)) {
|
||||
const content::SecurityPrincipal& security_principal =
|
||||
main_frame_site.GetSecurityPrincipal();
|
||||
if (security_principal.SchemeIs(extensions::kExtensionScheme)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
// Copyright 2023 The Chromium Authors
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// API which provides support for ChromeOS Accessibility features in the
|
||||
// browser.
|
||||
|
||||
[platforms=("chromeos"),
|
||||
implemented_in="chrome/browser/chromeos/extensions/accessibility_service_private/accessibility_service_private.h"]
|
||||
|
||||
namespace accessibilityServicePrivate {
|
||||
callback VoidCallback = void();
|
||||
|
||||
interface Functions {
|
||||
// Called when Select to Speak in ChromeOS should speak the current
|
||||
// text selection; fired when the context menu option was clicked in
|
||||
// a selection context.
|
||||
static void speakSelectedText(
|
||||
optional VoidCallback callback);
|
||||
};
|
||||
|
||||
interface Events {
|
||||
// Called when Select to Speak in ChromeOS wants a clipboard copy
|
||||
// event to be performed on the active and focused tab with the
|
||||
// given URL. This is fired when Select to Speak is trying to speak
|
||||
// with search+s but cannot find a selection and the focused node
|
||||
// is in a Google Docs page.
|
||||
static void clipboardCopyInActiveGoogleDoc(DOMString url);
|
||||
};
|
||||
};
|
||||
@@ -1,46 +0,0 @@
|
||||
// Copyright 2015 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>appview</code> tag to embed other Chrome Apps within your
|
||||
// Chrome App. (see <a href=#usage>Usage</a>).
|
||||
namespace appviewTag {
|
||||
// This object specifies details and operations to perform on the embedding
|
||||
// request. The app to be embedded can make a decision on whether or not to
|
||||
// allow the embedding and what to embed based on the embedder making the
|
||||
// request.
|
||||
dictionary EmbedRequest {
|
||||
// The ID of the app that sent the embedding request.
|
||||
DOMString embedderId;
|
||||
|
||||
// Optional developer specified data that the app to be embedded can use
|
||||
// when making an embedding decision.
|
||||
object data;
|
||||
|
||||
// Allows the embedding request.
|
||||
//
|
||||
// |url| : Specifies the content to be embedded.
|
||||
static void allow(DOMString url);
|
||||
|
||||
// Prevents the embedding request.
|
||||
static void deny();
|
||||
};
|
||||
|
||||
// An optional function that's called after the embedding request is
|
||||
// completed.
|
||||
//
|
||||
// |success| : True if the embedding request succeded.
|
||||
callback EmbeddingCallback = void (boolean success);
|
||||
|
||||
interface Functions {
|
||||
// Requests another app to be embedded.
|
||||
//
|
||||
// |app| : The extension id of the app to be embedded.
|
||||
// |data| : Optional developer specified data that the app to be embedded
|
||||
// can use when making an embedding decision.
|
||||
// |callback| : An optional function that's called after the embedding
|
||||
// request is completed.
|
||||
static void connect(DOMString app, optional any data,
|
||||
optional EmbeddingCallback callback);
|
||||
};
|
||||
};
|
||||
@@ -155,17 +155,12 @@ namespace autofillPrivate {
|
||||
FLIGHT_RESERVATION_TICKET_NUMBER,
|
||||
FLIGHT_RESERVATION_CONFIRMATION_CODE,
|
||||
FLIGHT_RESERVATION_PASSENGER_NAME,
|
||||
FLIGHT_RESERVATION_DEPARTURE_AIRPORT,
|
||||
FLIGHT_RESERVATION_ARRIVAL_AIRPORT,
|
||||
FLIGHT_RESERVATION_DEPARTURE_DATE,
|
||||
ADDRESS_HOME_ZIP_AND_CITY,
|
||||
ORDER_ID,
|
||||
ORDER_DATE,
|
||||
ORDER_MERCHANT_NAME,
|
||||
ORDER_MERCHANT_DOMAIN,
|
||||
ORDER_PRODUCT_NAMES,
|
||||
ORDER_ACCOUNT,
|
||||
ORDER_GRAND_TOTAL,
|
||||
SHIPMENT_TRACKING_NUMBER,
|
||||
MAX_VALID_FIELD_TYPE
|
||||
};
|
||||
|
||||
@@ -445,6 +440,9 @@ namespace autofillPrivate {
|
||||
DOMString entityInstanceSubLabel;
|
||||
// Whether the entity is stored on Google Wallet servers.
|
||||
boolean storedInWallet;
|
||||
// If the entity is `storedInWallet`, this string contains the URL to the
|
||||
// management page of the pass on the Wallet website.
|
||||
DOMString? walletEntityUrl;
|
||||
};
|
||||
|
||||
// A Pay Over Time Issuer entry which can be displayed in the autofill
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,93 +0,0 @@
|
||||
// Copyright 2013 The Chromium Authors
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Braille display access private API.
|
||||
namespace brailleDisplayPrivate {
|
||||
// Braille display keyboard command.
|
||||
enum KeyCommand {
|
||||
line_up,
|
||||
line_down,
|
||||
pan_left,
|
||||
pan_right,
|
||||
top,
|
||||
bottom,
|
||||
routing,
|
||||
secondary_routing,
|
||||
dots,
|
||||
chord,
|
||||
standard_key
|
||||
};
|
||||
|
||||
// A keyboard event. This is not a standard keyboard event because
|
||||
// braille display keyboards look significantly different from standard
|
||||
// keyboards.
|
||||
dictionary KeyEvent {
|
||||
KeyCommand command;
|
||||
// 0-based display position for commands that involve a routing key.
|
||||
long? displayPosition;
|
||||
// Braille dot keys that were pressed, stored in the low-order bits.
|
||||
// Dot 1 is stored in bit 0, dot2 in bit 1, etc.
|
||||
long? brailleDots;
|
||||
// DOM keyboard event code. This is present when command is standard_key
|
||||
// and the braille display event represents a non-alphanumeric key such
|
||||
// as an arrow key or function key.
|
||||
// The value is as defined by the |code| property in
|
||||
// http://www.w3.org/TR/uievents/#keyboard-event-interface
|
||||
DOMString? standardKeyCode;
|
||||
// DOM keyboard event character value. This is present if the
|
||||
// braille key event corresponds to a character.
|
||||
DOMString? standardKeyChar;
|
||||
// Whether the space key was pressed.
|
||||
boolean? spaceKey;
|
||||
// Whether the alt key was pressed.
|
||||
boolean? altKey;
|
||||
// Whether the shift key was pressed.
|
||||
boolean? shiftKey;
|
||||
// Whether the ctrl key was pressed.
|
||||
boolean? ctrlKey;
|
||||
};
|
||||
|
||||
// The current braille display state.
|
||||
dictionary DisplayState {
|
||||
// Whether a braille display is currently available.
|
||||
boolean available;
|
||||
// Number of rows of braille cells on the currently connected display.
|
||||
long? textRowCount;
|
||||
// Number of columns of braille cells on the currently connected display.
|
||||
long? textColumnCount;
|
||||
// The number of dots in a braille cell on the currently connected display.
|
||||
long? cellSize;
|
||||
};
|
||||
|
||||
callback DisplayStateCallback = void(DisplayState result);
|
||||
|
||||
interface Functions {
|
||||
// Gets the current display state.
|
||||
static void getDisplayState(
|
||||
DisplayStateCallback callback);
|
||||
|
||||
// Write the given dot patterns to the display. The buffer contains one
|
||||
// byte for each braille cell on the display, starting from the leftmost
|
||||
// cell. Each byte contains a bit pattern indicating which dots should be
|
||||
// raised in the corresponding cell with the low-order bit representing
|
||||
// dot 1 and so on until bit 7 which corresponds to dot 8. If the number
|
||||
// of bytes in the buffer is not equal to the display size, the buffer
|
||||
// will either be clipped or padded with blank cells on the right. The
|
||||
// buffer is a 2D array compressed into 1D. The |columns| and |rows|
|
||||
// parameters give the original 2D dimensions of the buffer. To access
|
||||
// an element cells[r][c], simply access cells[r * columns + c].
|
||||
static void writeDots(ArrayBuffer cells, long columns, long rows);
|
||||
|
||||
// Updates the single user-preferred braille device with the given bluetooth
|
||||
// device address and starts or restarts the Brltty daemon.
|
||||
static void updateBluetoothBrailleDisplayAddress(DOMString address);
|
||||
};
|
||||
|
||||
interface Events {
|
||||
// Fired when a braille display is connected or disconnected.
|
||||
static void onDisplayStateChanged(DisplayState state);
|
||||
// Fired when an input event is received from the display.
|
||||
static void onKeyEvent(KeyEvent event);
|
||||
};
|
||||
};
|
||||
@@ -1,306 +0,0 @@
|
||||
// Copyright 2015 The Chromium Authors
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Use this API to expose certificates to the platform which can use these
|
||||
// certificates for TLS authentications.
|
||||
namespace certificateProvider {
|
||||
|
||||
// Types of supported cryptographic signature algorithms.
|
||||
enum Algorithm {
|
||||
// Specifies the RSASSA PKCS#1 v1.5 signature algorithm with the MD5-SHA-1
|
||||
// hashing. The extension must not prepend a DigestInfo prefix but only
|
||||
// add PKCS#1 padding. This algorithm is deprecated and will never be requested
|
||||
// by Chrome as of version 109.
|
||||
RSASSA_PKCS1_v1_5_MD5_SHA1,
|
||||
// Specifies the RSASSA PKCS#1 v1.5 signature algorithm
|
||||
// with the SHA-1 hash function.
|
||||
RSASSA_PKCS1_v1_5_SHA1,
|
||||
// Specifies the RSASSA PKCS#1 v1.5 signature algorithm
|
||||
// with the SHA-256 hashing function.
|
||||
RSASSA_PKCS1_v1_5_SHA256,
|
||||
// Specifies the RSASSA PKCS#1 v1.5 signature algorithm
|
||||
// with the SHA-384 hashing function.
|
||||
RSASSA_PKCS1_v1_5_SHA384,
|
||||
// Specifies the RSASSA PKCS#1 v1.5 signature algorithm
|
||||
// with the SHA-512 hashing function.
|
||||
RSASSA_PKCS1_v1_5_SHA512,
|
||||
// Specifies the RSASSA PSS signature algorithm with the SHA-256 hashing
|
||||
// function, MGF1 mask generation function and the salt of the same size as
|
||||
// the hash.
|
||||
RSASSA_PSS_SHA256,
|
||||
// Specifies the RSASSA PSS signature algorithm with the SHA-384 hashing
|
||||
// function, MGF1 mask generation function and the salt of the same size as
|
||||
// the hash.
|
||||
RSASSA_PSS_SHA384,
|
||||
// Specifies the RSASSA PSS signature algorithm with the SHA-512 hashing
|
||||
// function, MGF1 mask generation function and the salt of the same size as
|
||||
// the hash.
|
||||
RSASSA_PSS_SHA512
|
||||
};
|
||||
|
||||
// Types of errors that the extension can report.
|
||||
enum Error {
|
||||
// General error that cannot be represented by other more specific
|
||||
// error codes.
|
||||
GENERAL_ERROR
|
||||
};
|
||||
|
||||
// Information about a client certificate.
|
||||
dictionary ClientCertificateInfo {
|
||||
// The array must contain the DER encoding of the X.509 client certificate
|
||||
// as its first element.
|
||||
// <p>This must include exactly one certificate.</p>
|
||||
ArrayBuffer[] certificateChain;
|
||||
// All algorithms supported for this certificate. The extension will only be
|
||||
// asked for signatures using one of these algorithms.
|
||||
Algorithm[] supportedAlgorithms;
|
||||
};
|
||||
|
||||
dictionary SetCertificatesDetails {
|
||||
// When called in response to $(ref:onCertificatesUpdateRequested), should
|
||||
// contain the received <code>certificatesRequestId</code> value. Otherwise,
|
||||
// should be unset.
|
||||
long? certificatesRequestId;
|
||||
// Error that occurred while extracting the certificates, if any. This error
|
||||
// will be surfaced to the user when appropriate.
|
||||
Error? error;
|
||||
// List of currently available client certificates.
|
||||
ClientCertificateInfo[] clientCertificates;
|
||||
};
|
||||
|
||||
dictionary CertificatesUpdateRequest {
|
||||
// Request identifier to be passed to $(ref:setCertificates).
|
||||
long certificatesRequestId;
|
||||
};
|
||||
|
||||
dictionary SignatureRequest {
|
||||
// Request identifier to be passed to $(ref:reportSignature).
|
||||
long signRequestId;
|
||||
// Data to be signed. Note that the data is not hashed.
|
||||
ArrayBuffer input;
|
||||
// Signature algorithm to be used.
|
||||
Algorithm algorithm;
|
||||
// The DER encoding of a X.509 certificate. The extension must sign
|
||||
// <code>input</code> using the associated private key.
|
||||
ArrayBuffer certificate;
|
||||
};
|
||||
|
||||
dictionary ReportSignatureDetails {
|
||||
// Request identifier that was received via the $(ref:onSignatureRequested)
|
||||
// event.
|
||||
long signRequestId;
|
||||
// Error that occurred while generating the signature, if any.
|
||||
Error? error;
|
||||
// The signature, if successfully generated.
|
||||
ArrayBuffer? signature;
|
||||
};
|
||||
|
||||
// Deprecated. Replaced by $(ref:Algorithm).
|
||||
enum Hash {
|
||||
// Specifies the MD5 and SHA1 hashing algorithms.
|
||||
MD5_SHA1,
|
||||
// Specifies the SHA1 hashing algorithm.
|
||||
SHA1,
|
||||
// Specifies the SHA256 hashing algorithm.
|
||||
SHA256,
|
||||
// Specifies the SHA384 hashing algorithm.
|
||||
SHA384,
|
||||
// Specifies the SHA512 hashing algorithm.
|
||||
SHA512
|
||||
};
|
||||
|
||||
// The type of code being requested by the extension with requestPin function.
|
||||
enum PinRequestType {
|
||||
// Specifies the requested code is a PIN.
|
||||
PIN,
|
||||
// Specifies the requested code is a PUK.
|
||||
PUK
|
||||
};
|
||||
|
||||
// The types of errors that can be presented to the user through the
|
||||
// requestPin function.
|
||||
enum PinRequestErrorType {
|
||||
// Specifies the PIN is invalid.
|
||||
INVALID_PIN,
|
||||
// Specifies the PUK is invalid.
|
||||
INVALID_PUK,
|
||||
// Specifies the maximum attempt number has been exceeded.
|
||||
MAX_ATTEMPTS_EXCEEDED,
|
||||
// Specifies that the error cannot be represented by the above types.
|
||||
UNKNOWN_ERROR
|
||||
};
|
||||
|
||||
// Deprecated. Replaced by $(ref:ClientCertificateInfo).
|
||||
dictionary CertificateInfo {
|
||||
// Must be the DER encoding of a X.509 certificate. Currently, only
|
||||
// certificates of RSA keys are supported.
|
||||
ArrayBuffer certificate;
|
||||
|
||||
// Must be set to all hashes supported for this certificate. This extension
|
||||
// will only be asked for signatures of digests calculated with one of these
|
||||
// hash algorithms. This should be in order of decreasing hash preference.
|
||||
Hash[] supportedHashes;
|
||||
};
|
||||
|
||||
// Deprecated. Replaced by $(ref:SignatureRequest).
|
||||
dictionary SignRequest {
|
||||
// The unique ID to be used by the extension should it need to call a method
|
||||
// that requires it, e.g. requestPin.
|
||||
long signRequestId;
|
||||
|
||||
// The digest that must be signed.
|
||||
ArrayBuffer digest;
|
||||
|
||||
// Refers to the hash algorithm that was used to create <code>digest</code>.
|
||||
Hash hash;
|
||||
|
||||
// The DER encoding of a X.509 certificate. The extension must sign
|
||||
// <code>digest</code> using the associated private key.
|
||||
ArrayBuffer certificate;
|
||||
};
|
||||
|
||||
dictionary RequestPinDetails {
|
||||
// The ID given by Chrome in SignRequest.
|
||||
long signRequestId;
|
||||
|
||||
// The type of code requested. Default is PIN.
|
||||
PinRequestType? requestType;
|
||||
|
||||
// The error template displayed to the user. This should be set if the
|
||||
// previous request failed, to notify the user of the failure reason.
|
||||
PinRequestErrorType? errorType;
|
||||
|
||||
// The number of attempts left. This is provided so that any UI can present
|
||||
// this information to the user. Chrome is not expected to enforce this,
|
||||
// instead stopPinRequest should be called by the extension with
|
||||
// errorType = MAX_ATTEMPTS_EXCEEDED when the number of pin requests is
|
||||
// exceeded.
|
||||
long? attemptsLeft;
|
||||
};
|
||||
|
||||
dictionary StopPinRequestDetails {
|
||||
// The ID given by Chrome in SignRequest.
|
||||
long signRequestId;
|
||||
|
||||
// The error template. If present it is displayed to user. Intended to
|
||||
// contain the reason for stopping the flow if it was caused by an error,
|
||||
// e.g. MAX_ATTEMPTS_EXCEEDED.
|
||||
PinRequestErrorType? errorType;
|
||||
};
|
||||
|
||||
dictionary PinResponseDetails {
|
||||
// The code provided by the user. Empty if user closed the dialog or some
|
||||
// other error occurred.
|
||||
DOMString? userInput;
|
||||
};
|
||||
|
||||
callback RequestPinCallback = void (optional PinResponseDetails details);
|
||||
|
||||
callback StopPinRequestCallback = void ();
|
||||
|
||||
callback SetCertificatesCallback = void ();
|
||||
|
||||
callback ReportSignatureCallback = void ();
|
||||
|
||||
// The callback provided by the extension that Chrome uses to report back
|
||||
// rejected certificates. See <code>CertificatesCallback</code>.
|
||||
callback ResultCallback = void (ArrayBuffer[] rejectedCertificates);
|
||||
|
||||
// If no error occurred, this function must be called with the signature of
|
||||
// the digest using the private key of the requested certificate.
|
||||
// For an RSA key, the signature must be a PKCS#1 signature. The extension
|
||||
// is responsible for prepending the DigestInfo prefix and adding PKCS#1
|
||||
// padding. If an error occurred, this callback should be called without
|
||||
// signature.
|
||||
callback SignCallback = void (optional ArrayBuffer signature);
|
||||
|
||||
// Call this exactly once with the list of certificates that this extension is
|
||||
// providing. The list must only contain certificates for which the extension
|
||||
// can sign data using the associated private key. If the list contains
|
||||
// invalid certificates, these will be ignored. All valid certificates are
|
||||
// still registered for the extension. Chrome will call back with the list of
|
||||
// rejected certificates, which might be empty.
|
||||
callback CertificatesCallback =
|
||||
void (CertificateInfo[] certificates, ResultCallback callback);
|
||||
|
||||
interface Events {
|
||||
// This event fires if the certificates set via $(ref:setCertificates)
|
||||
// are insufficient or the browser requests updated information. The
|
||||
// extension must call $(ref:setCertificates) with the updated list of
|
||||
// certificates and the received <code>certificatesRequestId</code>.
|
||||
static void onCertificatesUpdateRequested(
|
||||
CertificatesUpdateRequest request);
|
||||
|
||||
// This event fires every time the browser needs to sign a message using a
|
||||
// certificate provided by this extension via $(ref:setCertificates).
|
||||
// <p>The extension must sign the input data from <code>request</code> using
|
||||
// the appropriate algorithm and private key and return it by calling
|
||||
// $(ref:reportSignature) with the received <code>signRequestId</code>.</p>
|
||||
static void onSignatureRequested(SignatureRequest request);
|
||||
|
||||
// <p>This event fires every time the browser requests the current list of
|
||||
// certificates provided by this extension. The extension must call
|
||||
// <code>reportCallback</code> exactly once with the current list of
|
||||
// certificates.</p>
|
||||
[deprecated="Use $(ref:onCertificatesUpdateRequested) instead."]
|
||||
static void onCertificatesRequested(CertificatesCallback reportCallback);
|
||||
|
||||
// This event fires every time the browser needs to sign a message using
|
||||
// a certificate provided by this extension in reply to an
|
||||
// $(ref:onCertificatesRequested) event.
|
||||
// The extension must sign the data in <code>request</code> using the
|
||||
// appropriate algorithm and private key and return it by calling
|
||||
// <code>reportCallback</code>. <code>reportCallback</code> must be called
|
||||
// exactly once.
|
||||
// |request|: Contains the details about the sign request.
|
||||
[deprecated="Use $(ref:onSignatureRequested) instead."]
|
||||
static void onSignDigestRequested(SignRequest request,
|
||||
SignCallback reportCallback);
|
||||
};
|
||||
|
||||
interface Functions {
|
||||
// Requests the PIN from the user. Only one ongoing request at a time is
|
||||
// allowed. The requests issued while another flow is ongoing are rejected.
|
||||
// It's the extension's responsibility to try again later if another flow is
|
||||
// in progress.
|
||||
// |details|: Contains the details about the requested dialog.
|
||||
// |callback|: Returns a Promise which resolves when the PIN is provided by
|
||||
// the user. Rejects with an error if the dialog request finishes
|
||||
// unsuccessfully (e.g. the dialog was canceled by the user or was not
|
||||
// allowed to be shown).
|
||||
static void requestPin(
|
||||
RequestPinDetails details,
|
||||
RequestPinCallback callback);
|
||||
|
||||
// Stops the pin request started by the $(ref:requestPin) function.
|
||||
// |details|: Contains the details about the reason for stopping the
|
||||
// request flow.
|
||||
// |callback|: Returns a Promise which resolves when the request to close
|
||||
// the PIN dialog is complete.
|
||||
static void stopPinRequest(
|
||||
StopPinRequestDetails details,
|
||||
StopPinRequestCallback callback);
|
||||
|
||||
// Sets a list of certificates to use in the browser.
|
||||
// <p>The extension should call this function after initialization and on
|
||||
// every change in the set of currently available certificates. The
|
||||
// extension should also call this function in response to
|
||||
// $(ref:onCertificatesUpdateRequested) every time this event is
|
||||
// received.</p>
|
||||
// |details|: The certificates to set. Invalid certificates will be ignored.
|
||||
// |callback|: Returns a Promise which resolves upon completion.
|
||||
static void setCertificates(
|
||||
SetCertificatesDetails details,
|
||||
optional SetCertificatesCallback callback);
|
||||
|
||||
// Should be called as a response to $(ref:onSignatureRequested).
|
||||
// <p>The extension must eventually call this function for every
|
||||
// $(ref:onSignatureRequested) event; the API implementation will stop
|
||||
// waiting for this call after some time and respond with a timeout
|
||||
// error when this function is called.</p>
|
||||
static void reportSignature(
|
||||
ReportSignatureDetails details,
|
||||
optional ReportSignatureCallback callback);
|
||||
};
|
||||
};
|
||||
-34
@@ -1,34 +0,0 @@
|
||||
// Copyright 2015 The Chromium Authors
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Internal API backing the chrome.certificateProvider API events.
|
||||
// The internal API associates events with replies to these events using request
|
||||
// IDs. A custom binding is used to hide these IDs from the public API.
|
||||
// Before an event hits the extension, the request ID is removed and instead a
|
||||
// callback is added to the event arguments. On the way back, when the extension
|
||||
// runs the callback to report its results, the callback magically prepends the
|
||||
// request ID to the results and calls the respective internal report function
|
||||
// (reportSignature or reportCertificates).
|
||||
[implemented_in = "chrome/browser/extensions/api/certificate_provider/certificate_provider_api.h"]
|
||||
namespace certificateProviderInternal {
|
||||
callback DoneCallback = void ();
|
||||
callback ResultCallback = void (ArrayBuffer[] rejectedCertificates);
|
||||
|
||||
interface Functions {
|
||||
// Matches certificateProvider.SignCallback. Must be called without the
|
||||
// signature to report an error.
|
||||
static void reportSignature(
|
||||
long requestId,
|
||||
optional ArrayBuffer signature,
|
||||
optional DoneCallback callback);
|
||||
|
||||
// Matches certificateProvider.CertificatesCallback. Must be called without
|
||||
// the certificates argument to report an error.
|
||||
static void reportCertificates(
|
||||
long requestId,
|
||||
optional certificateProvider.CertificateInfo[] certificates,
|
||||
optional ResultCallback callback);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
// Copyright 2019 The Chromium Authors
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Private API for Chrome component extensions to report errors.
|
||||
[platforms=("chromeos")]
|
||||
namespace crashReportPrivate {
|
||||
// A dictionary containing additional context about the error.
|
||||
dictionary ErrorInfo {
|
||||
// The error message.
|
||||
DOMString message;
|
||||
|
||||
// URL where the error occurred.
|
||||
// Must be the full URL, containing the protocol (e.g.
|
||||
// http://www.example.com).
|
||||
DOMString url;
|
||||
|
||||
// Name of the product where the error occurred.
|
||||
// Defaults to the product variant of Chrome that is hosting the extension.
|
||||
// (e.g. "Chrome" or "Chrome_ChromeOS").
|
||||
DOMString? product;
|
||||
|
||||
// Version of the product where the error occurred.
|
||||
// Defaults to the version of Chrome that is hosting the extension (e.g.
|
||||
// "73.0.3683.75").
|
||||
DOMString? version;
|
||||
|
||||
// Line number where the error occurred.
|
||||
long? lineNumber;
|
||||
|
||||
// Column number where the error occurred.
|
||||
long? columnNumber;
|
||||
|
||||
// Used to map the obfuscated source code back to a source map. If present,
|
||||
// must match the debug_id used to upload the source map.
|
||||
DOMString? debugId;
|
||||
|
||||
// String containing the stack trace for the error.
|
||||
// Defaults to the empty string.
|
||||
DOMString? stackTrace;
|
||||
};
|
||||
|
||||
// Callback for |reportError|.
|
||||
callback ReportCallback = void ();
|
||||
|
||||
interface Functions {
|
||||
// Report and upload an error to Crash.
|
||||
// |info|: Information about the error.
|
||||
// |callback|: Called when the error has been uploaded.
|
||||
static void reportError(
|
||||
ErrorInfo info,
|
||||
ReportCallback callback);
|
||||
};
|
||||
};
|
||||
@@ -1,834 +0,0 @@
|
||||
// Copyright 2012 The Chromium Authors
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// developerPrivate API.
|
||||
// This is a private API exposing developing and debugging functionalities for
|
||||
// apps and extensions.
|
||||
[implemented_in = "chrome/browser/extensions/api/developer_private/developer_private_functions.h"]
|
||||
namespace developerPrivate {
|
||||
// DEPRECATED: Use OpenDevTools.
|
||||
dictionary InspectOptions {
|
||||
DOMString extension_id;
|
||||
(DOMString or long) render_process_id;
|
||||
(DOMString or long) render_view_id;
|
||||
boolean incognito;
|
||||
};
|
||||
|
||||
enum ExtensionType {
|
||||
HOSTED_APP,
|
||||
PLATFORM_APP,
|
||||
LEGACY_PACKAGED_APP,
|
||||
EXTENSION,
|
||||
THEME,
|
||||
SHARED_MODULE
|
||||
};
|
||||
|
||||
enum Location {
|
||||
FROM_STORE,
|
||||
UNPACKED,
|
||||
THIRD_PARTY,
|
||||
INSTALLED_BY_DEFAULT,
|
||||
// "Unknown" includes crx's installed from chrome://extensions.
|
||||
UNKNOWN
|
||||
};
|
||||
|
||||
enum ViewType {
|
||||
APP_WINDOW,
|
||||
BACKGROUND_CONTENTS,
|
||||
COMPONENT,
|
||||
EXTENSION_BACKGROUND_PAGE,
|
||||
EXTENSION_GUEST,
|
||||
EXTENSION_POPUP,
|
||||
EXTENSION_SERVICE_WORKER_BACKGROUND,
|
||||
TAB_CONTENTS,
|
||||
OFFSCREEN_DOCUMENT,
|
||||
EXTENSION_SIDE_PANEL,
|
||||
DEVELOPER_TOOLS
|
||||
};
|
||||
|
||||
enum ErrorType {
|
||||
MANIFEST,
|
||||
RUNTIME
|
||||
};
|
||||
|
||||
enum ErrorLevel {
|
||||
LOG,
|
||||
WARN,
|
||||
ERROR
|
||||
};
|
||||
|
||||
enum ExtensionState {
|
||||
ENABLED,
|
||||
DISABLED,
|
||||
TERMINATED,
|
||||
BLOCKLISTED
|
||||
};
|
||||
|
||||
enum CommandScope {
|
||||
GLOBAL,
|
||||
CHROME
|
||||
};
|
||||
|
||||
enum SafetyCheckWarningReason {
|
||||
UNPUBLISHED,
|
||||
POLICY,
|
||||
MALWARE,
|
||||
OFFSTORE,
|
||||
UNWANTED,
|
||||
NO_PRIVACY_PRACTICE
|
||||
};
|
||||
|
||||
dictionary AccessModifier {
|
||||
boolean isEnabled;
|
||||
boolean isActive;
|
||||
};
|
||||
|
||||
dictionary StackFrame {
|
||||
long lineNumber;
|
||||
long columnNumber;
|
||||
DOMString url;
|
||||
DOMString functionName;
|
||||
};
|
||||
|
||||
dictionary ManifestError {
|
||||
ErrorType type;
|
||||
DOMString extensionId;
|
||||
boolean fromIncognito;
|
||||
DOMString source;
|
||||
DOMString message;
|
||||
long id;
|
||||
DOMString manifestKey;
|
||||
DOMString? manifestSpecific;
|
||||
};
|
||||
|
||||
dictionary RuntimeError {
|
||||
ErrorType type;
|
||||
DOMString extensionId;
|
||||
boolean fromIncognito;
|
||||
DOMString source;
|
||||
DOMString message;
|
||||
long id;
|
||||
ErrorLevel severity;
|
||||
DOMString contextUrl;
|
||||
long occurrences;
|
||||
long renderViewId;
|
||||
long renderProcessId;
|
||||
boolean canInspect;
|
||||
boolean isServiceWorker;
|
||||
StackFrame[] stackTrace;
|
||||
};
|
||||
|
||||
dictionary DisableReasons {
|
||||
boolean suspiciousInstall;
|
||||
boolean corruptInstall;
|
||||
boolean updateRequired;
|
||||
boolean publishedInStoreRequired;
|
||||
boolean blockedByPolicy;
|
||||
boolean reloading;
|
||||
boolean custodianApprovalRequired;
|
||||
boolean parentDisabledPermissions;
|
||||
boolean unsupportedManifestVersion;
|
||||
boolean unsupportedDeveloperExtension;
|
||||
};
|
||||
|
||||
dictionary OptionsPage {
|
||||
boolean openInTab;
|
||||
DOMString url;
|
||||
};
|
||||
|
||||
dictionary HomePage {
|
||||
DOMString url;
|
||||
boolean specified;
|
||||
};
|
||||
|
||||
dictionary ExtensionView {
|
||||
DOMString url;
|
||||
long renderProcessId;
|
||||
// This actually refers to a render frame.
|
||||
long renderViewId;
|
||||
boolean incognito;
|
||||
boolean isIframe;
|
||||
ViewType type;
|
||||
};
|
||||
|
||||
enum HostAccess {
|
||||
ON_CLICK,
|
||||
ON_SPECIFIC_SITES,
|
||||
ON_ALL_SITES
|
||||
};
|
||||
|
||||
dictionary SafetyCheckStrings {
|
||||
DOMString? panelString;
|
||||
DOMString? detailString;
|
||||
};
|
||||
|
||||
dictionary ControlledInfo {
|
||||
DOMString text;
|
||||
};
|
||||
|
||||
dictionary Command {
|
||||
DOMString description;
|
||||
DOMString keybinding;
|
||||
DOMString name;
|
||||
boolean isActive;
|
||||
CommandScope scope;
|
||||
boolean isExtensionAction;
|
||||
};
|
||||
|
||||
dictionary DependentExtension {
|
||||
DOMString id;
|
||||
DOMString name;
|
||||
};
|
||||
|
||||
dictionary Permission {
|
||||
DOMString message;
|
||||
DOMString[] submessages;
|
||||
};
|
||||
|
||||
dictionary SiteControl {
|
||||
// The host pattern for the site.
|
||||
DOMString host;
|
||||
// Whether the pattern has been granted.
|
||||
boolean granted;
|
||||
};
|
||||
|
||||
dictionary RuntimeHostPermissions {
|
||||
// True if |hosts| contains an all hosts like pattern.
|
||||
boolean hasAllHosts;
|
||||
|
||||
// The current HostAccess setting for the extension.
|
||||
HostAccess hostAccess;
|
||||
|
||||
// The site controls for all granted and requested patterns.
|
||||
SiteControl[] hosts;
|
||||
};
|
||||
|
||||
dictionary Permissions {
|
||||
Permission[] simplePermissions;
|
||||
|
||||
// Only populated for extensions that can be affected by the runtime host
|
||||
// permissions feature.
|
||||
RuntimeHostPermissions? runtimeHostPermissions;
|
||||
};
|
||||
|
||||
dictionary ExtensionInfo {
|
||||
DOMString? blocklistText;
|
||||
SafetyCheckStrings? safetyCheckText;
|
||||
Command[] commands;
|
||||
ControlledInfo? controlledInfo;
|
||||
DependentExtension[] dependentExtensions;
|
||||
DOMString description;
|
||||
DisableReasons disableReasons;
|
||||
AccessModifier errorCollection;
|
||||
AccessModifier fileAccess;
|
||||
boolean fileAccessPendingChange;
|
||||
HomePage homePage;
|
||||
DOMString iconUrl;
|
||||
DOMString id;
|
||||
AccessModifier incognitoAccess;
|
||||
AccessModifier userScriptsAccess;
|
||||
boolean incognitoAccessPendingChange;
|
||||
DOMString[] installWarnings;
|
||||
boolean isCommandRegistrationHandledExternally;
|
||||
DOMString? launchUrl;
|
||||
Location location;
|
||||
DOMString? locationText;
|
||||
ManifestError[] manifestErrors;
|
||||
DOMString manifestHomePageUrl;
|
||||
boolean mustRemainInstalled;
|
||||
DOMString name;
|
||||
boolean offlineEnabled;
|
||||
OptionsPage? optionsPage;
|
||||
DOMString? path;
|
||||
Permissions permissions;
|
||||
DOMString? prettifiedPath;
|
||||
DOMString? recommendationsUrl;
|
||||
RuntimeError[] runtimeErrors;
|
||||
DOMString[] runtimeWarnings;
|
||||
ExtensionState state;
|
||||
ExtensionType type;
|
||||
DOMString updateUrl;
|
||||
boolean userMayModify;
|
||||
DOMString version;
|
||||
ExtensionView[] views;
|
||||
DOMString webStoreUrl;
|
||||
boolean showSafeBrowsingAllowlistWarning;
|
||||
SafetyCheckWarningReason? safetyCheckWarningReason;
|
||||
boolean showAccessRequestsInToolbar;
|
||||
boolean? pinnedToToolbar;
|
||||
boolean isAffectedByMV2Deprecation;
|
||||
boolean didAcknowledgeMV2DeprecationNotice;
|
||||
boolean canUploadAsAccountExtension;
|
||||
};
|
||||
|
||||
dictionary ProfileInfo {
|
||||
boolean canLoadUnpacked;
|
||||
boolean inDeveloperMode;
|
||||
boolean isDeveloperModeControlledByPolicy;
|
||||
boolean isIncognitoAvailable;
|
||||
boolean isChildAccount;
|
||||
boolean isMv2DeprecationNoticeDismissed;
|
||||
};
|
||||
|
||||
dictionary GetExtensionsInfoOptions {
|
||||
boolean? includeDisabled;
|
||||
boolean? includeTerminated;
|
||||
};
|
||||
|
||||
dictionary ExtensionConfigurationUpdate {
|
||||
DOMString extensionId;
|
||||
boolean? fileAccess;
|
||||
boolean? incognitoAccess;
|
||||
boolean? userScriptsAccess;
|
||||
boolean? errorCollection;
|
||||
HostAccess? hostAccess;
|
||||
boolean? showAccessRequestsInToolbar;
|
||||
SafetyCheckWarningReason? acknowledgeSafetyCheckWarningReason;
|
||||
boolean? acknowledgeSafetyCheckWarning;
|
||||
boolean? pinnedToToolbar;
|
||||
};
|
||||
|
||||
dictionary ProfileConfigurationUpdate {
|
||||
boolean? inDeveloperMode;
|
||||
boolean? isMv2DeprecationNoticeDismissed;
|
||||
};
|
||||
|
||||
dictionary ExtensionCommandUpdate {
|
||||
DOMString extensionId;
|
||||
DOMString commandName;
|
||||
CommandScope? scope;
|
||||
DOMString? keybinding;
|
||||
};
|
||||
|
||||
dictionary ReloadOptions {
|
||||
// If false, an alert dialog will show in the event of a reload error.
|
||||
// Defaults to false.
|
||||
boolean? failQuietly;
|
||||
|
||||
// If true, populates a LoadError for the response rather than setting
|
||||
// lastError. Only relevant for unpacked extensions; it will be ignored for
|
||||
// any other extension.
|
||||
boolean? populateErrorForUnpacked;
|
||||
};
|
||||
|
||||
dictionary LoadUnpackedOptions {
|
||||
// If false, an alert dialog will show in the event of a reload error.
|
||||
// Defaults to false.
|
||||
boolean? failQuietly;
|
||||
|
||||
// If true, populates a LoadError for the response rather than setting
|
||||
// lastError.
|
||||
boolean? populateError;
|
||||
|
||||
// A unique identifier for retrying a previous failed load. This should be
|
||||
// the identifier returned in the LoadError. If specified, the path
|
||||
// associated with the identifier will be loaded, and the file chooser
|
||||
// will be skipped.
|
||||
DOMString? retryGuid;
|
||||
|
||||
// True if the function should try to load an extension from the drop data
|
||||
// of the page. notifyDragInstallInProgress() needs to be called prior to
|
||||
// this being used. This cannot be used with |retryGuid|.
|
||||
boolean? useDraggedPath;
|
||||
};
|
||||
|
||||
// Describes which set of sites a given url/string is associated with. Note
|
||||
// that a site can belong to multiple sets at the same time.
|
||||
enum SiteSet {
|
||||
// The site is specified by the user to automatically grant access to all
|
||||
// extensions with matching host permissions. Mutually exclusive with
|
||||
// USER_RESTRICTED but takes precedence over EXTENSION_SPECIFIED.
|
||||
USER_PERMITTED,
|
||||
// The site is specified by the user to disallow all extensions from running
|
||||
// on it. Mutually exclusive with USER_PERMITTED but takes precedence over
|
||||
// EXTENSION_SPECIFIED.
|
||||
USER_RESTRICTED,
|
||||
// The site is specified by one or more extensions' set of host permissions.
|
||||
EXTENSION_SPECIFIED
|
||||
};
|
||||
|
||||
dictionary UserSiteSettingsOptions {
|
||||
// Specifies which set of user specified sites that the host will be added
|
||||
// to or removed from.
|
||||
SiteSet siteSet;
|
||||
// The sites to add/remove.
|
||||
DOMString[] hosts;
|
||||
};
|
||||
|
||||
dictionary UserSiteSettings {
|
||||
// The list of origins where the user has allowed all extensions to run on.
|
||||
DOMString[] permittedSites;
|
||||
// The list of origins where the user has blocked all extensions from
|
||||
// running on.
|
||||
DOMString[] restrictedSites;
|
||||
};
|
||||
|
||||
dictionary SiteInfo {
|
||||
// The site set that `site` belongs to.
|
||||
SiteSet siteSet;
|
||||
// The number of extensions with access to `site`.
|
||||
// TODO(crbug.com/40227416): A tricky edge case is when one extension
|
||||
// specifies something like *.foo.com and another specifies foo.com.
|
||||
// Patterns which match all subdomains should be represented differently.
|
||||
long numExtensions;
|
||||
// The site itself. This could either be a user specified site or an
|
||||
// extension host permission pattern.
|
||||
DOMString site;
|
||||
};
|
||||
|
||||
dictionary SiteGroup {
|
||||
// The common effective top level domain plus one (eTLD+1) for all sites in
|
||||
// `sites`.
|
||||
DOMString etldPlusOne;
|
||||
// The number of extensions that can run on at least one site inside `sites`
|
||||
// for this eTLD+1.
|
||||
long numExtensions;
|
||||
// The list of user or extension specified sites that share the same eTLD+1.
|
||||
SiteInfo[] sites;
|
||||
};
|
||||
|
||||
dictionary MatchingExtensionInfo {
|
||||
// The id of the matching extension.
|
||||
DOMString id;
|
||||
// Describes the extension's access to the queried site from
|
||||
// getMatchingExtensionsForSite. Note that the meaning is different from the
|
||||
// original enum:
|
||||
// - ON_CLICK: The extension requested access to the site but its access is
|
||||
// withheld.
|
||||
// - ON_SPECIFIC_SITES: the extension is permitted to run on at least one
|
||||
// site specified by the queried site but it does not request access to
|
||||
// all sites or it has its access withheld on at least one site in its
|
||||
// host permissions.
|
||||
// - ON_ALL_SITES: the extension is permitted to run on all sites.
|
||||
HostAccess siteAccess;
|
||||
// Whether the matching extension requests access to all sites in its
|
||||
// host permissions.
|
||||
boolean canRequestAllSites;
|
||||
};
|
||||
|
||||
dictionary ExtensionSiteAccessUpdate {
|
||||
// The id of the extension to update its site access settings for.
|
||||
DOMString id;
|
||||
// Describes the update made to the extension's site access for a given site
|
||||
// Note that this has a different meaning from the original enum:
|
||||
// - ON_CLICK: Withholds the extension's access to the given site,
|
||||
// - ON_SPECIFIC_SITES: Grants the extension access to the intersection of
|
||||
// (given site, extension's specified host permissions.)
|
||||
// - ON_ALL_SITES: Grants access to all of the extension's specified host
|
||||
// permissions.
|
||||
HostAccess siteAccess;
|
||||
};
|
||||
|
||||
enum PackStatus {
|
||||
SUCCESS,
|
||||
ERROR,
|
||||
WARNING
|
||||
};
|
||||
|
||||
enum FileType {
|
||||
LOAD,
|
||||
PEM
|
||||
};
|
||||
|
||||
enum SelectType {
|
||||
FILE,
|
||||
FOLDER
|
||||
};
|
||||
|
||||
enum EventType {
|
||||
INSTALLED,
|
||||
UNINSTALLED,
|
||||
LOADED,
|
||||
UNLOADED,
|
||||
// New window / view opened.
|
||||
VIEW_REGISTERED,
|
||||
// window / view closed.
|
||||
VIEW_UNREGISTERED,
|
||||
ERROR_ADDED,
|
||||
ERRORS_REMOVED,
|
||||
PREFS_CHANGED,
|
||||
WARNINGS_CHANGED,
|
||||
COMMAND_ADDED,
|
||||
COMMAND_REMOVED,
|
||||
PERMISSIONS_CHANGED,
|
||||
SERVICE_WORKER_STARTED,
|
||||
SERVICE_WORKER_STOPPED,
|
||||
CONFIGURATION_CHANGED,
|
||||
PINNED_ACTIONS_CHANGED
|
||||
};
|
||||
|
||||
dictionary PackDirectoryResponse {
|
||||
// The response message of success or error.
|
||||
DOMString message;
|
||||
|
||||
// Unpacked items's path.
|
||||
DOMString item_path;
|
||||
|
||||
// Permanent key path.
|
||||
DOMString pem_path;
|
||||
|
||||
long override_flags;
|
||||
PackStatus status;
|
||||
};
|
||||
|
||||
dictionary ProjectInfo {
|
||||
DOMString name;
|
||||
};
|
||||
|
||||
dictionary EventData {
|
||||
EventType event_type;
|
||||
DOMString item_id;
|
||||
ExtensionInfo? extensionInfo;
|
||||
};
|
||||
|
||||
dictionary ErrorFileSource {
|
||||
// The region before the "highlight" portion.
|
||||
// If the region which threw the error was not found, the full contents of
|
||||
// the file will be in the "beforeHighlight" section.
|
||||
DOMString beforeHighlight;
|
||||
|
||||
// The region of the code which threw the error, and should be highlighted.
|
||||
DOMString highlight;
|
||||
|
||||
// The region after the "highlight" portion.
|
||||
DOMString afterHighlight;
|
||||
};
|
||||
|
||||
dictionary LoadError {
|
||||
// The error that occurred when trying to load the extension.
|
||||
DOMString error;
|
||||
|
||||
// The path to the extension.
|
||||
DOMString path;
|
||||
|
||||
// The file source for the error, if it could be retrieved.
|
||||
ErrorFileSource? source;
|
||||
|
||||
// A unique identifier to pass to developerPrivate.loadUnpacked to retry
|
||||
// loading the extension at the same path.
|
||||
DOMString retryGuid;
|
||||
};
|
||||
|
||||
dictionary RequestFileSourceProperties {
|
||||
// The ID of the extension owning the file.
|
||||
DOMString extensionId;
|
||||
|
||||
// The path of the file, relative to the extension; e.g., manifest.json,
|
||||
// script.js, or main.html.
|
||||
DOMString pathSuffix;
|
||||
|
||||
// The error message which was thrown as a result of the error in the file.
|
||||
DOMString message;
|
||||
|
||||
// The key in the manifest which caused the error (e.g., "permissions").
|
||||
// (Required for "manifest.json" files)
|
||||
DOMString? manifestKey;
|
||||
|
||||
// The specific portion of the manifest key which caused the error (e.g.,
|
||||
// "foo" in the "permissions" key). (Optional for "manifest.json" file).
|
||||
DOMString? manifestSpecific;
|
||||
|
||||
// The line number which caused the error (optional for non-manifest files).
|
||||
long? lineNumber;
|
||||
};
|
||||
|
||||
dictionary RequestFileSourceResponse {
|
||||
// The source code related to the request. Only populated if the file
|
||||
// was successfully read.
|
||||
ErrorFileSource? source;
|
||||
|
||||
// A title for the file in the form '<extension name>: <file name>'.
|
||||
DOMString title;
|
||||
|
||||
// The error message.
|
||||
DOMString message;
|
||||
};
|
||||
|
||||
dictionary OpenDevToolsProperties {
|
||||
// The ID of the extension. This is only needed if opening its background
|
||||
// page or its background service worker (where renderViewId and
|
||||
// renderProcessId are -1).
|
||||
DOMString? extensionId;
|
||||
|
||||
// The ID of the render frame in which the error occurred.
|
||||
// Despite being called renderViewId, this refers to a render frame.
|
||||
long renderViewId;
|
||||
|
||||
// The ID of the process in which the error occurred.
|
||||
long renderProcessId;
|
||||
|
||||
// Whether or not the background is service worker based.
|
||||
boolean? isServiceWorker;
|
||||
|
||||
boolean? incognito;
|
||||
|
||||
// The URL in which the error occurred.
|
||||
DOMString? url;
|
||||
|
||||
// The line to focus the devtools at.
|
||||
long? lineNumber;
|
||||
|
||||
// The column to focus the devtools at.
|
||||
long? columnNumber;
|
||||
};
|
||||
|
||||
dictionary DeleteExtensionErrorsProperties {
|
||||
DOMString extensionId;
|
||||
long[]? errorIds;
|
||||
ErrorType? type;
|
||||
};
|
||||
|
||||
callback VoidCallback = void ();
|
||||
callback ExtensionInfosCallback = void (ExtensionInfo[] result);
|
||||
callback ExtensionInfoCallback = void (ExtensionInfo result);
|
||||
callback ProfileInfoCallback = void (ProfileInfo info);
|
||||
callback PackCallback = void (PackDirectoryResponse response);
|
||||
callback StringCallback = void (DOMString string);
|
||||
callback RequestFileSourceCallback =
|
||||
void (RequestFileSourceResponse response);
|
||||
callback LoadErrorCallback = void (optional LoadError error);
|
||||
callback DragInstallInProgressCallback = void (DOMString loadGuid);
|
||||
callback UserSiteSettingsCallback = void (UserSiteSettings settings);
|
||||
callback UserAndExtensionSitesByEtldCallback = void (SiteGroup[] siteGroups);
|
||||
callback GetMatchingExtensionsForSiteCallback =
|
||||
void (MatchingExtensionInfo[] matchingExtensions);
|
||||
callback BoolCallback = void(boolean result);
|
||||
|
||||
interface Functions {
|
||||
// Runs auto update for extensions and apps immediately.
|
||||
// |callback| : Called after update check completes.
|
||||
static void autoUpdate(optional VoidCallback callback);
|
||||
|
||||
// Returns information of all the extensions and apps installed.
|
||||
// |options| : Options to restrict the items returned.
|
||||
// |callback| : Called with extensions info.
|
||||
static void getExtensionsInfo(
|
||||
optional GetExtensionsInfoOptions options,
|
||||
optional ExtensionInfosCallback callback);
|
||||
|
||||
// Returns information of a particular extension.
|
||||
// |id| : The id of the extension.
|
||||
// |callback| : Called with the result.
|
||||
static void getExtensionInfo(
|
||||
DOMString id,
|
||||
optional ExtensionInfoCallback callback);
|
||||
|
||||
// Returns the size of a particular extension on disk (already formatted).
|
||||
// |id| : The id of the extension.
|
||||
// |callback| : Called with the result.
|
||||
static void getExtensionSize(
|
||||
DOMString id,
|
||||
StringCallback callback);
|
||||
|
||||
// Returns the current profile's configuration.
|
||||
static void getProfileConfiguration(
|
||||
ProfileInfoCallback callback);
|
||||
|
||||
// Updates the active profile.
|
||||
// |update| : The parameters for updating the profile's configuration. Any
|
||||
// properties omitted from |update| will not be changed.
|
||||
static void updateProfileConfiguration(
|
||||
ProfileConfigurationUpdate update,
|
||||
optional VoidCallback callback);
|
||||
|
||||
// Reloads a given extension.
|
||||
// |extensionId| : The id of the extension to reload.
|
||||
// |options| : Additional configuration parameters.
|
||||
static void reload(
|
||||
DOMString extensionId,
|
||||
optional ReloadOptions options,
|
||||
optional LoadErrorCallback callback);
|
||||
|
||||
// Modifies an extension's current configuration.
|
||||
// |update| : The parameters for updating the extension's configuration.
|
||||
// Any properties omitted from |update| will not be changed.
|
||||
static void updateExtensionConfiguration(
|
||||
ExtensionConfigurationUpdate update,
|
||||
optional VoidCallback callback);
|
||||
|
||||
// Loads a user-selected unpacked item.
|
||||
// |options| : Additional configuration parameters.
|
||||
static void loadUnpacked(
|
||||
optional LoadUnpackedOptions options,
|
||||
optional LoadErrorCallback callback);
|
||||
|
||||
// Installs the file that was dragged and dropped onto the associated
|
||||
// page.
|
||||
static void installDroppedFile(
|
||||
optional VoidCallback callback);
|
||||
|
||||
// Notifies the browser that a user began a drag in order to install an
|
||||
// extension.
|
||||
static void notifyDragInstallInProgress();
|
||||
|
||||
// Loads an extension / app.
|
||||
// |directory| : The directory to load the extension from.
|
||||
static void loadDirectory(
|
||||
[instanceOf=DirectoryEntry] object directory,
|
||||
StringCallback callback);
|
||||
|
||||
// Open Dialog to browse to an entry.
|
||||
// |selectType| : Select a file or a folder.
|
||||
// |fileType| : Required file type. For example, pem type is for private
|
||||
// key and load type is for an unpacked item.
|
||||
// |callback| : called with selected item's path.
|
||||
static void choosePath(
|
||||
SelectType selectType,
|
||||
FileType fileType,
|
||||
StringCallback callback);
|
||||
|
||||
// Pack an extension.
|
||||
// |rootPath| : The path of the extension.
|
||||
// |privateKeyPath| : The path of the private key, if one is given.
|
||||
// |flags| : Special flags to apply to the loading process, if any.
|
||||
// |callback| : called with the success result string.
|
||||
static void packDirectory(
|
||||
DOMString path,
|
||||
optional DOMString privateKeyPath,
|
||||
optional long flags,
|
||||
optional PackCallback callback);
|
||||
|
||||
// Reads and returns the contents of a file related to an extension which
|
||||
// caused an error.
|
||||
static void requestFileSource(
|
||||
RequestFileSourceProperties properties,
|
||||
RequestFileSourceCallback callback);
|
||||
|
||||
// Open the developer tools to focus on a particular error.
|
||||
static void openDevTools(
|
||||
OpenDevToolsProperties properties,
|
||||
optional VoidCallback callback);
|
||||
|
||||
// Delete reported extension errors.
|
||||
// |properties| : The properties specifying the errors to remove.
|
||||
static void deleteExtensionErrors(
|
||||
DeleteExtensionErrorsProperties properties,
|
||||
optional VoidCallback callback);
|
||||
|
||||
// Repairs the extension specified.
|
||||
// |extensionId| : The id of the extension to repair.
|
||||
static void repairExtension(
|
||||
DOMString extensionId,
|
||||
optional VoidCallback callback);
|
||||
|
||||
// Shows the options page for the extension specified.
|
||||
// |extensionId| : The id of the extension to show the options page for.
|
||||
static void showOptions(
|
||||
DOMString extensionId,
|
||||
optional VoidCallback callback);
|
||||
|
||||
// Shows the path of the extension specified.
|
||||
// |extensionId| : The id of the extension to show the path for.
|
||||
static void showPath(
|
||||
DOMString extensionId,
|
||||
optional VoidCallback callback);
|
||||
|
||||
// (Un)suspends global shortcut handling.
|
||||
// |isSuspended| : Whether or not shortcut handling should be suspended.
|
||||
static void setShortcutHandlingSuspended(
|
||||
boolean isSuspended,
|
||||
optional VoidCallback callback);
|
||||
|
||||
// Updates an extension command.
|
||||
// |update| : The parameters for updating the extension command.
|
||||
static void updateExtensionCommand(
|
||||
ExtensionCommandUpdate update,
|
||||
optional VoidCallback callback);
|
||||
|
||||
// Adds a new host permission to the extension. The extension will only
|
||||
// have access to the host if it is within the requested permissions.
|
||||
// |extensionId|: The id of the extension to modify.
|
||||
// |host|: The host to add.
|
||||
static void addHostPermission(
|
||||
DOMString extensionId,
|
||||
DOMString host,
|
||||
optional VoidCallback callback);
|
||||
|
||||
// Removes a host permission from the extension. This should only be called
|
||||
// with a host that the extension has access to.
|
||||
// |extensionId|: The id of the extension to modify.
|
||||
// |host|: The host to remove.
|
||||
static void removeHostPermission(
|
||||
DOMString extensionId,
|
||||
DOMString host,
|
||||
optional VoidCallback callback);
|
||||
|
||||
// Returns the user specified site settings (which origins can extensions
|
||||
// always/never run on) for the current profile.
|
||||
static void getUserSiteSettings(
|
||||
UserSiteSettingsCallback callback);
|
||||
|
||||
// Adds hosts to the set of user permitted or restricted sites. If any hosts
|
||||
// are in the other set than what's specified in `options`, then they are
|
||||
// removed from that set.
|
||||
static void addUserSpecifiedSites(
|
||||
UserSiteSettingsOptions options,
|
||||
optional VoidCallback callback);
|
||||
|
||||
// Removes hosts from the specified set of user permitted or restricted
|
||||
// sites.
|
||||
static void removeUserSpecifiedSites(
|
||||
UserSiteSettingsOptions options,
|
||||
optional VoidCallback callback);
|
||||
|
||||
// Returns all hosts specified by user site settings, grouped by each host's
|
||||
// eTLD+1.
|
||||
static void getUserAndExtensionSitesByEtld(
|
||||
UserAndExtensionSitesByEtldCallback callback);
|
||||
|
||||
// Returns a list of extensions which have at least one matching site in
|
||||
// common between its set of host permissions and `site`.
|
||||
static void getMatchingExtensionsForSite(
|
||||
DOMString site,
|
||||
GetMatchingExtensionsForSiteCallback callback);
|
||||
|
||||
// Updates the site access settings for multiple extensions for the given
|
||||
// `site` and calls `callback` once all updates have been finished.
|
||||
// Each update species an extension id an a new HostAccess setting.
|
||||
static void updateSiteAccess(
|
||||
DOMString site,
|
||||
ExtensionSiteAccessUpdate[] updates,
|
||||
optional VoidCallback callback);
|
||||
|
||||
// Removes multiple installed extensions.
|
||||
static void removeMultipleExtensions(
|
||||
DOMString[] extensionIds,
|
||||
optional VoidCallback callback);
|
||||
|
||||
// Dismisses the menu notification for the extensions module in Safety Hub
|
||||
// if one is active.
|
||||
static void dismissSafetyHubExtensionsMenuNotification();
|
||||
|
||||
// Triggers the dismissal of the mv2 deprecation notice for `extensionId`.
|
||||
static void dismissMv2DeprecationNoticeForExtension(DOMString extensionId);
|
||||
|
||||
// Uploads an extension to the signed in user's account and returns whether
|
||||
// the extension is actually uploaded in `callback`. If the extension is not
|
||||
// eligible for upload or if there is no signed in user, returns an error.
|
||||
static void uploadExtensionToAccount(DOMString extensionId,
|
||||
BoolCallback callback);
|
||||
|
||||
// Shows the site settings for the extension.
|
||||
[platforms=("desktop_android")]
|
||||
static void showSiteSettings(
|
||||
DOMString extensionId
|
||||
);
|
||||
|
||||
[nocompile, deprecated="Use openDevTools"]
|
||||
static void inspect(InspectOptions options,
|
||||
optional VoidCallback callback);
|
||||
};
|
||||
|
||||
interface Events {
|
||||
// Fired when a item state is changed.
|
||||
static void onItemStateChanged(EventData response);
|
||||
|
||||
// Fired when the profile's state has changed.
|
||||
static void onProfileStateChanged(ProfileInfo info);
|
||||
|
||||
// Fired when the lists of sites in the user's site settings have changed.
|
||||
static void onUserSiteSettingsChanged(UserSiteSettings settings);
|
||||
};
|
||||
|
||||
};
|
||||
@@ -1,655 +0,0 @@
|
||||
// Copyright 2014 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.documentScan</code> API to discover and retrieve
|
||||
// images from attached document scanners.
|
||||
[platforms=("chromeos"),
|
||||
implemented_in="chrome/browser/extensions/api/document_scan/document_scan_api.h"]
|
||||
namespace documentScan {
|
||||
dictionary ScanOptions {
|
||||
// The MIME types that are accepted by the caller.
|
||||
DOMString[]? mimeTypes;
|
||||
|
||||
// The number of scanned images allowed. The default is 1.
|
||||
long? maxImages;
|
||||
};
|
||||
|
||||
dictionary ScanResults {
|
||||
// An array of data image URLs in a form that can be passed as the "src"
|
||||
// value to an image tag.
|
||||
DOMString[] dataUrls;
|
||||
|
||||
// The MIME type of the <code>dataUrls</code>.
|
||||
DOMString mimeType;
|
||||
};
|
||||
|
||||
// An enum that indicates the result of each operation.
|
||||
enum OperationResult {
|
||||
// An unknown or generic failure occurred.
|
||||
UNKNOWN,
|
||||
|
||||
// The operation succeeded.
|
||||
SUCCESS,
|
||||
|
||||
// The operation is not supported.
|
||||
UNSUPPORTED,
|
||||
|
||||
// The operation was cancelled.
|
||||
CANCELLED,
|
||||
|
||||
// The device is busy.
|
||||
DEVICE_BUSY,
|
||||
|
||||
// Either the data or an argument passed to the method is not valid.
|
||||
INVALID,
|
||||
|
||||
// The supplied value is the wrong data type for the underlying option.
|
||||
WRONG_TYPE,
|
||||
|
||||
// No more data is available.
|
||||
EOF,
|
||||
|
||||
// The document feeder is jammed.
|
||||
ADF_JAMMED,
|
||||
|
||||
// The document feeder is empty.
|
||||
ADF_EMPTY,
|
||||
|
||||
// The flatbed cover is open.
|
||||
COVER_OPEN,
|
||||
|
||||
// An error occurred while communicating with the device.
|
||||
IO_ERROR,
|
||||
|
||||
// The device requires authentication.
|
||||
ACCESS_DENIED,
|
||||
|
||||
// Not enough memory is available on the Chromebook to complete the
|
||||
// operation.
|
||||
NO_MEMORY,
|
||||
|
||||
// The device is not reachable.
|
||||
UNREACHABLE,
|
||||
|
||||
// The device is disconnected.
|
||||
MISSING,
|
||||
|
||||
// An error has occurred somewhere other than the calling application.
|
||||
INTERNAL_ERROR
|
||||
};
|
||||
|
||||
// Indicates how the scanner is connected to the computer.
|
||||
enum ConnectionType {
|
||||
UNSPECIFIED,
|
||||
USB,
|
||||
NETWORK
|
||||
};
|
||||
|
||||
// Contains general information about a scanner. It is
|
||||
// intended for filtering and constructing user-facing information. to
|
||||
// configure a scan, use $(ref:StartScanOptions).
|
||||
dictionary ScannerInfo {
|
||||
// The ID of a specific scanner.
|
||||
DOMString scannerId;
|
||||
|
||||
// A human-readable name for the scanner to display in the UI.
|
||||
DOMString name;
|
||||
|
||||
// The scanner manufacturer.
|
||||
DOMString manufacturer;
|
||||
|
||||
// The scanner model if it is available, or a generic description.
|
||||
DOMString model;
|
||||
|
||||
// For matching against other <code>ScannerInfo</code> entries that point
|
||||
// to the same physical device.
|
||||
DOMString deviceUuid;
|
||||
|
||||
// Indicates how the scanner is connected to the computer.
|
||||
ConnectionType connectionType;
|
||||
|
||||
// If true, the scanner connection's transport cannot be intercepted by a
|
||||
// passive listener, such as TLS or USB.
|
||||
boolean secure;
|
||||
|
||||
// An array of MIME types that can be requested for returned scans.
|
||||
DOMString[] imageFormats;
|
||||
|
||||
// A human-readable description of the protocol or driver used to
|
||||
// access the scanner, such as Mopria, WSD, or epsonds. This is primarily
|
||||
// useful for allowing a user to choose between protocols if a device
|
||||
// supports multiple protocols.
|
||||
DOMString protocolType;
|
||||
};
|
||||
|
||||
// The data type of an option.
|
||||
enum OptionType {
|
||||
// The option's data type is unknown. The <code>value</code> property
|
||||
// will be unset.
|
||||
UNKNOWN,
|
||||
|
||||
// The <code>value</code> property will be one of <code>true</code or
|
||||
// <code>false</code>.
|
||||
BOOL,
|
||||
|
||||
// A signed 32-bit integer. The <code>value</code> property will be long or
|
||||
// long[], depending on whether the option takes more than one value.
|
||||
INT,
|
||||
|
||||
// A double in the range -32768-32767.9999 with a resolution of 1/65535.
|
||||
// The <code>value</code> property will be double or double[] depending
|
||||
// on whether the option takes more than one value. Double values that
|
||||
// can't be exactly represented will be rounded to the available range
|
||||
// and precision.
|
||||
FIXED,
|
||||
|
||||
// A sequence of any bytes except NUL ('\0'). The <code>value</code>
|
||||
// property will be a DOMString.
|
||||
STRING,
|
||||
|
||||
// An option of this type has no value. Instead, setting an option of
|
||||
// this type causes an option-specific side effect in the scanner
|
||||
// driver. For example, a button-typed option could be used by a
|
||||
// scanner driver to provide a means to select default values or to
|
||||
// tell an automatic document feeder to advance to the next sheet of
|
||||
// paper.
|
||||
BUTTON,
|
||||
|
||||
// Grouping option. No value. This is included for compatibility, but
|
||||
// will not normally be returned in <code>ScannerOption</code> values. Use
|
||||
// <code>getOptionGroups()</code> to retrieve the list of groups with their
|
||||
// member options.
|
||||
GROUP
|
||||
};
|
||||
|
||||
// Indicates the data type for $(ref:ScannerOption.unit).
|
||||
enum OptionUnit {
|
||||
// The value is a unitless number. For example, it can be a threshold.
|
||||
UNITLESS,
|
||||
|
||||
// The value is a number of pixels, for example, scan dimensions.
|
||||
PIXEL,
|
||||
|
||||
// The value is the number of bits, for example, color depth.
|
||||
BIT,
|
||||
|
||||
// The value is measured in millimeters, for example, scan dimensions.
|
||||
MM,
|
||||
|
||||
// The value is measured in dots per inch, for example, resolution.
|
||||
DPI,
|
||||
|
||||
// The value is a percent, for example, brightness.
|
||||
PERCENT,
|
||||
|
||||
// The value is measured in microseconds, for example, exposure time.
|
||||
MICROSECOND
|
||||
};
|
||||
|
||||
// The data type of constraint represented by an $(ref:OptionConstraint).
|
||||
enum ConstraintType {
|
||||
// The constraint on a range of <code>OptionType.INT</code> values.
|
||||
// The <code>min</code>, <code>max</code>, and <code>quant</code> properties
|
||||
// of <code>OptionConstraint</code> will be <code>long</code>, and its
|
||||
// <code>list</code> propety will be unset.
|
||||
INT_RANGE,
|
||||
|
||||
// The constraint on a range of <code>OptionType.FIXED</code> values.
|
||||
// The <code>min</code>, <code>max</code>, and <code>quant</code> properties
|
||||
// of <code>OptionConstraint</code> will be <code>double</code>, and its
|
||||
// <code>list</code> property will be unset.
|
||||
FIXED_RANGE,
|
||||
|
||||
// The constraint on a specific list of <code>OptionType.INT</code>
|
||||
// values. The <code>OptionConstraint.list</code> property will contain
|
||||
// <code>long</code> values, and the other properties will be unset.
|
||||
INT_LIST,
|
||||
|
||||
// The constraint on a specific list of <code>OptionType.FIXED</code>
|
||||
// values. The <code>OptionConstraint.list</code> property will contain
|
||||
// <code>double</code> values, and the other properties will be unset.
|
||||
FIXED_LIST,
|
||||
|
||||
// The constraint on a specific list of <code>OptionType.STRING</code>
|
||||
// values. The <code>OptionConstraint.list</code> property will contain
|
||||
// <code>DOMString</code> values, and the other properties will be unset.
|
||||
STRING_LIST
|
||||
};
|
||||
|
||||
// The specific values for the $(ref:ConstraintType) structure.
|
||||
// An unconstrained value is represented by a lack of constraints;
|
||||
// there is no separate <code>ConstraintType</code> value to indicate an
|
||||
// unconstrained value.
|
||||
dictionary OptionConstraint {
|
||||
ConstraintType type;
|
||||
(long or double)? min;
|
||||
(long or double)? max;
|
||||
(long or double)? quant;
|
||||
(double[] or long[] or DOMString[])? list;
|
||||
};
|
||||
|
||||
// How an option can be changed.
|
||||
enum Configurability {
|
||||
// The option is read-only.
|
||||
NOT_CONFIGURABLE,
|
||||
|
||||
// The option can be set in software.
|
||||
SOFTWARE_CONFIGURABLE,
|
||||
|
||||
// The option can be set by the user toggling or pushing a button on
|
||||
// the scanner.
|
||||
HARDWARE_CONFIGURABLE
|
||||
};
|
||||
|
||||
// A self-describing configurable scanner option and its current value.
|
||||
dictionary ScannerOption {
|
||||
// The option name using lowercase ASCII letters, numbers, and dashes.
|
||||
// Diacritics are not allowed.
|
||||
DOMString name;
|
||||
|
||||
// A printable one-line title.
|
||||
DOMString title;
|
||||
|
||||
// A longer description of the option.
|
||||
DOMString description;
|
||||
|
||||
// The data type contained in the <code>value</code> property, which
|
||||
// is needed for setting this option.
|
||||
OptionType type;
|
||||
|
||||
// The unit of measurement for this option.
|
||||
OptionUnit unit;
|
||||
|
||||
// The current value of the option, if relevant. Note that the data
|
||||
// type of this property must match the data type specified in
|
||||
// <code>type</code>.
|
||||
(boolean or double or double[] or long or long[] or DOMString)? value;
|
||||
|
||||
// Defines $(ref:OptionConstraint) on the current scanner option.
|
||||
OptionConstraint? constraint;
|
||||
|
||||
// Indicates that this option can be detected from software.
|
||||
boolean isDetectable;
|
||||
|
||||
// Indicates whether and how the option can be changed.
|
||||
Configurability configurability;
|
||||
|
||||
// Can be automatically set by the scanner driver.
|
||||
boolean isAutoSettable;
|
||||
|
||||
// Emulated by the scanner driver if true.
|
||||
boolean isEmulated;
|
||||
|
||||
// Indicates the option is active and can be set or retrieved. If false,
|
||||
// the <code>value</code> property will not be set.
|
||||
boolean isActive;
|
||||
|
||||
// Indicates that the UI should not display this option by default.
|
||||
boolean isAdvanced;
|
||||
|
||||
// Indicates that the option is used for internal configuration and
|
||||
// should never be displayed in the UI.
|
||||
boolean isInternal;
|
||||
};
|
||||
|
||||
// A set of criteria passed to <code>getScannerList()</code>. Only devices
|
||||
// that match all of the criteria will be returned.
|
||||
dictionary DeviceFilter {
|
||||
// Only return scanners that are directly attached to the computer.
|
||||
boolean? local;
|
||||
|
||||
// Only return scanners that use a secure transport, such as USB or TLS.
|
||||
boolean? secure;
|
||||
};
|
||||
|
||||
// Contains a list of option names. The groups and their contents are
|
||||
// determined by the scanner driver and do not have any defined semantics
|
||||
// or consistent membership. This structure is primarily intended
|
||||
// for UI layout assistance; it does not affect individual option
|
||||
// behaviors.
|
||||
dictionary OptionGroup {
|
||||
// Provides a printable title, for example "Geometry options".
|
||||
DOMString title;
|
||||
|
||||
// An array of option names in driver-provided order.
|
||||
DOMString[] members;
|
||||
};
|
||||
|
||||
// The response from $(ref:getScannerList).
|
||||
dictionary GetScannerListResponse {
|
||||
// The enumeration result. Note that partial results could be
|
||||
// returned even if this indicates an error.
|
||||
OperationResult result;
|
||||
|
||||
// A possibly-empty list of scanners that match the provided
|
||||
// $(ref:DeviceFilter).
|
||||
ScannerInfo[] scanners;
|
||||
};
|
||||
|
||||
// The response from $(ref:openScanner).
|
||||
dictionary OpenScannerResponse {
|
||||
// The scanner ID passed to <code>openScanner()</code>.
|
||||
DOMString scannerId;
|
||||
|
||||
// The result of opening the scanner. If the value of this is
|
||||
// <code>SUCCESS</code>, the <code>scannerHandle</code> and
|
||||
// <code>options</code> properties will be populated.
|
||||
OperationResult result;
|
||||
|
||||
// If <code>result</code> is <code>SUCCESS</code>, a
|
||||
// handle to the scanner that can be used for further operations.
|
||||
DOMString? scannerHandle;
|
||||
|
||||
// If <code>result</code> is <code>SUCCESS</code>,
|
||||
// provides a key-value mapping where the key is a device-specific
|
||||
// option and the value is an instance of $(ref:ScannerOption).
|
||||
object? options;
|
||||
};
|
||||
|
||||
// The response from $(ref:getOptionGroups).
|
||||
dictionary GetOptionGroupsResponse {
|
||||
// The same scanner handle as was passed to $(ref:getOptionGroups).
|
||||
DOMString scannerHandle;
|
||||
|
||||
// The result of getting the option groups. If the value of this is
|
||||
// <code>SUCCESS</code>, the <code>groups</code> property will be
|
||||
// populated.
|
||||
OperationResult result;
|
||||
|
||||
// If <code>result</code> is <code>SUCCESS</code>, provides a
|
||||
// list of option groups in the order supplied by the scanner driver.
|
||||
OptionGroup[]? groups;
|
||||
};
|
||||
|
||||
// The response from <code>closeScanner()</code>.
|
||||
dictionary CloseScannerResponse {
|
||||
// The same scanner handle as was passed to $(ref:closeScanner).
|
||||
DOMString scannerHandle;
|
||||
|
||||
// The result of closing the scanner. Even if this value is not
|
||||
// <code>SUCCESS</code>, the handle will be invalid and
|
||||
// should not be used for any further operations.
|
||||
OperationResult result;
|
||||
};
|
||||
|
||||
// Passed to $(ref:setOptions) to set an option to $(ref:ScannerOption) to
|
||||
// a new value.
|
||||
dictionary OptionSetting {
|
||||
// Indicates the name of the option to set.
|
||||
DOMString name;
|
||||
|
||||
// Indicates the data type of the option. The requested data type must
|
||||
// match the real data type of the underlying option.
|
||||
OptionType type;
|
||||
|
||||
// Indicates the value to set. Leave unset to request automatic setting for
|
||||
// options that have <code>autoSettable</code> enabled. The data type
|
||||
// supplied for <code>value</code> must match <code>type</code>.
|
||||
(boolean or double or double[] or long or long[] or DOMString)? value;
|
||||
};
|
||||
|
||||
// The result of setting an individual option. Each individual option
|
||||
// supplied to <code>setOptions()</code> produces a separate result
|
||||
// due to things like rounding and constraints.
|
||||
dictionary SetOptionResult {
|
||||
// Indicates the name of the option that was set.
|
||||
DOMString name;
|
||||
|
||||
// Indicates the result of setting the option.
|
||||
OperationResult result;
|
||||
};
|
||||
|
||||
// The response from a call to $(ref:setOptions).
|
||||
dictionary SetOptionsResponse {
|
||||
// Provides the scanner handle passed to <code>setOptions()</code>.
|
||||
DOMString scannerHandle;
|
||||
|
||||
// An array of results, one each for every passed-in
|
||||
// <code>OptionSetting</code>.
|
||||
SetOptionResult[] results;
|
||||
|
||||
// An updated key-value mapping from option names to
|
||||
// $(ref:ScannerOption) values containing the new configuration after
|
||||
// attempting to set all supplied options. This has the same structure as
|
||||
// the <code>options</code> property in $(ref:OpenScannerResponse).
|
||||
//
|
||||
// This property will be set even if some options were not set successfully,
|
||||
// but will be unset if retrieving the updated configuration fails (for
|
||||
// example, if the scanner is disconnected in the middle of scanning).
|
||||
object? options;
|
||||
};
|
||||
|
||||
// Specifies options for $(ref:startScan).
|
||||
dictionary StartScanOptions {
|
||||
// Specifies the MIME type to return scanned data in.
|
||||
DOMString format;
|
||||
|
||||
// If a non-zero value is specified, limits the maximum scanned bytes
|
||||
// returned in a single $(ref:readScanData) response to that value. The
|
||||
// smallest allowed value is 32768 (32 KB). If this property is not
|
||||
// specified, the size of a returned chunk may be as large as the entire
|
||||
// scanned image.
|
||||
long? maxReadSize;
|
||||
};
|
||||
|
||||
// The response from <code>startScan()</code>.
|
||||
dictionary StartScanResponse {
|
||||
// Provides the same scanner handle that was passed to
|
||||
// <code>startScan()</code>.
|
||||
DOMString scannerHandle;
|
||||
|
||||
// The result of starting a scan. If the value of this is
|
||||
// <code>SUCCESS</code>, the <code>job</code> property will be populated.
|
||||
OperationResult result;
|
||||
|
||||
// If <code>result</code> is <code>SUCCESS</code>, provides a
|
||||
// handle that can be used to read scan data or cancel the job.
|
||||
DOMString? job;
|
||||
};
|
||||
|
||||
// The response from <code>cancelScan()</code>.
|
||||
dictionary CancelScanResponse {
|
||||
// Provides the same job handle that was passed to
|
||||
// <code>cancelScan()</code>.
|
||||
DOMString job;
|
||||
|
||||
// The backend's cancel scan result. If the result is
|
||||
// <code>OperationResult.SUCCESS</code> or
|
||||
// <code>OperationResult.CANCELLED</code>, the scan has been cancelled and
|
||||
// the scanner is ready to start a new scan. If the result is
|
||||
// <code>OperationResult.DEVICE_BUSY </code>, the scanner is still
|
||||
// processing the requested cancellation; the caller should wait a short
|
||||
// time and try the request again. Other result values indicate a permanent
|
||||
// error that should not be retried.
|
||||
OperationResult result;
|
||||
};
|
||||
|
||||
// The response from $(ref:readScanData).
|
||||
dictionary ReadScanDataResponse {
|
||||
// Provides the job handle passed to <code>readScanData()</code>.
|
||||
DOMString job;
|
||||
|
||||
// The result of reading data. If its value is
|
||||
// <code>SUCCESS</code>, then <code>data</code> contains the
|
||||
// <em>next</em> (possibly zero-length) chunk of image data that is ready
|
||||
// for reading. If its value is <code>EOF</code>, the <code>data</code>
|
||||
// contains the <em>last</em> chunk of image data.
|
||||
OperationResult result;
|
||||
|
||||
// If <code>result</code> is <code>SUCCESS</code>, contains
|
||||
// the <em>next</em> chunk of scanned image data. If <code>result</code> is
|
||||
// <code>EOF</code>, contains the <em>last</em> chunk of
|
||||
// scanned image data.
|
||||
ArrayBuffer? data;
|
||||
|
||||
// If <code>result</code> is <code>SUCCESS</code>, an estimate of
|
||||
// how much of the total scan data has been delivered so far, in the range
|
||||
// 0 to 100.
|
||||
long? estimatedCompletion;
|
||||
};
|
||||
|
||||
// Callback from the $(ref:scan) method.
|
||||
// |result| Provides the results from the scan, if successful.
|
||||
// Otherwise, this value will be null and $(ref:runtime.lastError)
|
||||
// will be set.
|
||||
callback ScanCallback = void (ScanResults result);
|
||||
|
||||
// Callback from the $(ref:getScannerList) method.
|
||||
// |response| The response from enumeration, if the call was valid.
|
||||
// Otherwise, this value will be null and $(ref:runtime.lastError)
|
||||
// will be set.
|
||||
callback GetScannerListCallback = void (GetScannerListResponse response);
|
||||
|
||||
// Callback from the $(ref:openScanner) method.
|
||||
// |response| The response from opening the scanner, if the call was valid.
|
||||
// Otherwise, this value will be null and $(ref:runtime.lastError)
|
||||
// will be set.
|
||||
callback OpenScannerCallback = void (OpenScannerResponse response);
|
||||
|
||||
// Callback from the $(ref:getOptionGroups) method.
|
||||
// |response| The response from getting the option groups, if the call was
|
||||
// valid. Otherwise, this value will be null and $(ref:runtime.lastError)
|
||||
// will be set.
|
||||
callback GetOptionGroupsCallback =
|
||||
void (GetOptionGroupsResponse response);
|
||||
|
||||
// Callback from the $(ref:closeScanner) method.
|
||||
// |response| The response from closing the scanner, if the call was valid.
|
||||
// Otherwise, this value will be null and $(ref:runtime.lastError)
|
||||
// will be set.
|
||||
callback CloseScannerCallback = void (CloseScannerResponse response);
|
||||
|
||||
// Callback from the $(ref:setOptions) method.
|
||||
// |response| The response from setting the options, if the call was valid.
|
||||
// Otherwise, this value will be null and $(ref:runtime.lastError)
|
||||
// will be set.
|
||||
callback SetOptionsCallback = void (SetOptionsResponse response);
|
||||
|
||||
// Callback from the $(ref:startScan) method.
|
||||
// |response| The response from starting the scan, if the call was valid.
|
||||
// Otherwise, this value will be null and $(ref:runtime.lastError)
|
||||
// will be set.
|
||||
callback StartScanCallback = void (StartScanResponse response);
|
||||
|
||||
// Callback from the $(ref:cancelScan) method.
|
||||
// |response| The response from canceling the scan, if the call was valid.
|
||||
// Otherwise, this value will be null and $(ref:runtime.lastError)
|
||||
// will be set.
|
||||
callback CancelScanCallback = void (CancelScanResponse response);
|
||||
|
||||
// Callback from the $(ref:readScanData) method.
|
||||
// |response| The response from reading the next chunk of scanned image data,
|
||||
// if the call was valid. Otherwise, this value will be null and
|
||||
// $(ref:runtime.lastError) will be set.
|
||||
callback ReadScanDataCallback = void (ReadScanDataResponse response);
|
||||
|
||||
interface Functions {
|
||||
// Performs a document scan and returns a Promise that resolves
|
||||
// with a $(ref:ScanResults) object. If a callback is passed to
|
||||
// this function, the returned data is passed to it instead.
|
||||
// |options| : An object containing scan parameters.
|
||||
// |callback| : Returns a Promise which resolves with the scan results.
|
||||
static void scan(
|
||||
ScanOptions options,
|
||||
ScanCallback callback);
|
||||
|
||||
// Gets the list of available scanners and returns a Promise that
|
||||
// resolves with a $(ref:GetScannerListResponse) object. If a callback
|
||||
// is passed to this function, returned data is passed to it instead.
|
||||
// |filter| : A $(ref:DeviceFilter) indicating which types of scanners
|
||||
// should be returned.
|
||||
// |callback| : Returns a Promise which resolves with the result and list of
|
||||
// scanners.
|
||||
static void getScannerList(
|
||||
DeviceFilter filter, GetScannerListCallback callback);
|
||||
|
||||
// Opens a scanner for exclusive access and returns a Promise that
|
||||
// resolves with an $(ref:OpenScannerResponse) object. If a callback
|
||||
// is passed to this function, returned data is passed to it instead.
|
||||
// |scannerId| : The ID of a scanner to be opened. This value is one
|
||||
// returned from a previous call to $(ref:getScannerList).
|
||||
// |callback| : Returns a Promise which resolves with the result.
|
||||
static void openScanner(
|
||||
DOMString scannerId, OpenScannerCallback callback);
|
||||
|
||||
// Gets the group names and member options from a scanner previously
|
||||
// opened by $(ref:openScanner). This method returns a Promise that
|
||||
// resolves with a $(ref:GetOptionGroupsResponse) object. If a callback
|
||||
// is passed to this function, returned data is passed to it instead.
|
||||
// |scannerHandle| : The handle of an open scanner returned from a call
|
||||
// to $(ref:openScanner).
|
||||
// |callback| : Returns a Promise which resolves with the result.
|
||||
static void getOptionGroups(
|
||||
DOMString scannerHandle, GetOptionGroupsCallback callback);
|
||||
|
||||
// Closes the scanner with the passed in handle and returns a Promise
|
||||
// that resolves with a $(ref:CloseScannerResponse) object. If a callback
|
||||
// is used, the object is passed to it instead. Even if the response is
|
||||
// not a success, the supplied handle becomes invalid and should not be
|
||||
// used for further operations.
|
||||
// |scannerHandle| : Specifies the handle of an open scanner that was
|
||||
// previously returned from a call to $(ref:openScanner).
|
||||
// |callback| : Returns a Promise which resolves with the result.
|
||||
static void closeScanner(
|
||||
DOMString scannerHandle, CloseScannerCallback callback);
|
||||
|
||||
// Sets options on the specified scanner and returns a Promise that
|
||||
// resolves with a $(ref:SetOptionsResponse) object containing the
|
||||
// result of trying to set every value in the order of the passed-in
|
||||
// $(ref:OptionSetting) object. If a callback is used, the object is
|
||||
// passed to it instead.
|
||||
// |scannerHandle| : The handle of the scanner to set options on. This
|
||||
// should be a value previously returned from a call to $(ref:openScanner).
|
||||
// |options| : A list of <code>OptionSetting</code> objects to be applied to
|
||||
// the scanner.
|
||||
// |callback| : Returns a Promise which resolves with the result.
|
||||
static void setOptions(
|
||||
DOMString scannerHandle, OptionSetting[] options,
|
||||
SetOptionsCallback callback);
|
||||
|
||||
// Starts a scan on the specified scanner and returns a Promise that
|
||||
// resolves with a $(ref:StartScanResponse). If a callback is used,
|
||||
// the object is passed to it instead. If the call was successful, the
|
||||
// response includes a job handle that can be used in subsequent calls
|
||||
// to read scan data or cancel a scan.
|
||||
// |scannerHandle| : The handle of an open scanner. This should be a value
|
||||
// previously returned from a call to $(ref:openScanner).
|
||||
// |options| : A $(ref:StartScanOptions) object indicating the options to
|
||||
// be used for the scan. The <code>StartScanOptions.format</code> property
|
||||
// must match one of the entries returned in the scanner's
|
||||
// <code>ScannerInfo</code>.
|
||||
// |callback| : Returns a Promise which resolves with the result.
|
||||
static void startScan(
|
||||
DOMString scannerHandle, StartScanOptions options,
|
||||
StartScanCallback callback);
|
||||
|
||||
// Cancels a started scan and returns a Promise that resolves with a
|
||||
// $(ref:CancelScanResponse) object. If a callback is used, the object
|
||||
// is passed to it instead.
|
||||
// |job| : The handle of an active scan job previously returned from a
|
||||
// call to $(ref:startScan).
|
||||
// |callback| : Returns a Promise which resolves with the result.
|
||||
static void cancelScan(
|
||||
DOMString job, CancelScanCallback callback);
|
||||
|
||||
// Reads the next chunk of available image data from an active job handle,
|
||||
// and returns a Promise that resolves with a $(ref:ReadScanDataResponse)
|
||||
// object. If a callback is used, the object is passed to it instead.
|
||||
//
|
||||
// <aside class="note"><b>Note:</b>It is valid for a response result to be
|
||||
// <code>SUCCESS</code> with a zero-length <code>data</code>
|
||||
// member. This means the scanner is still working but does not yet have
|
||||
// additional data ready. The caller should wait a short time and try again.
|
||||
//
|
||||
// When the scan job completes, the response will have the result value of
|
||||
// <code>EOF</code>. This response may contain a final
|
||||
// non-zero <code>data</code> member.</aside>
|
||||
//
|
||||
// |job| : Active job handle previously returned from
|
||||
// $(ref:startScan).
|
||||
// |callback| : Returns a Promise which resolves with the result.
|
||||
static void readScanData(
|
||||
DOMString job, ReadScanDataCallback callback);
|
||||
};
|
||||
};
|
||||
@@ -1,648 +0,0 @@
|
||||
// Copyright 2012 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.downloads</code> API to programmatically initiate,
|
||||
// monitor, manipulate, and search for downloads.
|
||||
[permissions=downloads]
|
||||
namespace downloads {
|
||||
[inline_doc] dictionary HeaderNameValuePair {
|
||||
// Name of the HTTP header.
|
||||
DOMString name;
|
||||
|
||||
// Value of the HTTP header.
|
||||
DOMString value;
|
||||
};
|
||||
|
||||
// <dl><dt>uniquify</dt>
|
||||
// <dd>To avoid duplication, the <code>filename</code> is changed to
|
||||
// include a counter before the filename extension.</dd>
|
||||
// <dt>overwrite</dt>
|
||||
// <dd>The existing file will be overwritten with the new file.</dd>
|
||||
// <dt>prompt</dt>
|
||||
// <dd>The user will be prompted with a file chooser dialog.</dd>
|
||||
// </dl>
|
||||
enum FilenameConflictAction {uniquify, overwrite, prompt};
|
||||
|
||||
[inline_doc] dictionary FilenameSuggestion {
|
||||
// The $(ref:DownloadItem)'s new target $(ref:DownloadItem.filename), as a path
|
||||
// relative to the user's default Downloads directory, possibly containing
|
||||
// subdirectories. Absolute paths, empty paths, and paths containing
|
||||
// back-references ".." will be ignored. <code>filename</code> is ignored if
|
||||
// there are any $(ref:onDeterminingFilename) listeners registered by any
|
||||
// extensions.
|
||||
DOMString filename;
|
||||
|
||||
// The action to take if <code>filename</code> already exists.
|
||||
FilenameConflictAction? conflictAction;
|
||||
};
|
||||
|
||||
[inline_doc] enum HttpMethod {GET, POST};
|
||||
|
||||
enum InterruptReason {
|
||||
FILE_FAILED,
|
||||
FILE_ACCESS_DENIED,
|
||||
FILE_NO_SPACE,
|
||||
FILE_NAME_TOO_LONG,
|
||||
FILE_TOO_LARGE,
|
||||
FILE_VIRUS_INFECTED,
|
||||
FILE_TRANSIENT_ERROR,
|
||||
FILE_BLOCKED,
|
||||
FILE_SECURITY_CHECK_FAILED,
|
||||
FILE_TOO_SHORT,
|
||||
FILE_HASH_MISMATCH,
|
||||
FILE_SAME_AS_SOURCE,
|
||||
NETWORK_FAILED,
|
||||
NETWORK_TIMEOUT,
|
||||
NETWORK_DISCONNECTED,
|
||||
NETWORK_SERVER_DOWN,
|
||||
NETWORK_INVALID_REQUEST,
|
||||
SERVER_FAILED,
|
||||
SERVER_NO_RANGE,
|
||||
SERVER_BAD_CONTENT,
|
||||
SERVER_UNAUTHORIZED,
|
||||
SERVER_CERT_PROBLEM,
|
||||
SERVER_FORBIDDEN,
|
||||
SERVER_UNREACHABLE,
|
||||
SERVER_CONTENT_LENGTH_MISMATCH,
|
||||
SERVER_CROSS_ORIGIN_REDIRECT,
|
||||
USER_CANCELED,
|
||||
USER_SHUTDOWN,
|
||||
CRASH};
|
||||
|
||||
[inline_doc] dictionary DownloadOptions {
|
||||
// The URL to download.
|
||||
DOMString url;
|
||||
|
||||
// A file path relative to the Downloads directory to contain the downloaded
|
||||
// file, possibly containing subdirectories. Absolute paths, empty paths,
|
||||
// and paths containing back-references ".." will cause an error.
|
||||
// $(ref:onDeterminingFilename) allows suggesting a filename after the file's
|
||||
// MIME type and a tentative filename have been determined.
|
||||
DOMString? filename;
|
||||
|
||||
// The action to take if <code>filename</code> already exists.
|
||||
FilenameConflictAction? conflictAction;
|
||||
|
||||
// Use a file-chooser to allow the user to select a filename regardless of
|
||||
// whether <code>filename</code> is set or already exists.
|
||||
boolean? saveAs;
|
||||
|
||||
// The HTTP method to use if the URL uses the HTTP[S] protocol.
|
||||
HttpMethod? method;
|
||||
|
||||
// Extra HTTP headers to send with the request if the URL uses the HTTP[s]
|
||||
// protocol. Each header is represented as a dictionary containing the keys
|
||||
// <code>name</code> and either <code>value</code> or
|
||||
// <code>binaryValue</code>, restricted to those allowed by XMLHttpRequest.
|
||||
HeaderNameValuePair[]? headers;
|
||||
|
||||
// Post body.
|
||||
DOMString? body;
|
||||
};
|
||||
|
||||
enum DangerType {
|
||||
// The download's filename is suspicious.
|
||||
file,
|
||||
|
||||
// The download's URL is known to be malicious.
|
||||
url,
|
||||
|
||||
// The downloaded file is known to be malicious.
|
||||
content,
|
||||
|
||||
|
||||
// The download's URL is not commonly downloaded and could be dangerous.
|
||||
uncommon,
|
||||
|
||||
// The download came from a host known to distribute malicious binaries and
|
||||
// is likely dangerous.
|
||||
host,
|
||||
|
||||
// The download is potentially unwanted or unsafe. E.g. it could make
|
||||
// changes to browser or computer settings.
|
||||
unwanted,
|
||||
|
||||
|
||||
// The download presents no known danger to the user's computer.
|
||||
safe,
|
||||
|
||||
// The user has accepted the dangerous download.
|
||||
accepted,
|
||||
|
||||
// Enterprise-related values.
|
||||
allowlistedByPolicy,
|
||||
asyncScanning,
|
||||
asyncLocalPasswordScanning,
|
||||
passwordProtected,
|
||||
blockedTooLarge,
|
||||
sensitiveContentWarning,
|
||||
sensitiveContentBlock,
|
||||
deepScannedFailed,
|
||||
deepScannedSafe,
|
||||
deepScannedOpenedDangerous,
|
||||
promptForScanning,
|
||||
promptForLocalPasswordScanning,
|
||||
accountCompromise,
|
||||
blockedScanFailed,
|
||||
|
||||
// For use by the Secure Enterprise Browser extension. When required, Chrome
|
||||
// will block the download to disc and download the file directly to Google
|
||||
// Drive.
|
||||
forceSaveToGdrive,
|
||||
|
||||
// For use by the Secure Enterprise Browser extension. When required, Chrome
|
||||
// will block the download to disc and download the file directly to
|
||||
// OneDrive.
|
||||
forceSaveToOnedrive
|
||||
};
|
||||
|
||||
// <dl><dt>in_progress</dt>
|
||||
// <dd>The download is currently receiving data from the server.</dd>
|
||||
// <dt>interrupted</dt>
|
||||
// <dd>An error broke the connection with the file host.</dd>
|
||||
// <dt>complete</dt>
|
||||
// <dd>The download completed successfully.</dd>
|
||||
// </dl>
|
||||
enum State {in_progress, interrupted, complete};
|
||||
|
||||
// The state of the process of downloading a file.
|
||||
dictionary DownloadItem {
|
||||
// An identifier that is persistent across browser sessions.
|
||||
long id;
|
||||
|
||||
// The absolute URL that this download initiated from, before any
|
||||
// redirects.
|
||||
DOMString url;
|
||||
|
||||
// The absolute URL that this download is being made from, after all
|
||||
// redirects.
|
||||
DOMString finalUrl;
|
||||
|
||||
// Absolute URL.
|
||||
DOMString referrer;
|
||||
|
||||
// Absolute local path.
|
||||
DOMString filename;
|
||||
|
||||
// False if this download is recorded in the history, true if it is not
|
||||
// recorded.
|
||||
boolean incognito;
|
||||
|
||||
// Indication of whether this download is thought to be safe or known to be
|
||||
// suspicious.
|
||||
DangerType danger;
|
||||
|
||||
// The file's MIME type.
|
||||
DOMString mime;
|
||||
|
||||
// The time when the download began in ISO 8601 format. May be passed
|
||||
// directly to the Date constructor: <code>chrome.downloads.search({},
|
||||
// function(items){items.forEach(function(item){console.log(new
|
||||
// Date(item.startTime))})})</code>
|
||||
DOMString startTime;
|
||||
|
||||
// The time when the download ended in ISO 8601 format. May be passed
|
||||
// directly to the Date constructor: <code>chrome.downloads.search({},
|
||||
// function(items){items.forEach(function(item){if (item.endTime)
|
||||
// console.log(new Date(item.endTime))})})</code>
|
||||
DOMString? endTime;
|
||||
|
||||
// Estimated time when the download will complete in ISO 8601 format. May be
|
||||
// passed directly to the Date constructor:
|
||||
// <code>chrome.downloads.search({},
|
||||
// function(items){items.forEach(function(item){if (item.estimatedEndTime)
|
||||
// console.log(new Date(item.estimatedEndTime))})})</code>
|
||||
DOMString? estimatedEndTime;
|
||||
|
||||
// Indicates whether the download is progressing, interrupted, or complete.
|
||||
State state;
|
||||
|
||||
// True if the download has stopped reading data from the host, but kept the
|
||||
// connection open.
|
||||
boolean paused;
|
||||
|
||||
// True if the download is in progress and paused, or else if it is
|
||||
// interrupted and can be resumed starting from where it was interrupted.
|
||||
boolean canResume;
|
||||
|
||||
// Why the download was interrupted. Several kinds of HTTP errors may be
|
||||
// grouped under one of the errors beginning with <code>SERVER_</code>.
|
||||
// Errors relating to the network begin with <code>NETWORK_</code>, errors
|
||||
// relating to the process of writing the file to the file system begin with
|
||||
// <code>FILE_</code>, and interruptions initiated by the user begin with
|
||||
// <code>USER_</code>.
|
||||
InterruptReason? error;
|
||||
|
||||
// Number of bytes received so far from the host, without considering file
|
||||
// compression.
|
||||
double bytesReceived;
|
||||
|
||||
// Number of bytes in the whole file, without considering file compression,
|
||||
// or -1 if unknown.
|
||||
double totalBytes;
|
||||
|
||||
// Number of bytes in the whole file post-decompression, or -1 if unknown.
|
||||
double fileSize;
|
||||
|
||||
// Whether the downloaded file still exists. This information may be out of
|
||||
// date because Chrome does not automatically watch for file removal. Call
|
||||
// $(ref:search)() in order to trigger the check for file existence. When the
|
||||
// existence check completes, if the file has been deleted, then an
|
||||
// $(ref:onChanged) event will fire. Note that $(ref:search)() does not wait
|
||||
// for the existence check to finish before returning, so results from
|
||||
// $(ref:search)() may not accurately reflect the file system. Also,
|
||||
// $(ref:search)() may be called as often as necessary, but will not check for
|
||||
// file existence any more frequently than once every 10 seconds.
|
||||
boolean exists;
|
||||
|
||||
// The identifier for the extension that initiated this download if this
|
||||
// download was initiated by an extension. Does not change once it is set.
|
||||
DOMString? byExtensionId;
|
||||
|
||||
// The localized name of the extension that initiated this download if this
|
||||
// download was initiated by an extension. May change if the extension
|
||||
// changes its name or if the user changes their locale.
|
||||
DOMString? byExtensionName;
|
||||
};
|
||||
|
||||
[inline_doc] dictionary DownloadQuery {
|
||||
// This array of search terms limits results to $(ref:DownloadItem) whose
|
||||
// <code>filename</code> or <code>url</code> or <code>finalUrl</code>
|
||||
// contain all of the search terms that do not begin with a dash '-' and
|
||||
// none of the search terms that do begin with a dash.
|
||||
DOMString[]? query;
|
||||
|
||||
// Limits results to $(ref:DownloadItem) that
|
||||
// started before the given ms in ISO 8601 format.
|
||||
DOMString? startedBefore;
|
||||
|
||||
// Limits results to $(ref:DownloadItem) that
|
||||
// started after the given ms in ISO 8601 format.
|
||||
DOMString? startedAfter;
|
||||
|
||||
// Limits results to $(ref:DownloadItem) that ended before the given ms in
|
||||
// ISO 8601 format.
|
||||
DOMString? endedBefore;
|
||||
|
||||
// Limits results to $(ref:DownloadItem) that ended after the given ms in
|
||||
// ISO 8601 format
|
||||
DOMString? endedAfter;
|
||||
|
||||
// Limits results to $(ref:DownloadItem) whose
|
||||
// <code>totalBytes</code> is greater than the given integer.
|
||||
double? totalBytesGreater;
|
||||
|
||||
// Limits results to $(ref:DownloadItem) whose
|
||||
// <code>totalBytes</code> is less than the given integer.
|
||||
double? totalBytesLess;
|
||||
|
||||
// Limits results to $(ref:DownloadItem) whose
|
||||
// <code>filename</code> matches the given regular expression.
|
||||
DOMString? filenameRegex;
|
||||
|
||||
// Limits results to $(ref:DownloadItem) whose
|
||||
// <code>url</code> matches the given regular expression.
|
||||
DOMString? urlRegex;
|
||||
|
||||
// Limits results to $(ref:DownloadItem) whose
|
||||
// <code>finalUrl</code> matches the given regular expression.
|
||||
DOMString? finalUrlRegex;
|
||||
|
||||
// The maximum number of matching $(ref:DownloadItem) returned. Defaults to
|
||||
// 1000. Set to 0 in order to return all matching $(ref:DownloadItem). See
|
||||
// $(ref:search) for how to page through results.
|
||||
long? limit;
|
||||
|
||||
// Set elements of this array to $(ref:DownloadItem) properties in order to
|
||||
// sort search results. For example, setting
|
||||
// <code>orderBy=['startTime']</code> sorts the $(ref:DownloadItem) by their
|
||||
// start time in ascending order. To specify descending order, prefix with a
|
||||
// hyphen: '-startTime'.
|
||||
DOMString[]? orderBy;
|
||||
|
||||
// The <code>id</code> of the $(ref:DownloadItem) to query.
|
||||
long? id;
|
||||
|
||||
// The absolute URL that this download initiated from, before any
|
||||
// redirects.
|
||||
DOMString? url;
|
||||
|
||||
// The absolute URL that this download is being made from, after all
|
||||
// redirects.
|
||||
DOMString? finalUrl;
|
||||
|
||||
// Absolute local path.
|
||||
DOMString? filename;
|
||||
|
||||
// Indication of whether this download is thought to be safe or known to be
|
||||
// suspicious.
|
||||
DangerType? danger;
|
||||
|
||||
// The file's MIME type.
|
||||
DOMString? mime;
|
||||
|
||||
// The time when the download began in ISO 8601 format.
|
||||
DOMString? startTime;
|
||||
|
||||
// The time when the download ended in ISO 8601 format.
|
||||
DOMString? endTime;
|
||||
|
||||
// Indicates whether the download is progressing, interrupted, or complete.
|
||||
State? state;
|
||||
|
||||
// True if the download has stopped reading data from the host, but kept the
|
||||
// connection open.
|
||||
boolean? paused;
|
||||
|
||||
// Why a download was interrupted.
|
||||
InterruptReason? error;
|
||||
|
||||
// Number of bytes received so far from the host, without considering file
|
||||
// compression.
|
||||
double? bytesReceived;
|
||||
|
||||
// Number of bytes in the whole file, without considering file compression,
|
||||
// or -1 if unknown.
|
||||
double? totalBytes;
|
||||
|
||||
// Number of bytes in the whole file post-decompression, or -1 if unknown.
|
||||
double? fileSize;
|
||||
|
||||
// Whether the downloaded file exists;
|
||||
boolean? exists;
|
||||
};
|
||||
|
||||
dictionary StringDelta {
|
||||
DOMString? previous;
|
||||
DOMString? current;
|
||||
};
|
||||
|
||||
dictionary DoubleDelta {
|
||||
double? previous;
|
||||
double? current;
|
||||
};
|
||||
|
||||
dictionary BooleanDelta {
|
||||
boolean? previous;
|
||||
boolean? current;
|
||||
};
|
||||
|
||||
// Encapsulates a change in a DownloadItem.
|
||||
[inline_doc] dictionary DownloadDelta {
|
||||
// The <code>id</code> of the $(ref:DownloadItem)
|
||||
// that changed.
|
||||
long id;
|
||||
|
||||
// The change in <code>url</code>, if any.
|
||||
StringDelta? url;
|
||||
|
||||
// The change in <code>finalUrl</code>, if any.
|
||||
StringDelta? finalUrl;
|
||||
|
||||
// The change in <code>filename</code>, if any.
|
||||
StringDelta? filename;
|
||||
|
||||
// The change in <code>danger</code>, if any.
|
||||
StringDelta? danger;
|
||||
|
||||
// The change in <code>mime</code>, if any.
|
||||
StringDelta? mime;
|
||||
|
||||
// The change in <code>startTime</code>, if any.
|
||||
StringDelta? startTime;
|
||||
|
||||
// The change in <code>endTime</code>, if any.
|
||||
StringDelta? endTime;
|
||||
|
||||
// The change in <code>state</code>, if any.
|
||||
StringDelta? state;
|
||||
|
||||
// The change in <code>canResume</code>, if any.
|
||||
BooleanDelta? canResume;
|
||||
|
||||
// The change in <code>paused</code>, if any.
|
||||
BooleanDelta? paused;
|
||||
|
||||
// The change in <code>error</code>, if any.
|
||||
StringDelta? error;
|
||||
|
||||
// The change in <code>totalBytes</code>, if any.
|
||||
DoubleDelta? totalBytes;
|
||||
|
||||
// The change in <code>fileSize</code>, if any.
|
||||
DoubleDelta? fileSize;
|
||||
|
||||
// The change in <code>exists</code>, if any.
|
||||
BooleanDelta? exists;
|
||||
};
|
||||
|
||||
[inline_doc] dictionary GetFileIconOptions {
|
||||
// The size of the returned icon. The icon will be square with dimensions
|
||||
// size * size pixels. The default and largest size for the icon is 32x32
|
||||
// pixels. The only supported sizes are 16 and 32. It is an error to specify
|
||||
// any other size.
|
||||
long? size;
|
||||
};
|
||||
|
||||
// Encapsulates a change in the download UI.
|
||||
[inline_doc] dictionary UiOptions {
|
||||
// Enable or disable the download UI.
|
||||
boolean enabled;
|
||||
};
|
||||
|
||||
callback DownloadCallback = void(long downloadId);
|
||||
callback SearchCallback = void(DownloadItem[] results);
|
||||
callback EraseCallback = void(long[] erasedIds);
|
||||
callback NullCallback = void();
|
||||
callback GetFileIconCallback = void(optional DOMString iconURL);
|
||||
callback SuggestFilenameCallback = void(
|
||||
optional FilenameSuggestion suggestion);
|
||||
|
||||
interface Functions {
|
||||
// Download a URL. If the URL uses the HTTP[S] protocol, then the request
|
||||
// will include all cookies currently set for its hostname. If both
|
||||
// <code>filename</code> and <code>saveAs</code> are specified, then the
|
||||
// Save As dialog will be displayed, pre-populated with the specified
|
||||
// <code>filename</code>. If the download started successfully,
|
||||
// <code>callback</code> will be called with the new $(ref:DownloadItem)'s
|
||||
// <code>downloadId</code>. If there was an error starting the download,
|
||||
// then <code>callback</code> will be called with
|
||||
// <code>downloadId=undefined</code> and $(ref:runtime.lastError) will contain
|
||||
// a descriptive string. The error strings are not guaranteed to remain
|
||||
// backwards compatible between releases. Extensions must not parse it.
|
||||
// |options|: What to download and how.
|
||||
// |callback|: Returns a Promise which resolves with the id of the new
|
||||
// $(ref:DownloadItem).
|
||||
static void download(
|
||||
DownloadOptions options,
|
||||
optional DownloadCallback callback);
|
||||
|
||||
// Find $(ref:DownloadItem). Set <code>query</code> to the empty object to get
|
||||
// all $(ref:DownloadItem). To get a specific $(ref:DownloadItem), set only the
|
||||
// <code>id</code> field. To page through a large number of items, set
|
||||
// <code>orderBy: ['-startTime']</code>, set <code>limit</code> to the
|
||||
// number of items per page, and set <code>startedAfter</code> to the
|
||||
// <code>startTime</code> of the last item from the last page.
|
||||
static void search(
|
||||
DownloadQuery query,
|
||||
SearchCallback callback);
|
||||
|
||||
// Pause the download. If the request was successful the download is in a
|
||||
// paused state. Otherwise $(ref:runtime.lastError) contains an error message.
|
||||
// The request will fail if the download is not active.
|
||||
// |downloadId|: The id of the download to pause.
|
||||
// |callback|: Returns a Promise which resolves when the pause request is
|
||||
// completed.
|
||||
static void pause(
|
||||
long downloadId,
|
||||
optional NullCallback callback);
|
||||
|
||||
// Resume a paused download. If the request was successful the download is
|
||||
// in progress and unpaused. Otherwise $(ref:runtime.lastError) contains an
|
||||
// error message. The request will fail if the download is not active.
|
||||
// |downloadId|: The id of the download to resume.
|
||||
// |callback|: Returns a Promise which resolves when the resume request is
|
||||
// completed.
|
||||
static void resume(
|
||||
long downloadId,
|
||||
optional NullCallback callback);
|
||||
|
||||
// Cancel a download. When <code>callback</code> is run, the download is
|
||||
// cancelled, completed, interrupted or doesn't exist anymore.
|
||||
// |downloadId|: The id of the download to cancel.
|
||||
// |callback|: Returns a Promise which resolves when the cancel request is
|
||||
// completed.
|
||||
static void cancel(
|
||||
long downloadId,
|
||||
optional NullCallback callback);
|
||||
|
||||
// Retrieve an icon for the specified download. For new downloads, file
|
||||
// icons are available after the $(ref:onCreated) event has been received. The
|
||||
// image returned by this function while a download is in progress may be
|
||||
// different from the image returned after the download is complete. Icon
|
||||
// retrieval is done by querying the underlying operating system or toolkit
|
||||
// depending on the platform. The icon that is returned will therefore
|
||||
// depend on a number of factors including state of the download, platform,
|
||||
// registered file types and visual theme. If a file icon cannot be
|
||||
// determined, $(ref:runtime.lastError) will contain an error message.
|
||||
// |downloadId|: The identifier for the download.
|
||||
// |callback|: Returns a Promise which resolves with a URL to an image that
|
||||
// represents the download.
|
||||
static void getFileIcon(
|
||||
long downloadId,
|
||||
optional GetFileIconOptions options,
|
||||
GetFileIconCallback callback);
|
||||
|
||||
// Opens the downloaded file now if the $(ref:DownloadItem) is complete;
|
||||
// otherwise returns an error through $(ref:runtime.lastError). This method
|
||||
// requires the <code>"downloads.open"</code> permission in addition to the
|
||||
// <code>"downloads"</code> permission. An $(ref:onChanged) event fires
|
||||
// when the item is opened for the first time. This method can only be called
|
||||
// in response to a user gesture.
|
||||
// |downloadId|: The identifier for the downloaded file.
|
||||
static void open(long downloadId,
|
||||
optional NullCallback callback);
|
||||
|
||||
// Show the downloaded file in its folder in a file manager.
|
||||
// |downloadId|: The identifier for the downloaded file.
|
||||
static void show(long downloadId);
|
||||
|
||||
// Show the default Downloads folder in a file manager.
|
||||
static void showDefaultFolder();
|
||||
|
||||
// Erase matching $(ref:DownloadItem) from history without deleting the
|
||||
// downloaded file. An $(ref:onErased) event will fire for each
|
||||
// $(ref:DownloadItem) that matches <code>query</code>, then
|
||||
// <code>callback</code> will be called.
|
||||
static void erase(
|
||||
DownloadQuery query,
|
||||
optional EraseCallback callback);
|
||||
|
||||
// Remove the downloaded file if it exists and the $(ref:DownloadItem) is
|
||||
// complete; otherwise return an error through $(ref:runtime.lastError).
|
||||
static void removeFile(
|
||||
long downloadId,
|
||||
optional NullCallback callback);
|
||||
|
||||
// Prompt the user to accept a dangerous download. Can only be called from a
|
||||
// visible context (tab, window, or page/browser action popup). Does not
|
||||
// automatically accept dangerous downloads. If the download is accepted,
|
||||
// then an $(ref:onChanged) event will fire, otherwise nothing will happen.
|
||||
// When all the data is fetched into a temporary file and either the
|
||||
// download is not dangerous or the danger has been accepted, then the
|
||||
// temporary file is renamed to the target filename, the |state| changes to
|
||||
// 'complete', and $(ref:onChanged) fires.
|
||||
// |downloadId|: The identifier for the $(ref:DownloadItem).
|
||||
// |callback|: Returns a Promise which resolves when the danger prompt
|
||||
// dialog closes.
|
||||
static void acceptDanger(
|
||||
long downloadId,
|
||||
optional NullCallback callback);
|
||||
|
||||
// Enable or disable the gray shelf at the bottom of every window associated
|
||||
// with the current browser profile. The shelf will be disabled as long as
|
||||
// at least one extension has disabled it. Enabling the shelf while at least
|
||||
// one other extension has disabled it will return an error through
|
||||
// $(ref:runtime.lastError). Requires the <code>"downloads.shelf"</code>
|
||||
// permission in addition to the <code>"downloads"</code> permission.
|
||||
[deprecated="Use $(ref:setUiOptions) instead."]
|
||||
static void setShelfEnabled(boolean enabled);
|
||||
|
||||
// Change the download UI of every window associated with the current
|
||||
// browser profile. As long as at least one extension has set
|
||||
// $(ref:UiOptions.enabled) to false, the download UI will be hidden.
|
||||
// Setting $(ref:UiOptions.enabled) to true while at least one other
|
||||
// extension has disabled it will return an error through
|
||||
// $(ref:runtime.lastError). Requires the <code>"downloads.ui"</code>
|
||||
// permission in addition to the <code>"downloads"</code> permission.
|
||||
// |options|: Encapsulate a change to the download UI.
|
||||
// |callback|: Returns a Promise which resolves when the UI update is
|
||||
// completed.
|
||||
static void setUiOptions(
|
||||
UiOptions options,
|
||||
optional NullCallback callback);
|
||||
};
|
||||
|
||||
interface Events {
|
||||
// This event fires with the $(ref:DownloadItem) object when a download
|
||||
// begins.
|
||||
static void onCreated(DownloadItem downloadItem);
|
||||
|
||||
// Fires with the <code>downloadId</code> when a download is erased from
|
||||
// history.
|
||||
// |downloadId|: The <code>id</code> of the $(ref:DownloadItem) that was
|
||||
// erased.
|
||||
static void onErased(long downloadId);
|
||||
|
||||
// When any of a $(ref:DownloadItem)'s properties except
|
||||
// <code>bytesReceived</code> and <code>estimatedEndTime</code> changes,
|
||||
// this event fires with the <code>downloadId</code> and an object
|
||||
// containing the properties that changed.
|
||||
static void onChanged(DownloadDelta downloadDelta);
|
||||
|
||||
// During the filename determination process, extensions will be given the
|
||||
// opportunity to override the target $(ref:DownloadItem.filename). Each
|
||||
// extension may not register more than one listener for this event. Each
|
||||
// listener must call <code>suggest</code> exactly once, either
|
||||
// synchronously or asynchronously. If the listener calls
|
||||
// <code>suggest</code> asynchronously, then it must return
|
||||
// <code>true</code>. If the listener neither calls <code>suggest</code>
|
||||
// synchronously nor returns <code>true</code>, then <code>suggest</code>
|
||||
// will be called automatically. The $(ref:DownloadItem) will not complete
|
||||
// until all listeners have called <code>suggest</code>. Listeners may call
|
||||
// <code>suggest</code> without any arguments in order to allow the download
|
||||
// to use <code>downloadItem.filename</code> for its filename, or pass a
|
||||
// <code>suggestion</code> object to <code>suggest</code> in order to
|
||||
// override the target filename. If more than one extension overrides the
|
||||
// filename, then the last extension installed whose listener passes a
|
||||
// <code>suggestion</code> object to <code>suggest</code> wins. In order to
|
||||
// avoid confusion regarding which extension will win, users should not
|
||||
// install extensions that may conflict. If the download is initiated by
|
||||
// $(ref:download) and the target filename is known before the MIME type and
|
||||
// tentative filename have been determined, pass <code>filename</code> to
|
||||
// $(ref:download) instead.
|
||||
[maxListeners=1] static void onDeterminingFilename(
|
||||
DownloadItem downloadItem, SuggestFilenameCallback suggest);
|
||||
};
|
||||
};
|
||||
@@ -1,14 +0,0 @@
|
||||
// Copyright 2012 The Chromium Authors
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// downloadsInternal
|
||||
[nodoc=true]
|
||||
namespace downloadsInternal {
|
||||
interface Functions {
|
||||
// Secretly called when onDeterminingFilename handlers return.
|
||||
static void determineFilename(long downloadId,
|
||||
DOMString filename,
|
||||
DOMString conflict_action);
|
||||
};
|
||||
};
|
||||
@@ -1,65 +0,0 @@
|
||||
// Copyright 2015 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.enterprise.deviceAttributes</code> API to read device
|
||||
// attributes.
|
||||
// Note: This API is only available to extensions force-installed by enterprise
|
||||
// policy.
|
||||
namespace enterprise.deviceAttributes {
|
||||
callback GetDirectoryDeviceIdCallback = void (DOMString deviceId);
|
||||
|
||||
callback GetDeviceSerialNumberCallback = void (DOMString serialNumber);
|
||||
|
||||
callback GetDeviceAssetIdCallback = void (DOMString assetId);
|
||||
|
||||
callback GetDeviceAnnotatedLocationCallback = void (DOMString annotatedLocation);
|
||||
|
||||
callback GetDeviceHostnameCallback = void (DOMString hostname);
|
||||
|
||||
interface Functions {
|
||||
// Fetches the value of
|
||||
// <a href="https://developers.google.com/admin-sdk/directory/v1/guides/manage-chrome-devices">the device identifier of the directory API</a>,
|
||||
// that is generated by the server and identifies the cloud record of the
|
||||
// device for querying in the cloud directory API.
|
||||
// If the current user is not affiliated, returns an empty string.
|
||||
// |callback| : Returns a Promise which resolves with the device identifier
|
||||
// of the directory API.
|
||||
void getDirectoryDeviceId(
|
||||
GetDirectoryDeviceIdCallback callback);
|
||||
|
||||
// Fetches the device's serial number. Please note the purpose of this API
|
||||
// is to administrate the device (e.g. generating Certificate Sign Requests
|
||||
// for device-wide certificates). This API may not be used for tracking
|
||||
// devices without the consent of the device's administrator.
|
||||
// If the current user is not affiliated, returns an empty string.
|
||||
// |callback| : Returns a Promise which resolves with the serial number of
|
||||
// the device.
|
||||
void getDeviceSerialNumber(
|
||||
GetDeviceSerialNumberCallback callback);
|
||||
|
||||
// Fetches the administrator-annotated Asset Id.
|
||||
// If the current user is not affiliated or no Asset Id has been set by the
|
||||
// administrator, returns an empty string.
|
||||
// |callback| : Returns a Promise which resolves with the Asset ID of the
|
||||
// device.
|
||||
void getDeviceAssetId(GetDeviceAssetIdCallback callback);
|
||||
|
||||
// Fetches the administrator-annotated Location.
|
||||
// If the current user is not affiliated or no Annotated Location has been
|
||||
// set by the administrator, returns an empty string.
|
||||
// |callback| : Returns a Promise which resolves with the Annotated
|
||||
// Location of the device.
|
||||
void getDeviceAnnotatedLocation(
|
||||
GetDeviceAnnotatedLocationCallback callback);
|
||||
|
||||
// Fetches the device's hostname as set by DeviceHostnameTemplate policy.
|
||||
// If the current user is not affiliated or no hostname has been set by the
|
||||
// enterprise policy, returns an empty string.
|
||||
// |callback| : Returns a Promise which resolves with the hostname of the
|
||||
// device.
|
||||
void getDeviceHostname(
|
||||
GetDeviceHostnameCallback callback);
|
||||
};
|
||||
|
||||
};
|
||||
@@ -1,25 +0,0 @@
|
||||
// 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.enterprise.hardwarePlatform</code> API to get the
|
||||
// manufacturer and model of the hardware platform where the browser runs.
|
||||
// Note: This API is only available to extensions installed by enterprise
|
||||
// policy.
|
||||
namespace enterprise.hardwarePlatform {
|
||||
dictionary HardwarePlatformInfo {
|
||||
DOMString model;
|
||||
DOMString manufacturer;
|
||||
};
|
||||
|
||||
callback HardwarePlatformInfoCallback = void(HardwarePlatformInfo info);
|
||||
|
||||
interface Functions {
|
||||
// Obtains the manufacturer and model for the hardware platform and, if
|
||||
// the extension is authorized, returns it via |callback|.
|
||||
// |callback|: Returns a Promise which resolves with the hardware platform
|
||||
// info.
|
||||
static void getHardwarePlatformInfo(
|
||||
HardwarePlatformInfoCallback callback);
|
||||
};
|
||||
};
|
||||
@@ -1,36 +0,0 @@
|
||||
// Copyright 2023 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.enterprise.kioskInput</code> API to change input
|
||||
// settings for Kiosk sessions.
|
||||
// Note: This API is only available to extensions installed by enterprise
|
||||
// policy in ChromeOS Kiosk sessions.
|
||||
[platforms = ("chromeos"),
|
||||
implemented_in = "chrome/browser/extensions/api/enterprise_kiosk_input/enterprise_kiosk_input_api.h"]
|
||||
namespace enterprise.kioskInput {
|
||||
dictionary SetCurrentInputMethodOptions {
|
||||
// The input method ID to set as current input method. This input
|
||||
// method has to be enabled by enterprise policies. Supported IDs
|
||||
// are located in https://crsrc.org/c/chrome/browser/resources/chromeos/input_method.
|
||||
DOMString inputMethodId;
|
||||
};
|
||||
|
||||
callback SetCurrentInputMethodCallback = void();
|
||||
|
||||
interface Functions {
|
||||
// Sets the current input method. This function only changes
|
||||
// the current input method to an enabled input method.
|
||||
// Input methods can be enabled by enterprise polices.
|
||||
// If the input method ID is invalid, or not enabled,
|
||||
// $(ref:runtime.lastError) will be set with a failure reason.
|
||||
// |options|: Object containing the fields defined in
|
||||
// $(ref:SetCurrentInputMethodOptions).
|
||||
// |callback|: Returns a Promise which resolves when the input method is
|
||||
// changed, or rejects if there is an error.
|
||||
static void setCurrentInputMethod(
|
||||
SetCurrentInputMethodOptions options,
|
||||
SetCurrentInputMethodCallback callback);
|
||||
};
|
||||
|
||||
};
|
||||
@@ -1,17 +0,0 @@
|
||||
// Copyright 2025 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.enterprise.login</code> API to exit Managed Guest
|
||||
// sessions. Note: This API is only available to extensions installed by
|
||||
// enterprise policy in ChromeOS Managed Guest sessions.
|
||||
[platforms = ("chromeos"),
|
||||
implemented_in = "chrome/browser/extensions/api/enterprise_login/enterprise_login_api.h"]
|
||||
namespace enterprise.login {
|
||||
callback VoidCallback = void ();
|
||||
interface Functions {
|
||||
// Exits the current managed guest session.
|
||||
static void exitCurrentManagedGuestSession(
|
||||
optional VoidCallback callback);
|
||||
};
|
||||
};
|
||||
-34
@@ -1,34 +0,0 @@
|
||||
// Copyright 2020 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.enterprise.networkingAttributes</code> API to read
|
||||
// information about your current network.
|
||||
// Note: This API is only available to extensions force-installed by enterprise
|
||||
// policy.
|
||||
[platforms = ("chromeos"),
|
||||
implemented_in = "chrome/browser/extensions/api/enterprise_networking_attributes/enterprise_networking_attributes_api.h"]
|
||||
namespace enterprise.networkingAttributes {
|
||||
[noinline_doc] dictionary NetworkDetails {
|
||||
// The device's MAC address.
|
||||
DOMString macAddress;
|
||||
|
||||
// The device's local IPv4 address (undefined if not configured).
|
||||
DOMString? ipv4;
|
||||
|
||||
// The device's local IPv6 address (undefined if not configured).
|
||||
DOMString? ipv6;
|
||||
};
|
||||
|
||||
callback GetNetworkDetailsCallback = void(NetworkDetails networkAddresses);
|
||||
|
||||
interface Functions {
|
||||
// Retrieves the network details of the device's default network.
|
||||
// If the user is not affiliated or the device is not connected to a
|
||||
// network, $(ref:runtime.lastError) will be set with a failure reason.
|
||||
// |callback| : Returns a Promise which resolves with the device's default
|
||||
// network's $(ref:NetworkDetails).
|
||||
void getNetworkDetails(
|
||||
GetNetworkDetailsCallback callback);
|
||||
};
|
||||
};
|
||||
@@ -1,237 +0,0 @@
|
||||
// Copyright 2014 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.enterprise.platformKeys</code> API to generate keys and
|
||||
// install certificates for these keys. The certificates will be managed by the
|
||||
// platform and can be used for TLS authentication, network access or by other
|
||||
// extension through $(ref:platformKeys chrome.platformKeys).
|
||||
[platforms = ("chromeos")]
|
||||
namespace enterprise.platformKeys {
|
||||
[nocompile] dictionary Token {
|
||||
// Uniquely identifies this <code>Token</code>.
|
||||
// <p>Static IDs are <code>"user"</code> and <code>"system"</code>,
|
||||
// referring to the platform's user-specific and the system-wide hardware
|
||||
// token, respectively. Any other tokens (with other identifiers) might be
|
||||
// returned by $(ref:enterprise.platformKeys.getTokens).</p>
|
||||
DOMString id;
|
||||
|
||||
// Implements the WebCrypto's
|
||||
// <a href="http://www.w3.org/TR/WebCryptoAPI/#subtlecrypto-interface">SubtleCrypto</a>
|
||||
// interface. The cryptographic operations, including key generation, are
|
||||
// hardware-backed.
|
||||
// <p>Only non-extractable keys can be generated. The supported key types
|
||||
// are RSASSA-PKCS1-V1_5 with <code>modulusLength</code> up to 2048 and
|
||||
// ECDSA with <code>namedCurve</code> P-256. Each key can be used for
|
||||
// signing data at most once, unless the extension is allowlisted by the
|
||||
// <a href="https://chromeenterprise.google/policies/#KeyPermissions">KeyPermissions policy</a>,
|
||||
// in which case the key can be used indefinitely.</p>
|
||||
// <p>Keys generated on a specific <code>Token</code> cannot be used with
|
||||
// any other Tokens, nor can they be used with
|
||||
// <code>window.crypto.subtle</code>. Equally, <code>Key</code> objects
|
||||
// created with <code>window.crypto.subtle</code> cannot be used with this
|
||||
// interface.</p>
|
||||
[instanceOf = SubtleCrypto] object subtleCrypto;
|
||||
|
||||
// Implements the WebCrypto's
|
||||
// <a href="http://www.w3.org/TR/WebCryptoAPI/#subtlecrypto-interface">SubtleCrypto</a>
|
||||
// interface. The cryptographic operations, including key generation, are
|
||||
// software-backed. Protection of the keys, and thus implementation of the
|
||||
// non-extractable property, is done in software, so the keys are less
|
||||
// protected than hardware-backed keys.
|
||||
// <p>Only non-extractable keys can be generated. The only supported key
|
||||
// type is RSASSA-PKCS1-V1_5 with <code>modulusLength</code> up to 2048.
|
||||
// Each key can be used for signing data at most once, unless the extension
|
||||
// is allowlisted through the
|
||||
// <a href="https://chromeenterprise.google/policies/#KeyPermissions">KeyPermissions policy</a>,
|
||||
// in which case the key can be used indefinitely.</p>
|
||||
// <p>Keys generated on a specific <code>Token</code> cannot be used with
|
||||
// any other Tokens, nor can they be used with
|
||||
// <code>window.crypto.subtle</code>. Equally, <code>Key</code> objects
|
||||
// created with <code>window.crypto.subtle</code> cannot be used with this
|
||||
// interface.</p>
|
||||
[instanceOf = SubtleCrypto] object softwareBackedSubtleCrypto;
|
||||
};
|
||||
|
||||
// Whether to use the Enterprise User Key or the Enterprise Machine Key.
|
||||
enum Scope { USER, MACHINE };
|
||||
|
||||
// Type of key to generate.
|
||||
enum Algorithm { RSA, ECDSA };
|
||||
|
||||
// Invoked by <code>getTokens</code> with the list of available Tokens.
|
||||
// |tokens|: The list of available tokens.
|
||||
callback GetTokensCallback = void(Token[] tokens);
|
||||
|
||||
// Callback to which the certificates are passed.
|
||||
// |certificates|: The list of certificates, each in DER encoding of a X.509
|
||||
// certificate.
|
||||
callback GetCertificatesCallback = void(ArrayBuffer[] certificates);
|
||||
|
||||
// Invoked by importCertificate or removeCertificate when the respective
|
||||
// operation is finished.
|
||||
callback DoneCallback = void();
|
||||
|
||||
// Invoked by <code>challengeMachineKey</code> or
|
||||
// <code>challengeUserKey</code> with the challenge response.
|
||||
// |response|: The challenge response.
|
||||
callback ChallengeCallback = void(ArrayBuffer response);
|
||||
|
||||
dictionary RegisterKeyOptions {
|
||||
// Which algorithm the registered key should use.
|
||||
Algorithm algorithm;
|
||||
};
|
||||
|
||||
dictionary ChallengeKeyOptions {
|
||||
// A challenge as emitted by the Verified Access Web API.
|
||||
ArrayBuffer challenge;
|
||||
// If present, registers the challenged key with the specified
|
||||
// <code>scope</code>'s token. The key can then be associated with a
|
||||
// certificate and used like any other signing key. Subsequent calls to
|
||||
// this function will then generate a new Enterprise Key in the specified
|
||||
// <code>scope</code>.
|
||||
RegisterKeyOptions? registerKey;
|
||||
// Which Enterprise Key to challenge.
|
||||
Scope scope;
|
||||
};
|
||||
|
||||
interface Functions {
|
||||
// Returns the available Tokens. In a regular user's session the list will
|
||||
// always contain the user's token with <code>id</code> <code>"user"</code>.
|
||||
// If a system-wide TPM token is available, the returned list will also
|
||||
// contain the system-wide token with <code>id</code> <code>"system"</code>.
|
||||
// The system-wide token will be the same for all sessions on this device
|
||||
// (device in the sense of e.g. a Chromebook).
|
||||
[nocompile] static void getTokens(GetTokensCallback callback);
|
||||
|
||||
// Returns the list of all client certificates available from the given
|
||||
// token. Can be used to check for the existence and expiration of client
|
||||
// certificates that are usable for a certain authentication.
|
||||
// |tokenId|: The id of a Token returned by <code>getTokens</code>.
|
||||
// |callback|: Returns a Promise which resolves with the list of the
|
||||
// available certificates.
|
||||
static void getCertificates(DOMString tokenId,
|
||||
GetCertificatesCallback callback);
|
||||
|
||||
// Imports <code>certificate</code> to the given token if the certified key
|
||||
// is already stored in this token.
|
||||
// After a successful certification request, this function should be used to
|
||||
// store the obtained certificate and to make it available to the operating
|
||||
// system and browser for authentication.
|
||||
// |tokenId|: The id of a Token returned by <code>getTokens</code>.
|
||||
// |certificate|: The DER encoding of a X.509 certificate.
|
||||
// |callback|: Returns a Promise which resolves when this operation is
|
||||
// finished.
|
||||
static void importCertificate(DOMString tokenId,
|
||||
ArrayBuffer certificate,
|
||||
optional DoneCallback callback);
|
||||
|
||||
// Removes <code>certificate</code> from the given token if present.
|
||||
// Should be used to remove obsolete certificates so that they are not
|
||||
// considered during authentication and do not clutter the certificate
|
||||
// choice. Should be used to free storage in the certificate store.
|
||||
// |tokenId|: The id of a Token returned by <code>getTokens</code>.
|
||||
// |certificate|: The DER encoding of a X.509 certificate.
|
||||
// |callback|: Returns a Promise which resolves when this operation is
|
||||
// finished.
|
||||
static void removeCertificate(DOMString tokenId,
|
||||
ArrayBuffer certificate,
|
||||
optional DoneCallback callback);
|
||||
|
||||
// Similar to <code>challengeMachineKey</code> and
|
||||
// <code>challengeUserKey</code>, but allows specifying the algorithm of a
|
||||
// registered key. Challenges a hardware-backed Enterprise Machine Key and
|
||||
// emits the response as part of a remote attestation protocol. Only useful
|
||||
// on ChromeOS and in conjunction with the Verified Access Web API which
|
||||
// both issues challenges and verifies responses.
|
||||
//
|
||||
// A successful verification by the Verified Access Web API is a strong
|
||||
// signal that the current device is a legitimate ChromeOS device, the
|
||||
// current device is managed by the domain specified during verification,
|
||||
// the current signed-in user is managed by the domain specified during
|
||||
// verification, and the current device state complies with enterprise
|
||||
// device policy. For example, a policy may specify that the device must not
|
||||
// be in developer mode. Any device identity emitted by the verification is
|
||||
// tightly bound to the hardware of the current device. If
|
||||
// <code>"user"</code> Scope is specified, the identity is also tightly
|
||||
// bound to the current signed-in user.
|
||||
//
|
||||
// This function is highly restricted and will fail if the current device is
|
||||
// not managed, the current user is not managed, or if this operation has
|
||||
// not explicitly been enabled for the caller by enterprise device policy.
|
||||
// The challenged key does not reside in the <code>"system"</code> or
|
||||
// <code>"user"</code> token and is not accessible by any other API.
|
||||
// |options|: Object containing the fields defined in
|
||||
// $(ref:ChallengeKeyOptions).
|
||||
// |callback|: Returns a Promise which resolves with the challenge response.
|
||||
static void challengeKey(ChallengeKeyOptions options,
|
||||
ChallengeCallback callback);
|
||||
|
||||
// Challenges a hardware-backed Enterprise Machine Key and emits the
|
||||
// response as part of a remote attestation protocol. Only useful on
|
||||
// ChromeOS and in conjunction with the Verified Access Web API which both
|
||||
// issues challenges and verifies responses. A successful verification by
|
||||
// the Verified Access Web API is a strong signal of all of the following:
|
||||
// * The current device is a legitimate ChromeOS device.
|
||||
// * The current device is managed by the domain specified during
|
||||
// verification.
|
||||
// * The current signed-in user is managed by the domain specified during
|
||||
// verification.
|
||||
// * The current device state complies with enterprise device policy. For
|
||||
// example, a policy may specify that the device must not be in developer
|
||||
// mode.
|
||||
// * Any device identity emitted by the verification is tightly bound to the
|
||||
// hardware of the current device.
|
||||
// This function is highly restricted and will fail if the current device
|
||||
// is not managed, the current user is not managed, or if this operation
|
||||
// has not explicitly been enabled for the caller by enterprise device
|
||||
// policy. The Enterprise Machine Key does not reside in the
|
||||
// <code>"system"</code> token and is not accessible by any other API.
|
||||
// |challenge|: A challenge as emitted by the Verified Access Web API.
|
||||
// |registerKey|: If set, the current Enterprise Machine Key is registered
|
||||
// with the <code>"system"</code> token and relinquishes the
|
||||
// Enterprise Machine Key role. The key can then be
|
||||
// associated with a certificate and used like any other
|
||||
// signing key. This key is 2048-bit RSA. Subsequent calls
|
||||
// to this function will then generate a new Enterprise
|
||||
// Machine Key.
|
||||
// |callback|: Returns a Promise which resolves with the challenge response.
|
||||
[deprecated="Use $(ref:challengeKey) instead."]
|
||||
static void challengeMachineKey(ArrayBuffer challenge,
|
||||
optional boolean registerKey,
|
||||
ChallengeCallback callback);
|
||||
|
||||
// Challenges a hardware-backed Enterprise User Key and emits the response
|
||||
// as part of a remote attestation protocol. Only useful on ChromeOS and in
|
||||
// conjunction with the Verified Access Web API which both issues challenges
|
||||
// and verifies responses. A successful verification by the Verified Access
|
||||
// Web API is a strong signal of all of the following:
|
||||
// * The current device is a legitimate ChromeOS device.
|
||||
// * The current device is managed by the domain specified during
|
||||
// verification.
|
||||
// * The current signed-in user is managed by the domain specified during
|
||||
// verification.
|
||||
// * The current device state complies with enterprise user policy. For
|
||||
// example, a policy may specify that the device must not be in developer
|
||||
// mode.
|
||||
// * The public key emitted by the verification is tightly bound to the
|
||||
// hardware of the current device and to the current signed-in user.
|
||||
// This function is highly restricted and will fail if the current device is
|
||||
// not managed, the current user is not managed, or if this operation has
|
||||
// not explicitly been enabled for the caller by enterprise user policy.
|
||||
// The Enterprise User Key does not reside in the <code>"user"</code> token
|
||||
// and is not accessible by any other API.
|
||||
// |challenge|: A challenge as emitted by the Verified Access Web API.
|
||||
// |registerKey|: If set, the current Enterprise User Key is registered with
|
||||
// the <code>"user"</code> token and relinquishes the
|
||||
// Enterprise User Key role. The key can then be associated
|
||||
// with a certificate and used like any other signing key.
|
||||
// This key is 2048-bit RSA. Subsequent calls to this
|
||||
// function will then generate a new Enterprise User Key.
|
||||
// |callback|: Returns a Promise which resolves with the challenge response.
|
||||
[deprecated="Use $(ref:challengeKey) instead."]
|
||||
static void challengeUserKey(ArrayBuffer challenge,
|
||||
boolean registerKey,
|
||||
ChallengeCallback callback);
|
||||
};
|
||||
};
|
||||
-60
@@ -1,60 +0,0 @@
|
||||
// Copyright 2014 The Chromium Authors
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Internal API for platform keys and certificate management.
|
||||
[ platforms = ("chromeos"),
|
||||
implemented_in = "chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api.h" ]
|
||||
namespace enterprise.platformKeysInternal {
|
||||
dictionary Hash {
|
||||
DOMString name;
|
||||
};
|
||||
|
||||
// For more information about the RSA key generation parameters, please refer
|
||||
// to: https://www.w3.org/TR/WebCryptoAPI/#RsaHashedKeyGenParams-dictionary
|
||||
// For more information about the ECDSA key generation parameters, please
|
||||
// refer to: https://www.w3.org/TR/WebCryptoAPI/#dfn-EcdsaParams
|
||||
// Note: |hash| is not used by generateKey() but is added to completely
|
||||
// mirror WebCrypto in using RsaHashedKeyAlgorithm to be able to wrap all
|
||||
// parameters in one structure.
|
||||
dictionary Algorithm {
|
||||
// Provided for all algorithms.
|
||||
DOMString name;
|
||||
|
||||
// Provided in case the algorithm is RSASSA-PKCS1-v1_5.
|
||||
long? modulusLength;
|
||||
ArrayBuffer? publicExponent;
|
||||
Hash? hash;
|
||||
|
||||
// Provided in case the algorithm is ECDSA.
|
||||
DOMString? namedCurve;
|
||||
};
|
||||
|
||||
// Invoked by <code>getTokens</code>.
|
||||
// |tokenIds| The list of IDs of the available Tokens.
|
||||
callback GetTokensCallback = void(DOMString[] tokenIds);
|
||||
|
||||
// Invoked by <code>generateKey</code>.
|
||||
// |publicKey| The Subject Public Key Info (see X.509) of the generated key
|
||||
// in DER encoding.
|
||||
callback GenerateKeyCallback = void(ArrayBuffer publicKey);
|
||||
|
||||
interface Functions {
|
||||
// Internal version of enterprise.platformKeys.getTokens. Returns a list of
|
||||
// token IDs instead of token objects.
|
||||
static void getTokens(GetTokensCallback callback);
|
||||
|
||||
// Internal version of SubtleCrypto.generateKey, currently supporting only
|
||||
// RSASSA-PKCS1-v1_5 and ECDSA.
|
||||
// |tokenId| The id of a Token returned by |getTokens|.
|
||||
// |algorithm| The algorithm parameters as specified by WebCrypto.
|
||||
// |softwareBacked| Whether the key operations should be executed in
|
||||
// software.
|
||||
// |callback| Called back with the Subject Public Key Info of the generated
|
||||
// key.
|
||||
static void generateKey(DOMString tokenId,
|
||||
Algorithm algorithm,
|
||||
boolean softwareBacked,
|
||||
GenerateKeyCallback callback);
|
||||
};
|
||||
};
|
||||
@@ -127,6 +127,16 @@ namespace passwordsPrivate {
|
||||
SUCCESS
|
||||
};
|
||||
|
||||
enum PasswordManagerActionableError {
|
||||
NO_ERROR,
|
||||
INACTIONABLE,
|
||||
INACTIONABLE_TEMPORARY_ERROR,
|
||||
SIGN_IN_NEEDED,
|
||||
KEYCHAIN_ERROR,
|
||||
TRUSTED_VAULT_KEY_NEEDED,
|
||||
NEEDS_PASSPHRASE
|
||||
};
|
||||
|
||||
dictionary PublicKey {
|
||||
// The value of the public key.
|
||||
DOMString value;
|
||||
@@ -372,20 +382,14 @@ namespace passwordsPrivate {
|
||||
callback ExceptionListCallback = void(ExceptionEntry[] exceptions);
|
||||
callback ExportProgressStatusCallback = void(ExportProgressStatus status);
|
||||
callback VoidCallback = void();
|
||||
callback IsAccountStorageActiveCallback = void(boolean enabled);
|
||||
callback ShouldShowAccountStorageSettingToggleCallback = void(boolean show);
|
||||
callback PasswordCheckStatusCallback = void(PasswordCheckStatus status);
|
||||
callback ImportPasswordsCallback = void(ImportResults results);
|
||||
callback FetchFamilyResultsCallback = void(FamilyFetchResults results);
|
||||
callback GetUrlCollectionCallback = void(UrlCollection urlCollection);
|
||||
callback CredentialsWithReusedPasswordCallback =
|
||||
void(PasswordUiEntryList[] entries);
|
||||
callback PasswordManagerPinAvailableCallback = void(boolean available);
|
||||
callback PasswordManagerPinChangedCallback = void(boolean success);
|
||||
callback DisconnectCloudAuthenticatorCallback = void(boolean success);
|
||||
callback IsConnectedToCloudAuthenticatorCallback = void(boolean connected);
|
||||
callback DeleteAllPasswordManagerDataCallback = void(boolean success);
|
||||
callback AuthenticationResultCallback = void(boolean result);
|
||||
|
||||
interface Functions {
|
||||
// Function that logs that the Passwords page was accessed from the Chrome
|
||||
@@ -508,18 +512,6 @@ namespace passwordsPrivate {
|
||||
static void requestExportProgressStatus(
|
||||
ExportProgressStatusCallback callback);
|
||||
|
||||
// Requests the account-storage active state of the current user.
|
||||
static void isAccountStorageActive(
|
||||
IsAccountStorageActiveCallback callback);
|
||||
|
||||
// Triggers the enabling / disabling flow for the account storage.
|
||||
static void setAccountStorageEnabled(boolean enabled);
|
||||
|
||||
// Requests whether the account-storage settings toggle should be
|
||||
// shown.
|
||||
static void shouldShowAccountStorageSettingToggle(
|
||||
ShouldShowAccountStorageSettingToggleCallback callback);
|
||||
|
||||
// Requests the latest insecure credentials.
|
||||
static void getInsecureCredentials(
|
||||
PasswordListCallback callback);
|
||||
@@ -563,33 +555,9 @@ namespace passwordsPrivate {
|
||||
AddPasswordOptions options,
|
||||
optional VoidCallback callback);
|
||||
|
||||
// Restarts the authentication timeout timer if the user is authenticated.
|
||||
// |callback|: The callback that gets invoked on success.
|
||||
static void extendAuthValidity(
|
||||
optional VoidCallback callback);
|
||||
|
||||
// Switches Biometric authentication before filling state after
|
||||
// successful authentication.
|
||||
// |callback|: The callback that gets invoked with the authentication
|
||||
// result.
|
||||
[platforms = ("win", "mac", "chromeos")] static void
|
||||
switchBiometricAuthBeforeFillingState(
|
||||
AuthenticationResultCallback callback);
|
||||
|
||||
// Shows a dialog for creating a shortcut for the Password Manager page.
|
||||
static void showAddShortcutDialog();
|
||||
|
||||
// Opens a file with exported passwords in the OS shell.
|
||||
static void showExportedFileInShell(DOMString file_path);
|
||||
|
||||
// Shows a dialog for changing the Password Manager PIN.
|
||||
static void changePasswordManagerPin(
|
||||
optional PasswordManagerPinChangedCallback callback);
|
||||
|
||||
// Checks whether changing Password Manager PIN is possible.
|
||||
static void isPasswordManagerPinAvailable(
|
||||
PasswordManagerPinAvailableCallback callback);
|
||||
|
||||
// Disconnects the Chrome client from the cloud authenticator.
|
||||
static void disconnectCloudAuthenticator(
|
||||
DisconnectCloudAuthenticatorCallback callback);
|
||||
@@ -598,12 +566,6 @@ namespace passwordsPrivate {
|
||||
// the cloud authenticator.
|
||||
static void isConnectedToCloudAuthenticator(
|
||||
IsConnectedToCloudAuthenticatorCallback callback);
|
||||
|
||||
// Deletes all password manager data (passwords, passkeys, etc.)
|
||||
// |callback|: The callback that gets invoked with true on successful
|
||||
// deletion and false on failure (e.g. not all data was deleted).
|
||||
static void deleteAllPasswordManagerData(
|
||||
DeleteAllPasswordManagerDataCallback callback);
|
||||
};
|
||||
|
||||
interface Events {
|
||||
@@ -641,5 +603,9 @@ namespace passwordsPrivate {
|
||||
|
||||
// Fired when the password manager access timed out.
|
||||
static void onPasswordManagerAuthTimeout();
|
||||
|
||||
// Fired when the password manager actionable error changed.
|
||||
static void onPasswordManagerActionableErrorChanged(
|
||||
PasswordManagerActionableError error);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Internal API for to implement the platformKeys and enterprise.platformKeys
|
||||
// APIs.
|
||||
// Internal API to implement the platformKeys and enterprise.platformKeys APIs.
|
||||
[implemented_in = "chrome/browser/extensions/api/platform_keys/platform_keys_api.h"]
|
||||
namespace platformKeysInternal {
|
||||
callback SelectCallback = void (platformKeys.Match[] certs);
|
||||
|
||||
@@ -197,6 +197,7 @@
|
||||
#include "components/feed/feed_feature_list.h"
|
||||
#else
|
||||
#include "chrome/common/record_replay/record_replay_features.h"
|
||||
#include "chrome/renderer/indigo/indigo_agent.h"
|
||||
#include "chrome/renderer/record_replay/record_replay_agent.h"
|
||||
#include "chrome/renderer/searchbox/searchbox.h"
|
||||
#include "chrome/renderer/searchbox/searchbox_extension.h"
|
||||
@@ -327,9 +328,9 @@ void AppendParams(
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < additional_params.size(); ++i) {
|
||||
names[existing_size + i] = WebString::FromUTF16(additional_params[i].name);
|
||||
names[existing_size + i] = WebString::FromUtf16(additional_params[i].name);
|
||||
values[existing_size + i] =
|
||||
WebString::FromUTF16(additional_params[i].value);
|
||||
WebString::FromUtf16(additional_params[i].value);
|
||||
}
|
||||
|
||||
existing_names->swap(names);
|
||||
@@ -426,15 +427,15 @@ void ChromeContentRendererClient::RenderThreadStarted() {
|
||||
|
||||
extensions_renderer_client->RenderThreadStarted();
|
||||
WebSecurityPolicy::RegisterURLSchemeAsExtension(
|
||||
WebString::FromASCII(extensions::kExtensionScheme));
|
||||
WebString::FromAscii(extensions::kExtensionScheme));
|
||||
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
|
||||
BUILDFLAG(IS_CHROMEOS)
|
||||
WebSecurityPolicy::RegisterURLSchemeAsIsolatedApp(
|
||||
WebString::FromASCII(webapps::kIsolatedAppScheme));
|
||||
WebString::FromAscii(webapps::kIsolatedAppScheme));
|
||||
#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) ||
|
||||
// BUILDFLAG(IS_CHROMEOS)
|
||||
WebSecurityPolicy::RegisterURLSchemeAsCodeCacheWithHashing(
|
||||
WebString::FromASCII(extensions::kExtensionScheme));
|
||||
WebString::FromAscii(extensions::kExtensionScheme));
|
||||
#endif // BUILDFLAG(ENABLE_EXTENSIONS_CORE)
|
||||
|
||||
#if BUILDFLAG(ENABLE_SPELLCHECK)
|
||||
@@ -474,7 +475,7 @@ void ChromeContentRendererClient::RenderThreadStarted() {
|
||||
// treated as first-party.
|
||||
// See
|
||||
// ChromeContentBrowserClient::ShouldTreatURLSchemeAsFirstPartyWhenTopLevel
|
||||
WebString chrome_scheme(WebString::FromASCII(content::kChromeUIScheme));
|
||||
WebString chrome_scheme(WebString::FromAscii(content::kChromeUIScheme));
|
||||
WebSecurityPolicy::RegisterURLSchemeAsFirstPartyWhenTopLevelEmbeddingSecure(
|
||||
chrome_scheme);
|
||||
|
||||
@@ -485,7 +486,7 @@ void ChromeContentRendererClient::RenderThreadStarted() {
|
||||
// URLs since it should never be visible to the user.
|
||||
// See also ChromeContentClient::AddAdditionalSchemes that adds it as an
|
||||
// empty document scheme.
|
||||
WebString native_scheme(WebString::FromASCII(chrome::kChromeNativeScheme));
|
||||
WebString native_scheme(WebString::FromAscii(chrome::kChromeNativeScheme));
|
||||
WebSecurityPolicy::RegisterURLSchemeAsDisplayIsolated(native_scheme);
|
||||
WebSecurityPolicy::RegisterURLSchemeAsNotAllowingJavascriptURLs(
|
||||
native_scheme);
|
||||
@@ -494,7 +495,7 @@ void ChromeContentRendererClient::RenderThreadStarted() {
|
||||
// normal content, and should also be unable to script anything but themselves
|
||||
// (to help limit the damage that a corrupt page could cause).
|
||||
WebString chrome_search_scheme(
|
||||
WebString::FromASCII(chrome::kChromeSearchScheme));
|
||||
WebString::FromAscii(chrome::kChromeSearchScheme));
|
||||
|
||||
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
|
||||
BUILDFLAG(IS_CHROMEOS)
|
||||
@@ -506,7 +507,7 @@ void ChromeContentRendererClient::RenderThreadStarted() {
|
||||
// isolated-app: is the scheme used for Isolated Web Apps, which are web
|
||||
// applications packaged in Signed Web Bundles.
|
||||
WebString isolated_app_scheme(
|
||||
WebString::FromASCII(webapps::kIsolatedAppScheme));
|
||||
WebString::FromAscii(webapps::kIsolatedAppScheme));
|
||||
// Resources contained in Isolated Web Apps are HTTP-like and safe to expose
|
||||
// to the fetch API.
|
||||
WebSecurityPolicy::RegisterURLSchemeAsSupportingFetchAPI(
|
||||
@@ -546,7 +547,7 @@ void ChromeContentRendererClient::RenderThreadStarted() {
|
||||
}
|
||||
|
||||
WebString dom_distiller_scheme(
|
||||
WebString::FromASCII(dom_distiller::kDomDistillerScheme));
|
||||
WebString::FromAscii(dom_distiller::kDomDistillerScheme));
|
||||
// TODO(nyquist): Add test to ensure this happens when the flag is set.
|
||||
WebSecurityPolicy::RegisterURLSchemeAsDisplayIsolated(dom_distiller_scheme);
|
||||
|
||||
@@ -563,7 +564,7 @@ void ChromeContentRendererClient::RenderThreadStarted() {
|
||||
for (auto& scheme :
|
||||
secure_origin_allowlist::GetSchemesBypassingSecureContextCheck()) {
|
||||
WebSecurityPolicy::AddSchemeToSecureContextSafelist(
|
||||
WebString::FromASCII(scheme));
|
||||
WebString::FromAscii(scheme));
|
||||
}
|
||||
|
||||
// This doesn't work in single-process mode.
|
||||
@@ -705,6 +706,7 @@ void ChromeContentRendererClient::RenderFrameCreated(
|
||||
record_replay::features::kRecordReplayBase)) {
|
||||
new record_replay::RecordReplayAgent(render_frame, associated_interfaces);
|
||||
}
|
||||
indigo::IndigoAgent::MaybeCreate(render_frame, associated_interfaces);
|
||||
#endif
|
||||
|
||||
if (content_capture::features::IsContentCaptureEnabled()) {
|
||||
@@ -1453,13 +1455,13 @@ void ChromeContentRendererClient::
|
||||
blink::WebRuntimeFeatures::EnableAIPromptAPI(true);
|
||||
}
|
||||
blink::WebRuntimeFeatures::EnableAIPromptAPIForWorkers(true);
|
||||
blink::WebRuntimeFeatures::EnableAIPromptAPILegacyIdentifiers(true);
|
||||
blink::WebRuntimeFeatures::EnableAIPromptAPILegacyParams(true);
|
||||
blink::WebRuntimeFeatures::EnableAIRewriterAPIForWorkers(true);
|
||||
blink::WebRuntimeFeatures::EnableAISummarizationAPIForWorkers(true);
|
||||
blink::WebRuntimeFeatures::EnableAIWriterAPIForWorkers(true);
|
||||
blink::WebRuntimeFeatures::EnableLanguageDetectionAPIForWorkers(true);
|
||||
blink::WebRuntimeFeatures::EnableTranslationAPIForWorkers(true);
|
||||
blink::WebRuntimeFeatures::EnableLanguageModelLegacyParamsAndAttributes(
|
||||
true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -103,6 +103,10 @@ doc_feature_user_only:
|
||||
desc: The name of the feature that indicates whether a policy can only be set with
|
||||
signed in managed account.
|
||||
text: User Only
|
||||
doc_feature_uses_machine_and_user_values:
|
||||
desc: The name of the feature that indicates whether a policy can be set for the
|
||||
machine and for the user.
|
||||
text: Can be set for machine and user
|
||||
doc_group_intro:
|
||||
desc: Introduction text for the generated policy atomic group documentation
|
||||
text: Both Chromium and Google Chrome have some groups of policies that depend on
|
||||
|
||||
@@ -55,10 +55,10 @@ policies:
|
||||
54: DefaultGeolocationSetting
|
||||
55: Disable3DAPIs
|
||||
56: PolicyRefreshRate
|
||||
57: ChromeFrameRendererSettings
|
||||
58: RenderInChromeFrameList
|
||||
59: RenderInHostList
|
||||
60: ChromeFrameContentTypes
|
||||
57: ''
|
||||
58: ''
|
||||
59: ''
|
||||
60: ''
|
||||
61: ChromeOsLockOnIdleSuspend
|
||||
62: InstantEnabled
|
||||
63: UserDataDir
|
||||
@@ -85,7 +85,7 @@ policies:
|
||||
84: AllowFileSelectionDialogs
|
||||
85: DisabledSchemes
|
||||
86: AlwaysAuthorizePlugins
|
||||
87: GCFUserDataDir
|
||||
87: ''
|
||||
88: DiskCacheDir
|
||||
89: AllowCrossOriginAuthPrompt
|
||||
90: DevicePolicyRefreshRate
|
||||
@@ -139,7 +139,7 @@ policies:
|
||||
138: BackgroundModeEnabled
|
||||
139: DriveDisabled
|
||||
140: DriveDisabledOverCellular
|
||||
141: AdditionalLaunchParameters
|
||||
141: ''
|
||||
142: DeviceTargetVersionPrefix
|
||||
143: ReportDeviceLocation
|
||||
144: PinnedLauncherApps
|
||||
@@ -219,7 +219,7 @@ policies:
|
||||
218: DeviceLoginScreenDefaultScreenMagnifierType
|
||||
219: SupervisedUsersEnabled
|
||||
220: PresentationScreenDimDelayScale
|
||||
221: SuppressChromeFrameTurndownPrompt
|
||||
221: ''
|
||||
222: IdleActionBattery
|
||||
223: SupervisedUserCreationEnabled
|
||||
224: ReportDeviceNetworkInterfaces
|
||||
@@ -236,7 +236,7 @@ policies:
|
||||
235: RequireOnlineRevocationChecksForLocalAnchors
|
||||
236: SystemUse24HourClock
|
||||
237: DefaultSearchProviderNewTabURL
|
||||
238: SkipMetadataCheck
|
||||
238: ''
|
||||
239: AttestationForContentProtectionEnabled
|
||||
240: FullscreenAllowed
|
||||
241: DataCompressionProxyEnabled
|
||||
@@ -1433,6 +1433,11 @@ policies:
|
||||
1432: WebRtcDiagnosticLogCollectionAllowedForOrigins
|
||||
1433: IsolatedWebAppUserInstallationEnabled
|
||||
1434: ExtensionDOMActivityLoggingEnabled
|
||||
1435: SharedWorkerExtendedLifetimeEnabled
|
||||
1436: MaxConnectionsPerProxyForWebSocket
|
||||
1437: KrispNoiseCancellationEnabled
|
||||
1438: AndroidEntraSsoEnabled
|
||||
1439: FindsSettings
|
||||
|
||||
atomic_groups:
|
||||
1: Homepage
|
||||
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
caption: Allow <ph name="PRODUCT_FRAME_NAME">$3<ex>Google Chrome Frame</ex></ph> to
|
||||
handle the following content types
|
||||
desc: Allow <ph name="PRODUCT_FRAME_NAME">$3<ex>Google Chrome Frame</ex></ph> to handle
|
||||
the following content types.
|
||||
-22
@@ -1,22 +0,0 @@
|
||||
caption: Allow <ph name="PRODUCT_FRAME_NAME">$3<ex>Google Chrome Frame</ex></ph> to
|
||||
handle the listed content types
|
||||
deprecated: true
|
||||
desc: |-
|
||||
If this policy is set, the specified content types are handled by <ph name="PRODUCT_FRAME_NAME">$3<ex>Google Chrome Frame</ex></ph>.
|
||||
|
||||
If this policy is not set, the default renderer is used for all sites. (The <ph name="CHROME_FRAME_RENDERER_SETTINGS_POLICY_NAME">ChromeFrameRendererSettings</ph> policy may be used to configure the default renderer.)
|
||||
example_value:
|
||||
- text/xml
|
||||
- application/xml
|
||||
features:
|
||||
dynamic_refresh: false
|
||||
owners:
|
||||
- file://components/policy/OWNERS
|
||||
schema:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
supported_on:
|
||||
- chrome_frame:8-32
|
||||
tags: []
|
||||
type: list
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
caption: Default HTML renderer for <ph name="PRODUCT_FRAME_NAME">$3<ex>Google Chrome
|
||||
Frame</ex></ph>
|
||||
desc: |-
|
||||
Allows you to configure the default HTML renderer when <ph name="PRODUCT_FRAME_NAME">$3<ex>Google Chrome Frame</ex></ph> is installed.
|
||||
The default setting is to allow the host browser do the rendering, but you can optionally override this and have <ph name="PRODUCT_FRAME_NAME">$3<ex>Google Chrome Frame</ex></ph> render HTML pages by default.
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
caption: Additional command line parameters for <ph name="PRODUCT_NAME">$1<ex>Google
|
||||
Chrome</ex></ph>
|
||||
deprecated: true
|
||||
desc: |-
|
||||
Allows you to specify additional parameters that are used when <ph name="PRODUCT_FRAME_NAME">$3<ex>Google Chrome Frame</ex></ph> launches <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>.
|
||||
|
||||
If this policy is not set the default command line will be used.
|
||||
example_value: --enable-media-stream --enable-media-source
|
||||
features:
|
||||
dynamic_refresh: false
|
||||
owners:
|
||||
- file://components/policy/OWNERS
|
||||
- rsorokin@chromium.org
|
||||
schema:
|
||||
type: string
|
||||
supported_on:
|
||||
- chrome_frame:19-32
|
||||
tags: []
|
||||
type: string
|
||||
-28
@@ -1,28 +0,0 @@
|
||||
caption: Default HTML renderer for <ph name="PRODUCT_FRAME_NAME">$3<ex>Google Chrome
|
||||
Frame</ex></ph>
|
||||
deprecated: true
|
||||
desc: |-
|
||||
Allows you to configure the default HTML renderer when <ph name="PRODUCT_FRAME_NAME">$3<ex>Google Chrome Frame</ex></ph> is installed.
|
||||
The default setting used when this policy is left not set is to allow the host browser do the rendering, but you can optionally override this and have <ph name="PRODUCT_FRAME_NAME">$3<ex>Google Chrome Frame</ex></ph> render HTML pages by default.
|
||||
example_value: 1
|
||||
features:
|
||||
dynamic_refresh: false
|
||||
items:
|
||||
- caption: Use the host browser by default
|
||||
name: RenderInHost
|
||||
value: 0
|
||||
- caption: Use <ph name="PRODUCT_FRAME_NAME">$3<ex>Google Chrome Frame</ex></ph> by
|
||||
default
|
||||
name: RenderInChromeFrame
|
||||
value: 1
|
||||
owners:
|
||||
- file://components/policy/OWNERS
|
||||
schema:
|
||||
enum:
|
||||
- 0
|
||||
- 1
|
||||
type: integer
|
||||
supported_on:
|
||||
- chrome_frame:8-32
|
||||
tags: []
|
||||
type: int-enum
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
caption: Always render the following URL patterns in <ph name="PRODUCT_FRAME_NAME">$3<ex>Google
|
||||
Chrome Frame</ex></ph>
|
||||
deprecated: true
|
||||
desc: |-
|
||||
Customize the list of URL patterns that should always be rendered by <ph name="PRODUCT_FRAME_NAME">$3<ex>Google Chrome Frame</ex></ph>.
|
||||
|
||||
If this policy is not set the default renderer will be used for all sites as specified by the 'ChromeFrameRendererSettings' policy.
|
||||
|
||||
For example patterns see https://www.chromium.org/developers/how-tos/chrome-frame-getting-started.
|
||||
example_value:
|
||||
- https://www.example.com
|
||||
- https://www.example.edu
|
||||
features:
|
||||
dynamic_refresh: false
|
||||
owners:
|
||||
- file://components/policy/OWNERS
|
||||
- rsorokin@chromium.org
|
||||
schema:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
supported_on:
|
||||
- chrome_frame:8-32
|
||||
tags: []
|
||||
type: list
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
caption: Always render the following URL patterns in the host browser
|
||||
deprecated: true
|
||||
desc: |-
|
||||
Customize the list of URL patterns that should always be rendered by the host browser.
|
||||
|
||||
If this policy is not set the default renderer will be used for all sites as specified by the 'ChromeFrameRendererSettings' policy.
|
||||
|
||||
For example patterns see https://www.chromium.org/developers/how-tos/chrome-frame-getting-started.
|
||||
example_value:
|
||||
- https://www.example.com
|
||||
- https://www.example.edu
|
||||
features:
|
||||
dynamic_refresh: false
|
||||
owners:
|
||||
- file://components/policy/OWNERS
|
||||
- rsorokin@chromium.org
|
||||
schema:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
supported_on:
|
||||
- chrome_frame:8-32
|
||||
tags: []
|
||||
type: list
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
caption: Skip the meta tag check in <ph name="PRODUCT_FRAME_NAME">$3<ex>Google Chrome
|
||||
Frame</ex></ph>
|
||||
deprecated: true
|
||||
desc: |-
|
||||
Normally pages with X-UA-Compatible set to chrome=1 will be rendered in <ph name="PRODUCT_FRAME_NAME">$3<ex>Google Chrome Frame</ex></ph> regardless of the 'ChromeFrameRendererSettings' policy.
|
||||
|
||||
If you enable this setting, pages will not be scanned for meta tags.
|
||||
|
||||
If you disable this setting, pages will be scanned for meta tags.
|
||||
|
||||
If this policy is not set, pages will be scanned for meta tags.
|
||||
example_value: false
|
||||
features:
|
||||
dynamic_refresh: false
|
||||
owners:
|
||||
- file://components/policy/OWNERS
|
||||
- rsorokin@chromium.org
|
||||
schema:
|
||||
type: boolean
|
||||
supported_on:
|
||||
- chrome_frame:31-32
|
||||
tags: []
|
||||
type: main
|
||||
+3
-2
@@ -1,6 +1,6 @@
|
||||
caption: Automatically select client certificates for these sites
|
||||
desc: |-
|
||||
Setting the policy lets you make a list of URL patterns that specify sites for which Chrome can automatically select a client certificate. The value is an array of stringified JSON dictionaries, each with the form <ph name="AUTO_SELECT_CERTIFICATE_FOR_URLS_EXAMPLE">{ "pattern": "$URL_PATTERN", "filter" : $FILTER }</ph>, where <ph name="URL_PATTERN_PLACEHOLDER">$URL_PATTERN</ph> is a content setting pattern. <ph name="FILTER_PLACEHOLDER">$FILTER</ph> restricts the client certificates the browser automatically selects from. Independent of the filter, only certificates that match the server's certificate request are selected. On Android, Chrome can only select client certificates that it has provisioned itself; it cannot access certificates installed at the operating system level.
|
||||
Setting the policy lets you make a list of URL patterns that specify sites for which Chrome can automatically select a client certificate. The value is an array of stringified JSON dictionaries, each with the form <ph name="AUTO_SELECT_CERTIFICATE_FOR_URLS_EXAMPLE">{ "pattern": "$URL_PATTERN", "filter" : $FILTER }</ph>, where <ph name="URL_PATTERN_PLACEHOLDER">$URL_PATTERN</ph> is a content setting pattern. <ph name="FILTER_PLACEHOLDER">$FILTER</ph> restricts the client certificates the browser automatically selects from. Independent of the filter, only certificates that match the server's certificate request are selected. On Android and iOS, Chrome can only select client certificates that it has provisioned itself; it cannot access certificates installed at the operating system level.
|
||||
|
||||
Examples for the usage of the <ph name="FILTER_PLACEHOLDER">$FILTER</ph> section:
|
||||
|
||||
@@ -24,9 +24,9 @@ example_value:
|
||||
features:
|
||||
dynamic_refresh: true
|
||||
per_profile: true
|
||||
uses_machine_and_user_values: true
|
||||
future_on:
|
||||
- fuchsia
|
||||
- ios
|
||||
owners:
|
||||
- chromeos-commercial-networking-team@google.com
|
||||
- miersh@google.com
|
||||
@@ -38,6 +38,7 @@ supported_on:
|
||||
- chrome.*:15-
|
||||
- chrome_os:15-
|
||||
- android:143-
|
||||
- ios:147-
|
||||
tags:
|
||||
- website-sharing
|
||||
type: list
|
||||
|
||||
+2
@@ -40,5 +40,7 @@ schema:
|
||||
supported_on:
|
||||
- chrome.*:137-
|
||||
- chrome_os:137-
|
||||
- android:148-
|
||||
- ios:148-
|
||||
tags: []
|
||||
type: int-enum
|
||||
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
caption: Settings for Chrome Finds
|
||||
|
||||
desc: |-
|
||||
Chrome Finds is an AI-based feature that helps users search for and understand content on the current web page.
|
||||
|
||||
0 = Allow the feature to be used, while allowing Google to use relevant data to improve its AI models. Relevant data may include prompts, inputs, outputs, source materials, and written feedback, depending on the feature. It may also be reviewed by humans to improve AI models. 0 is the default value, except when noted below.
|
||||
|
||||
1 = Allow the feature to be used, but does not allow Google to improve models using users' content (including prompts, inputs, outputs, source materials, and written feedback). 1 is the default value for Enterprise users managed by <ph name="GOOGLE_ADMIN_CONSOLE_PRODUCT_NAME">Google Admin console</ph> and for Education accounts managed by <ph name="GOOGLE_WORKSPACE_PRODUCT_NAME">Google Workspace</ph>.
|
||||
|
||||
2 = Do not allow the feature.
|
||||
|
||||
If the policy is unset, its behavior is determined by the <ph name="GEN_AI_DEFAULT_SETTINGS_POLICY_NAME">GenAiDefaultSettings</ph> policy.
|
||||
|
||||
For more information on data handling for generative AI features, please see https://support.google.com/chrome/a?p=generative_ai_settings.
|
||||
default: 0
|
||||
example_value: 2
|
||||
features:
|
||||
dynamic_refresh: true
|
||||
per_profile: true
|
||||
items:
|
||||
- caption: Allow Chrome Finds and improve AI models.
|
||||
name: Allowed
|
||||
value: 0
|
||||
- caption: Allow Chrome Finds without improving AI models.
|
||||
name: AllowedWithoutLogging
|
||||
value: 1
|
||||
- caption: Do not allow Chrome Finds.
|
||||
name: Disabled
|
||||
value: 2
|
||||
owners:
|
||||
- file://chrome/browser/finds/OWNERS
|
||||
schema:
|
||||
enum:
|
||||
- 0
|
||||
- 1
|
||||
- 2
|
||||
type: integer
|
||||
tags:
|
||||
- google-sharing
|
||||
supported_on:
|
||||
- android:148-
|
||||
type: int-enum
|
||||
+1
@@ -16,6 +16,7 @@ features:
|
||||
dynamic_refresh: false
|
||||
per_profile: true
|
||||
user_only: true
|
||||
uses_machine_and_user_values: true
|
||||
items:
|
||||
- caption: No preference.
|
||||
name: NoPreference
|
||||
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
caption: Set <ph name="PRODUCT_FRAME_NAME">$3<ex>Google Chrome Frame</ex></ph> user
|
||||
data directory
|
||||
deprecated: true
|
||||
desc: |-
|
||||
Configures the directory that <ph name="PRODUCT_FRAME_NAME">$3<ex>Google Chrome Frame</ex></ph> will use for storing user data.
|
||||
|
||||
If you set this policy, <ph name="PRODUCT_FRAME_NAME">$3<ex>Google Chrome Frame</ex></ph> will use the provided directory.
|
||||
|
||||
See https://support.google.com/chrome/a?p=Supported_directory_variables for a list of variables that can be used.
|
||||
|
||||
If this setting is left not set the default profile directory will be used.
|
||||
example_value: ${user_home}/Chrome Frame
|
||||
features:
|
||||
dynamic_refresh: false
|
||||
label: Set user data directory
|
||||
owners:
|
||||
- grt@chromium.org
|
||||
schema:
|
||||
type: string
|
||||
supported_on:
|
||||
- chrome_frame:12-32
|
||||
tags: []
|
||||
type: string
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
caption: Enable Krisp noise cancellation
|
||||
desc: |-
|
||||
This policy controls the Krisp AI noise cancellation technology on the device.
|
||||
It is integrated as a separate local third-party library into <ph name="PRODUCT_OS_NAME">$2<ex>Google ChromeOS</ex></ph> and is available only for managed users.
|
||||
|
||||
Setting the policy to Enabled turns on Krisp AI noise cancellation audio processing and prevents users from disabling it.
|
||||
|
||||
Setting the policy to Disabled or not setting the policy turns off Krisp AI noise cancellation audio processing.
|
||||
default: false
|
||||
example_value: true
|
||||
features:
|
||||
dynamic_refresh: false
|
||||
per_profile: false
|
||||
items:
|
||||
- caption: Enable Krisp noise cancellation
|
||||
value: true
|
||||
- caption: Disable Krisp noise cancellation
|
||||
value: false
|
||||
owners:
|
||||
- file://services/audio/OWNERS
|
||||
- poromov@chromium.org
|
||||
schema:
|
||||
type: boolean
|
||||
future_on:
|
||||
- chrome_os
|
||||
tags: []
|
||||
type: main
|
||||
+21
-6
@@ -1,22 +1,37 @@
|
||||
caption: Maximal number of concurrent connections to the proxy server
|
||||
caption: Maximal number of concurrent connections per proxy server for non-WebSocket requests
|
||||
default: 32
|
||||
desc: |-
|
||||
Setting the policy specifies the maximal number of simultaneous connections to the proxy server. Some proxy servers can't handle a high number of concurrent connections per client, which is solved by setting this policy to a lower value. The value should be lower than 100 and higher than 6. Some web apps are known to consume many connections with hanging GETs, so setting a value below 32 may lead to browser networking hangs if there are too many web apps with hanging connections open. Lower below the default at your own risk.
|
||||
Setting the policy specifies the maximal number of simultaneous connections per proxy server for non-WebSocket requests.
|
||||
|
||||
Leaving the policy unset means a default of 32 is used.
|
||||
To modify WebSocket request limits, see <ph name="MAX_CONNECTIONS_PER_PROXY_FOR_WEBSOCKET_POLICY_NAME">MaxConnectionsPerProxyForWebSocket</ph>.
|
||||
|
||||
Leaving the policy unset means a default of 32 is used.
|
||||
|
||||
Some web apps are known to consume many connections with hanging GETs, so setting a value below 32 may lead to browser networking hangs if there are too many web apps with hanging connections open.
|
||||
Some proxy servers can't handle a high number of concurrent connections per client, which is solved by setting this policy to a lower value.
|
||||
|
||||
The value should be equal to or higher than 6.
|
||||
Setting a value below that limit will cause 6 to be used.
|
||||
Lower below the default (32) at your own risk.
|
||||
|
||||
The value should be equal to or lower than 256 (99 in <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> 147 and earlier).
|
||||
Setting a value above that limit will cause 256 (99 in <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> 147 and earlier) to be used.
|
||||
Raise above the default (32) at your own risk.
|
||||
example_value: 32
|
||||
features:
|
||||
dynamic_refresh: false
|
||||
per_profile: false
|
||||
future_on:
|
||||
- chrome_os
|
||||
- fuchsia
|
||||
owners:
|
||||
- file://components/policy/OWNERS
|
||||
- pastarmovj@chromium.org
|
||||
- arichiv@chromium.org
|
||||
schema:
|
||||
maximum: 256
|
||||
minimum: 6
|
||||
type: integer
|
||||
supported_on:
|
||||
- android:148-
|
||||
- chrome.*:14-
|
||||
- chrome_os:148-
|
||||
tags: []
|
||||
type: int
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
caption: Maximal number of concurrent connections per proxy server for WebSocket requests
|
||||
default: 32
|
||||
desc: |-
|
||||
Setting the policy specifies the maximal number of simultaneous connections per proxy server for WebSocket requests.
|
||||
|
||||
To modify non-WebSocket request limits, see <ph name="MAX_CONNECTIONS_PER_PROXY_POLICY_NAME">MaxConnectionsPerProxy</ph>.
|
||||
|
||||
Leaving the policy unset means a default of 32 is used.
|
||||
|
||||
Some web apps are known to consume many connections with hanging GETs, so setting a value below 32 may lead to browser networking hangs if there are too many web apps with hanging connections open.
|
||||
Some proxy servers can't handle a high number of concurrent connections per client, which is solved by setting this policy to a lower value.
|
||||
|
||||
The value should be equal to or higher than 6.
|
||||
Setting a value below that limit will cause 6 to be used.
|
||||
Lower below the default (32) at your own risk.
|
||||
|
||||
The value should be equal to or lower than 256.
|
||||
Setting a value above that limit will cause 256 to be used.
|
||||
Raise above the default (32) at your own risk.
|
||||
example_value: 32
|
||||
features:
|
||||
dynamic_refresh: false
|
||||
per_profile: false
|
||||
owners:
|
||||
- file://components/policy/OWNERS
|
||||
- arichiv@chromium.org
|
||||
schema:
|
||||
maximum: 256
|
||||
minimum: 6
|
||||
type: integer
|
||||
supported_on:
|
||||
- android:148-
|
||||
- chrome.*:148-
|
||||
- chrome_os:148-
|
||||
tags: []
|
||||
type: int
|
||||
+1
@@ -155,6 +155,7 @@ schema:
|
||||
future_on:
|
||||
- fuchsia
|
||||
- android
|
||||
- ios
|
||||
supported_on:
|
||||
- chrome.*:84-
|
||||
- chrome_os:84-
|
||||
|
||||
+1
-2
@@ -11,8 +11,7 @@ desc: |-
|
||||
supported_on:
|
||||
- chrome.*:136-
|
||||
- android:143-
|
||||
future_on:
|
||||
- ios
|
||||
- ios:147-
|
||||
features:
|
||||
dynamic_refresh: true
|
||||
per_profile: false
|
||||
|
||||
+1
-2
@@ -12,8 +12,7 @@ supported_on:
|
||||
- chrome.mac:126-
|
||||
- chrome.linux:128-
|
||||
- android:143-
|
||||
future_on:
|
||||
- ios
|
||||
- ios:147-
|
||||
features:
|
||||
dynamic_refresh: true
|
||||
per_profile: true
|
||||
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
caption: Enable extended lifetime for SharedWorkers
|
||||
desc: |-
|
||||
SharedWorkers can have an extended lifetime if the "extendedLifetime" option is set to true in the SharedWorker constructor.
|
||||
|
||||
If this policy is set to Enabled or left unset, SharedWorkers can have an extended lifetime.
|
||||
|
||||
If this policy is set to Disabled, SharedWorkers cannot have an extended lifetime, even if the option is set to true.
|
||||
|
||||
This policy is intended to be temporary and will be removed in the future.
|
||||
default: true
|
||||
example_value: true
|
||||
features:
|
||||
dynamic_refresh: false
|
||||
per_profile: true
|
||||
items:
|
||||
- caption: SharedWorkers can have an extended lifetime.
|
||||
value: true
|
||||
- caption: SharedWorkers cannot have an extended lifetime.
|
||||
value: false
|
||||
owners:
|
||||
- yyanagisawa@chromium.org
|
||||
- file://content/browser/worker_host/OWNERS
|
||||
schema:
|
||||
type: boolean
|
||||
supported_on:
|
||||
- android:148-
|
||||
- chrome.*:148-
|
||||
- chrome_os:148-
|
||||
- fuchsia:148-
|
||||
tags: []
|
||||
type: main
|
||||
-17
@@ -1,17 +0,0 @@
|
||||
caption: Suppress the <ph name="PRODUCT_FRAME_NAME">$3<ex>Google Chrome Frame</ex></ph>
|
||||
turndown prompt
|
||||
deprecated: true
|
||||
desc: Suppresses the turndown prompt that appears when a site is rendered by <ph name="PRODUCT_FRAME_NAME">$3<ex>Google
|
||||
Chrome Frame</ex></ph>.
|
||||
example_value: true
|
||||
features:
|
||||
dynamic_refresh: false
|
||||
owners:
|
||||
- file://components/policy/OWNERS
|
||||
- rsorokin@chromium.org
|
||||
schema:
|
||||
type: boolean
|
||||
supported_on:
|
||||
- chrome_frame:29-32
|
||||
tags: []
|
||||
type: main
|
||||
+1
@@ -32,5 +32,6 @@ supported_on:
|
||||
- android:119-136
|
||||
- chrome.*:119-136
|
||||
- chrome_os:119-136
|
||||
deprecated: true
|
||||
tags: []
|
||||
type: main
|
||||
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
caption: Allow automatic sign-in to Microsoft® cloud identity providers on <ph name="ANDROID_NAME">Android</ph>
|
||||
default: 0
|
||||
desc: |-
|
||||
Configures automatic user sign-in for accounts backed by a Microsoft® cloud identity provider on <ph name="ANDROID_NAME">Android</ph>.
|
||||
|
||||
By setting this policy to 1 (<ph name="POLICY_VALUE_ENABLED">Enabled</ph>), users who have signed into a Microsoft® productivity application on their device can be automatically signed into Microsoft® web properties within <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>. This functionality requires the presence of a Microsoft® authentication broker app, such as <ph name="MS_AUTH_APP_NAME">Microsoft® Authenticator®</ph>, <ph name="MS_ICP_NAME">Microsoft® Intune Company Portal®</ph>, or <ph name="MS_LTW_NAME">Microsoft® Link to Windows®</ph>. To facilitate the single sign-on, necessary authentication data is shared with the Microsoft® cloud identity provider.
|
||||
|
||||
By setting this policy to 0 (<ph name="POLICY_VALUE_DISABLED">Disabled</ph>) or leaving it unset, automatic sign-in as described above is disabled, and users must manually provide credentials for Microsoft® web properties.
|
||||
|
||||
Note: This policy does not apply to Incognito or Guest modes.
|
||||
|
||||
example_value: 1
|
||||
features:
|
||||
dynamic_refresh: true
|
||||
per_profile: false
|
||||
future_on:
|
||||
- android
|
||||
items:
|
||||
- caption: Disable Microsoft® cloud authentication
|
||||
name: Disabled
|
||||
value: 0
|
||||
- caption: Enable Microsoft® cloud authentication
|
||||
name: Enabled
|
||||
value: 1
|
||||
owners:
|
||||
- ssolarewicz@google.com
|
||||
- file://chrome/browser/enterprise/OWNERS
|
||||
schema:
|
||||
enum:
|
||||
- 0
|
||||
- 1
|
||||
type: integer
|
||||
tags: []
|
||||
type: int-enum
|
||||
@@ -128,8 +128,6 @@
|
||||
#include "content/browser/screen_orientation/screen_orientation_provider.h"
|
||||
#include "content/browser/shared_storage/shared_storage_budget_charger.h"
|
||||
#include "content/browser/site_instance_impl.h"
|
||||
#include "content/browser/tpcd_heuristics/opener_heuristic_tab_helper.h"
|
||||
#include "content/browser/tpcd_heuristics/redirect_heuristic_tab_helper.h"
|
||||
#include "content/browser/wake_lock/wake_lock_context_host.h"
|
||||
#include "content/browser/web_contents/file_chooser_impl.h"
|
||||
#include "content/browser/web_contents/java_script_dialog_commit_deferring_condition.h"
|
||||
@@ -199,6 +197,7 @@
|
||||
#include "third_party/blink/public/common/features.h"
|
||||
#include "third_party/blink/public/common/loader/resource_type_util.h"
|
||||
#include "third_party/blink/public/common/mime_util/mime_util.h"
|
||||
#include "third_party/blink/public/common/page/content_to_visible_time_request.h"
|
||||
#include "third_party/blink/public/common/page/page_zoom.h"
|
||||
#include "third_party/blink/public/common/page_state/page_state.h"
|
||||
#include "third_party/blink/public/common/permissions/permission_utils.h"
|
||||
@@ -280,6 +279,10 @@
|
||||
#include "content/browser/ios/nfc_host.h"
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(ENABLE_SURFACE_EMBED)
|
||||
#include "content/browser/surface_embed/surface_embed_connector_impl.h"
|
||||
#endif // BUILDFLAG(ENABLE_SURFACE_EMBED)
|
||||
|
||||
namespace content {
|
||||
|
||||
namespace {
|
||||
@@ -437,9 +440,9 @@ void RecordMaxFrameCountUMA(size_t max_frame_count) {
|
||||
// WebContents::GetFirstWebContentsInLiveOriginalOpenerChain() and
|
||||
// WebContents::GetOuterWebContents(). The |web_contents| parameter will be
|
||||
// included in the returned set.
|
||||
base::flat_set<WebContentsImpl*> GetAllOpeningWebContents(
|
||||
base::flat_set<raw_ptr<WebContentsImpl>> GetAllOpeningWebContents(
|
||||
WebContentsImpl* web_contents) {
|
||||
base::flat_set<WebContentsImpl*> result;
|
||||
base::flat_set<raw_ptr<WebContentsImpl>> result;
|
||||
base::flat_set<WebContentsImpl*> current;
|
||||
|
||||
current.insert(web_contents);
|
||||
@@ -1420,6 +1423,12 @@ WebContentsImpl::~WebContentsImpl() {
|
||||
GetOuterWebContents()->DetachUnownedInnerWebContents(this);
|
||||
}
|
||||
|
||||
#if BUILDFLAG(ENABLE_SURFACE_EMBED)
|
||||
if (surface_embed_connector_) {
|
||||
ClearSurfaceEmbedConnector();
|
||||
}
|
||||
#endif // BUILDFLAG(ENABLE_SURFACE_EMBED)
|
||||
|
||||
if (pointer_lock_widget_) {
|
||||
pointer_lock_widget_->RejectPointerLockOrUnlockIfNecessary(
|
||||
blink::mojom::PointerLockResult::kElementDestroyed);
|
||||
@@ -1585,10 +1594,10 @@ std::unique_ptr<WebContentsImpl> WebContentsImpl::CreateWithOpener(
|
||||
}
|
||||
|
||||
// static
|
||||
std::vector<WebContentsImpl*> WebContentsImpl::GetAllWebContents() {
|
||||
std::vector<raw_ptr<WebContentsImpl>> WebContentsImpl::GetAllWebContents() {
|
||||
OPTIONAL_TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("content.verbose"),
|
||||
"WebContentsImpl::GetAllWebContents");
|
||||
std::vector<WebContentsImpl*> result;
|
||||
std::vector<raw_ptr<WebContentsImpl>> result;
|
||||
std::unique_ptr<RenderWidgetHostIterator> widgets(
|
||||
RenderWidgetHostImpl::GetRenderWidgetHosts());
|
||||
while (RenderWidgetHost* rwh = widgets->GetNextHost()) {
|
||||
@@ -3020,8 +3029,7 @@ base::TimeTicks WebContentsImpl::GetLastInteractionTimeTicks() {
|
||||
}
|
||||
|
||||
WebContents::ScopedIgnoreInputEvents WebContentsImpl::IgnoreInputEvents(
|
||||
std::optional<WebInputEventAuditCallback> audit_callback,
|
||||
bool should_ignore_a11y_input) {
|
||||
std::optional<WebInputEventAuditCallback> audit_callback) {
|
||||
OPTIONAL_TRACE_EVENT0("content", "WebContentsImpl::IgnoreInputEvents");
|
||||
|
||||
uint64_t callback_id = 0;
|
||||
@@ -3044,14 +3052,11 @@ WebContents::ScopedIgnoreInputEvents WebContentsImpl::IgnoreInputEvents(
|
||||
}
|
||||
#endif
|
||||
++ignore_input_events_count_;
|
||||
if (should_ignore_a11y_input) {
|
||||
++ignore_a11y_input_count_;
|
||||
}
|
||||
}
|
||||
|
||||
// Bind weakly, since the token might outlive us.
|
||||
return ScopedIgnoreInputEvents(base::BindOnce(
|
||||
[](base::WeakPtr<WebContentsImpl> wc, bool should_ignore_a11y_input,
|
||||
[](base::WeakPtr<WebContentsImpl> wc,
|
||||
std::optional<uint64_t> callback_id) {
|
||||
if (wc) {
|
||||
OPTIONAL_TRACE_EVENT0("content",
|
||||
@@ -3078,13 +3083,10 @@ WebContents::ScopedIgnoreInputEvents WebContentsImpl::IgnoreInputEvents(
|
||||
}
|
||||
#endif
|
||||
--wc->ignore_input_events_count_;
|
||||
if (should_ignore_a11y_input) {
|
||||
--wc->ignore_a11y_input_count_;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
weak_factory_.GetWeakPtr(), should_ignore_a11y_input,
|
||||
weak_factory_.GetWeakPtr(),
|
||||
audit_callback.has_value() ? std::make_optional<uint64_t>(callback_id)
|
||||
: std::nullopt));
|
||||
}
|
||||
@@ -3093,10 +3095,6 @@ bool WebContentsImpl::ShouldIgnoreInputEventsForTesting() {
|
||||
return ShouldIgnoreInputEvents();
|
||||
}
|
||||
|
||||
bool WebContentsImpl::ShouldIgnoreA11yInputEventsForTesting() {
|
||||
return ShouldIgnoreA11yInputEvents();
|
||||
}
|
||||
|
||||
bool WebContentsImpl::HasActiveEffectivelyFullscreenVideo() {
|
||||
return IsFullscreen() &&
|
||||
media_web_contents_observer_->HasActiveEffectivelyFullscreenVideo();
|
||||
@@ -3317,7 +3315,7 @@ void WebContentsImpl::AttachInnerWebContentsImpl(
|
||||
// RWHV?
|
||||
if (RenderWidgetHostViewBase* prev_rwhv =
|
||||
static_cast<RenderWidgetHostViewBase*>(rfh->GetView())) {
|
||||
if (prev_rwhv && !prev_rwhv->IsRenderWidgetHostViewChildFrame()) {
|
||||
if (!prev_rwhv->IsRenderWidgetHostViewChildFrame()) {
|
||||
prev_rwhv->Destroy();
|
||||
}
|
||||
}
|
||||
@@ -3465,6 +3463,114 @@ void WebContentsImpl::DetachUnownedInnerWebContents(
|
||||
inner_main_frame->UpdateAXTreeData();
|
||||
}
|
||||
|
||||
#if BUILDFLAG(ENABLE_SURFACE_EMBED)
|
||||
SurfaceEmbedConnector* WebContentsImpl::GetSurfaceEmbedConnector() const {
|
||||
return surface_embed_connector_.get();
|
||||
}
|
||||
|
||||
void WebContentsImpl::SetSurfaceEmbedConnector(
|
||||
std::unique_ptr<SurfaceEmbedConnectorImpl> connector) {
|
||||
CHECK(connector);
|
||||
// Can't attach an inner WebContents into SurfaceEmbed.
|
||||
CHECK(!node_.outer_web_contents());
|
||||
|
||||
// Replace view with a WebContentsViewChildFrame view for the WebContents
|
||||
// being embedded. The WebContentsViewChildFrame will connect visual to the
|
||||
// embedder using SurfaceEmbedConnector from the provided `this` WebContents
|
||||
// object.
|
||||
view_ = std::make_unique<WebContentsViewChildFrame>(
|
||||
this, GetContentClient()->browser()->GetWebContentsViewDelegate(this),
|
||||
&render_view_host_delegate_view_);
|
||||
|
||||
// On platforms where destroying the WebContents' view does not also destroy
|
||||
// the platform RenderWidgetHostView, we need to destroy it if it exists.
|
||||
// TODO(mcnee): Should all platforms' WebContentsView destroy the platform
|
||||
// RWHV?
|
||||
// Do this for all outermost main frames including speculative render frame
|
||||
// host and the ones in prerender and BFCache.
|
||||
for (auto* rfh : GetOutermostMainFramesForViewChange()) {
|
||||
if (RenderWidgetHostViewBase* prev_rwhv =
|
||||
static_cast<RenderWidgetHostViewBase*>(rfh->GetView())) {
|
||||
if (!prev_rwhv->IsRenderWidgetHostViewChildFrame()) {
|
||||
prev_rwhv->Destroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Must unregister before setting the connector as that will change the
|
||||
// TextInputManager and InputEventRouter for this WebContents. Without doing
|
||||
// this, child frames' RWHVs would fail to unregister from the previous
|
||||
// TextInputManager and InputEventRouter.
|
||||
RecursivelyUnregisterRenderWidgetHostViews();
|
||||
|
||||
// The new connector must be set before creating RWHVs as they need to get the
|
||||
// new TextInputManager and InputEventRouter.
|
||||
surface_embed_connector_ = std::move(connector);
|
||||
|
||||
// Recreate views for all outermost main frames impacted by the WebContents
|
||||
// `view_` change, including speculative render frame host and the ones in
|
||||
// prerender and BFCache.
|
||||
for (auto* rfh : GetOutermostMainFramesForViewChange()) {
|
||||
auto* render_manager = rfh->frame_tree_node()->render_manager();
|
||||
RenderViewHostImpl* rvh = rfh->render_view_host();
|
||||
render_manager->InitRenderView(rfh->GetSiteInstance()->group(), rvh,
|
||||
/*proxy=*/nullptr,
|
||||
/*navigation_metrics_token=*/std::nullopt);
|
||||
if (!rfh->GetView()) {
|
||||
CreateRenderWidgetHostViewForRenderManager(rvh);
|
||||
}
|
||||
}
|
||||
|
||||
RecursivelyRegisterRenderWidgetHostViews();
|
||||
}
|
||||
|
||||
void WebContentsImpl::ClearSurfaceEmbedConnector() {
|
||||
CHECK(surface_embed_connector_);
|
||||
|
||||
// RenderWidgetHostView of main frames that are of type
|
||||
// RenderWidgetHostViewChildFrame should be re-created with appropriate
|
||||
// platform views.
|
||||
// Do this for all outermost main frames including speculative render frame
|
||||
// host and the ones in prerender and BFCache.
|
||||
std::vector<RenderViewHostImpl*> list_of_rvh_with_rwhv;
|
||||
for (auto* rfh : GetOutermostMainFramesForViewChange()) {
|
||||
auto* rvh = rfh->render_view_host();
|
||||
if (rvh->GetWidget() && rvh->GetWidget()->GetView()) {
|
||||
if (rvh->GetWidget()->GetView()->IsRenderWidgetHostViewChildFrame()) {
|
||||
list_of_rvh_with_rwhv.push_back(rvh);
|
||||
}
|
||||
rvh->GetWidget()->GetView()->Destroy();
|
||||
}
|
||||
}
|
||||
|
||||
if (!IsBeingDestroyed()) {
|
||||
render_view_host_delegate_view_ = nullptr;
|
||||
view_ = nullptr;
|
||||
}
|
||||
|
||||
// Because there may be child frames, we need to unregister all RWHVs before
|
||||
// clearing the connector, which will change the TextInputManager and
|
||||
// InputEventRouter for this WebContents.
|
||||
RecursivelyUnregisterRenderWidgetHostViews();
|
||||
|
||||
surface_embed_connector_.reset();
|
||||
|
||||
// Recreate and register RenderWidgetHostView.
|
||||
if (!IsBeingDestroyed()) {
|
||||
// Recreate WebContentsView.
|
||||
view_ = CreateWebContentsView(
|
||||
this, GetContentClient()->browser()->GetWebContentsViewDelegate(this),
|
||||
&render_view_host_delegate_view_);
|
||||
view_->CreateView(gfx::NativeView());
|
||||
|
||||
for (RenderViewHostImpl* rvh : list_of_rvh_with_rwhv) {
|
||||
CreateRenderWidgetHostViewForRenderManager(rvh);
|
||||
}
|
||||
RecursivelyRegisterRenderWidgetHostViews();
|
||||
}
|
||||
}
|
||||
#endif // BUILDFLAG(ENABLE_SURFACE_EMBED)
|
||||
|
||||
void WebContentsImpl::AttachGuestPage(
|
||||
std::unique_ptr<GuestPageHolder> guest_page,
|
||||
RenderFrameHost* outer_render_frame_host) {
|
||||
@@ -3709,6 +3815,11 @@ const blink::web_pref::WebPreferences WebContentsImpl::ComputeWebPreferences(
|
||||
prefs.dont_send_key_events_to_javascript =
|
||||
base::FeatureList::IsEnabled(features::kDontSendKeyEventsToJavascript);
|
||||
|
||||
prefs.ignore_duplicate_nav_enabled =
|
||||
base::FeatureList::IsEnabled(features::kIgnoreDuplicateNavs);
|
||||
|
||||
prefs.duplicate_nav_threshold = features::kDuplicateNavThreshold.Get();
|
||||
|
||||
// TODO(dtapuska): Enable barrel button selection drag support on Android.
|
||||
// crbug.com/758042
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
@@ -4232,8 +4343,6 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
SchedulerLoopQuarantineWebContentsObserver::MaybeCreateForWebContents(this);
|
||||
RedirectChainDetector::CreateForWebContents(this);
|
||||
BtmWebContentsObserver::MaybeCreateForWebContents(this);
|
||||
RedirectHeuristicTabHelper::CreateForWebContents(this);
|
||||
OpenerHeuristicTabHelper::CreateForWebContents(this);
|
||||
|
||||
// BrowserPluginGuest::Init needs to be called after this WebContents has
|
||||
// a RenderWidgetHostViewChildFrame. That is, |view_->CreateView| above.
|
||||
@@ -4579,9 +4688,6 @@ bool WebContentsImpl::PreHandleGestureEvent(
|
||||
}
|
||||
}
|
||||
|
||||
// TODO(crbug.com/475836809)
|
||||
// Remove this delegate method. It exposes Blink types to the embedder. Since
|
||||
// zoom blocking is now handled natively, we should audit remaining consumers.
|
||||
return delegate_ && delegate_->PreHandleGestureEvent(this, event);
|
||||
}
|
||||
|
||||
@@ -4592,6 +4698,12 @@ WebContentsImpl::GetInputEventRouter() {
|
||||
return GetOuterWebContents()->GetInputEventRouter();
|
||||
}
|
||||
|
||||
#if BUILDFLAG(ENABLE_SURFACE_EMBED)
|
||||
if (surface_embed_connector_) {
|
||||
return surface_embed_connector_->GetInputEventRouter();
|
||||
}
|
||||
#endif // BUILDFLAG(ENABLE_SURFACE_EMBED)
|
||||
|
||||
if (!rwh_input_event_router_.get()) {
|
||||
rwh_input_event_router_ =
|
||||
MakeRefCounted<input::RenderWidgetHostInputEventRouter>(
|
||||
@@ -4664,7 +4776,7 @@ bool WebContentsImpl::CanEnterFullscreenMode(
|
||||
// WebContents has an active blocker.
|
||||
return delegate_ &&
|
||||
std::ranges::all_of(GetAllOpeningWebContents(this),
|
||||
[](auto* opener) {
|
||||
[](auto opener) {
|
||||
return opener->fullscreen_blocker_count_ == 0;
|
||||
}) &&
|
||||
delegate_->CanEnterFullscreenModeForTab(requesting_frame);
|
||||
@@ -4676,7 +4788,10 @@ void WebContentsImpl::EnterFullscreenMode(
|
||||
OPTIONAL_TRACE_EVENT0("content", "WebContentsImpl::EnterFullscreenMode");
|
||||
DCHECK(CanEnterFullscreenMode(requesting_frame));
|
||||
DCHECK(requesting_frame->IsActive());
|
||||
DCHECK(ContainsOrIsFocusedWebContents());
|
||||
CHECK(
|
||||
ContainsOrIsFocusedWebContents() ||
|
||||
GetContentClient()->browser()->IsFullscreenAllowedForUnfocusedWebContents(
|
||||
this));
|
||||
// Ensure the window is made active to take input focus. The window may be
|
||||
// inactive when sites request fullscreen via capability delegation, consume
|
||||
// transient activation from a gesture made before another window was focused,
|
||||
@@ -4691,7 +4806,13 @@ void WebContentsImpl::EnterFullscreenMode(
|
||||
}
|
||||
|
||||
if (delegate_) {
|
||||
// This may spin the message loop and destroy this object.
|
||||
// See crbug.com/1506535, crbug.com/498752242.
|
||||
base::WeakPtr<WebContents> weak_ptr = GetWeakPtr();
|
||||
delegate_->EnterFullscreenModeForTab(requesting_frame, options);
|
||||
if (!weak_ptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (keyboard_lock_widget_) {
|
||||
delegate_->RequestKeyboardLock(this, esc_key_locked_);
|
||||
@@ -4719,8 +4840,9 @@ void WebContentsImpl::ExitFullscreenMode(bool will_cause_resize) {
|
||||
base::TimeTicks::Now());
|
||||
|
||||
if (delegate_) {
|
||||
// This may spin the message loop and destroy this object crbug.com/1506535
|
||||
base::WeakPtr<WebContentsImpl> weak_ptr = weak_factory_.GetWeakPtr();
|
||||
// This may spin the message loop and destroy this object.
|
||||
// See crbug.com/1506535, crbug.com/498752242.
|
||||
base::WeakPtr<WebContents> weak_ptr = GetWeakPtr();
|
||||
delegate_->ExitFullscreenModeForTab(this);
|
||||
if (!weak_ptr) {
|
||||
return;
|
||||
@@ -5527,7 +5649,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
std::make_unique<NavigationController::LoadURLParams>(
|
||||
params.target_url);
|
||||
load_params->initiator_origin = opener->GetLastCommittedOrigin();
|
||||
load_params->initiator_process_id = opener->GetProcess()->GetDeprecatedID();
|
||||
load_params->initiator_process_id = render_process_id;
|
||||
load_params->initiator_frame_token = opener->GetFrameToken();
|
||||
// Avoiding setting |load_params->source_site_instance| when
|
||||
// |opener_suppressed| is true, because in that case we do not want to use
|
||||
@@ -5885,14 +6007,22 @@ void WebContentsImpl::RequestMediaAccessPermission(
|
||||
delegate->GuestRequestMediaAccessPermission(request, std::move(callback));
|
||||
return;
|
||||
}
|
||||
} else if (delegate_) {
|
||||
std::move(callback).Run(
|
||||
blink::mojom::StreamDevicesSet(),
|
||||
blink::mojom::MediaStreamRequestResult::
|
||||
FAILED_DUE_TO_SHUTDOWN_NO_GUEST_PAGE_HOLDER_DELEGATE,
|
||||
std::unique_ptr<MediaStreamUI>());
|
||||
return;
|
||||
}
|
||||
|
||||
if (delegate_) {
|
||||
delegate_->RequestMediaAccessPermission(this, request, std::move(callback));
|
||||
return;
|
||||
}
|
||||
std::move(callback).Run(
|
||||
blink::mojom::StreamDevicesSet(),
|
||||
blink::mojom::MediaStreamRequestResult::FAILED_DUE_TO_SHUTDOWN,
|
||||
std::unique_ptr<MediaStreamUI>());
|
||||
std::move(callback).Run(blink::mojom::StreamDevicesSet(),
|
||||
blink::mojom::MediaStreamRequestResult::
|
||||
FAILED_DUE_TO_SHUTDOWN_WEB_CONTENTS_NO_DELEGATE,
|
||||
std::unique_ptr<MediaStreamUI>());
|
||||
}
|
||||
|
||||
void WebContentsImpl::ProcessSelectAudioOutput(
|
||||
@@ -6195,6 +6325,12 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
|
||||
return GetOuterWebContents()->GetTextInputManager();
|
||||
}
|
||||
|
||||
#if BUILDFLAG(ENABLE_SURFACE_EMBED)
|
||||
if (surface_embed_connector_) {
|
||||
return surface_embed_connector_->GetTextInputManager();
|
||||
}
|
||||
#endif // BUILDFLAG(ENABLE_SURFACE_EMBED)
|
||||
|
||||
if (!text_input_manager_ && !browser_plugin_guest_) {
|
||||
text_input_manager_ = std::make_unique<TextInputManager>();
|
||||
}
|
||||
@@ -6303,6 +6439,29 @@ void WebContentsImpl::AdjustSelectionByCharacterOffset(
|
||||
: SelectionMenuBehavior::kHide);
|
||||
}
|
||||
|
||||
const std::optional<gfx::Rect> WebContentsImpl::GetTextSelectionBounds(
|
||||
RenderFrameHost* render_frame_host) const {
|
||||
if (text_input_manager_ && render_frame_host) {
|
||||
auto* view =
|
||||
static_cast<RenderWidgetHostViewBase*>(render_frame_host->GetView());
|
||||
auto* root_view = static_cast<RenderWidgetHostViewBase*>(
|
||||
render_frame_host->GetOutermostMainFrame()->GetView());
|
||||
if (view && root_view) {
|
||||
const auto* region = text_input_manager_->GetSelectionRegion(view);
|
||||
if (region) {
|
||||
gfx::Rect bounds =
|
||||
gfx::RectBetweenSelectionBounds(region->anchor, region->focus);
|
||||
if (!bounds.IsEmpty()) {
|
||||
gfx::Point origin = bounds.origin();
|
||||
origin += root_view->GetViewBounds().OffsetFromOrigin();
|
||||
return gfx::Rect(origin, bounds.size());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
void WebContentsImpl::ResizeDueToAutoResize(
|
||||
RenderWidgetHostImpl* render_widget_host,
|
||||
const gfx::Size& new_size) {
|
||||
@@ -7251,10 +7410,20 @@ base::ScopedClosureRunner WebContentsImpl::ForSecurityDropFullscreen(
|
||||
// upstream contents. Drop that WebContents out of fullscreen if it does. This
|
||||
// is theoretically quadratic-ish (fullscreen contentses x each one's opener
|
||||
// length) but neither of those is expected to ever be a large number.
|
||||
auto fullscreen_set_copy = *FullscreenContentsSet(GetBrowserContext());
|
||||
for (WebContentsImpl* fullscreen_contents : fullscreen_set_copy) {
|
||||
if (is_fullscreen(fullscreen_contents, display_id)) {
|
||||
auto opener_contentses = GetAllOpeningWebContents(fullscreen_contents);
|
||||
std::vector<base::WeakPtr<WebContentsImpl>> fullscreen_contents_list;
|
||||
for (WebContentsImpl* fullscreen_contents :
|
||||
*FullscreenContentsSet(GetBrowserContext())) {
|
||||
fullscreen_contents_list.push_back(
|
||||
fullscreen_contents->weak_factory_.GetWeakPtr());
|
||||
}
|
||||
|
||||
for (auto& fullscreen_contents : fullscreen_contents_list) {
|
||||
if (!fullscreen_contents) {
|
||||
continue;
|
||||
}
|
||||
if (is_fullscreen(fullscreen_contents.get(), display_id)) {
|
||||
auto opener_contentses =
|
||||
GetAllOpeningWebContents(fullscreen_contents.get());
|
||||
if (opener_contentses.count(this)) {
|
||||
fullscreen_contents->ExitFullscreen(true);
|
||||
}
|
||||
@@ -7268,29 +7437,41 @@ base::ScopedClosureRunner WebContentsImpl::ForSecurityDropFullscreen(
|
||||
// any request to enter fullscreen will have the upstream of the WebContents
|
||||
// checked. (See CanEnterFullscreenMode().)
|
||||
|
||||
std::vector<base::WeakPtr<WebContentsImpl>> blocked_contentses;
|
||||
std::vector<base::WeakPtr<WebContentsImpl>> blocked_contents_list;
|
||||
std::vector<base::WeakPtr<WebContentsImpl>> openers;
|
||||
for (WebContentsImpl* opener : GetAllOpeningWebContents(this)) {
|
||||
openers.push_back(opener->weak_factory_.GetWeakPtr());
|
||||
}
|
||||
|
||||
for (auto* opener : GetAllOpeningWebContents(this)) {
|
||||
if (is_fullscreen(opener, display_id)) {
|
||||
for (auto& opener : openers) {
|
||||
if (!opener) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (is_fullscreen(opener.get(), display_id)) {
|
||||
opener->ExitFullscreen(true);
|
||||
}
|
||||
|
||||
if (!opener) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// ...block the WebContents from entering fullscreen until further notice.
|
||||
++opener->fullscreen_blocker_count_;
|
||||
blocked_contentses.push_back(opener->weak_factory_.GetWeakPtr());
|
||||
blocked_contents_list.push_back(opener);
|
||||
}
|
||||
|
||||
return base::ScopedClosureRunner(base::BindOnce(
|
||||
[](std::vector<base::WeakPtr<WebContentsImpl>> blocked_contentses) {
|
||||
[](std::vector<base::WeakPtr<WebContentsImpl>> blocked_contents_list) {
|
||||
for (base::WeakPtr<WebContentsImpl>& web_contents :
|
||||
blocked_contentses) {
|
||||
blocked_contents_list) {
|
||||
if (web_contents) {
|
||||
DCHECK_GT(web_contents->fullscreen_blocker_count_, 0);
|
||||
--web_contents->fullscreen_blocker_count_;
|
||||
}
|
||||
}
|
||||
},
|
||||
std::move(blocked_contentses)));
|
||||
std::move(blocked_contents_list)));
|
||||
}
|
||||
|
||||
void WebContentsImpl::ResumeLoadingCreatedWebContents() {
|
||||
@@ -7784,7 +7965,13 @@ void WebContentsImpl::DidNavigateAnyFramePreCommit(
|
||||
}
|
||||
|
||||
if (should_exit_fullscreen) {
|
||||
base::WeakPtr<WebContentsImpl> weak_this = weak_factory_.GetWeakPtr();
|
||||
ExitFullscreen(false);
|
||||
|
||||
// If `this` gets destructed due to ExitFullscreen(), we need to exit early.
|
||||
if (!weak_this) {
|
||||
return;
|
||||
}
|
||||
CancelKeyboardLock(keyboard_lock_widget_);
|
||||
}
|
||||
}
|
||||
@@ -10372,16 +10559,6 @@ bool WebContentsImpl::ShouldIgnoreInputEvents() {
|
||||
return web_contents->ShouldIgnoreInputEvents();
|
||||
}
|
||||
|
||||
bool WebContentsImpl::ShouldIgnoreA11yInputEvents() {
|
||||
if (ignore_a11y_input_count_ > 0) {
|
||||
return true;
|
||||
}
|
||||
WebContentsImpl* web_contents = GetOuterWebContents();
|
||||
if (!web_contents) {
|
||||
return false;
|
||||
}
|
||||
return web_contents->ShouldIgnoreA11yInputEvents();
|
||||
}
|
||||
|
||||
void WebContentsImpl::FocusOwningWebContents(
|
||||
RenderWidgetHostImpl* render_widget_host) {
|
||||
@@ -12124,10 +12301,10 @@ void WebContentsImpl::SetV8CompileHints(base::ReadOnlySharedMemoryRegion data) {
|
||||
|
||||
void WebContentsImpl::SetTabSwitchStartTime(base::TimeTicks start_time,
|
||||
bool destination_is_loaded) {
|
||||
GetVisibleTimeRequestTrigger().UpdateRequest(
|
||||
start_time, destination_is_loaded,
|
||||
/*show_reason_tab_switching=*/true,
|
||||
/*show_reason_bfcache_restore=*/false);
|
||||
GetVisibleTimeRequestTrigger().UpdateRequest(blink::VisibleTimeEvent{
|
||||
.event_start_time = start_time,
|
||||
.reason =
|
||||
blink::VisibleTimeEvent::TabSwitchReason(destination_is_loaded)});
|
||||
}
|
||||
|
||||
bool WebContentsImpl::IsInPreviewMode() const {
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "base/base_switches.h"
|
||||
#include "base/command_line.h"
|
||||
#include "base/feature_list.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/raw_ref.h"
|
||||
#include "base/metrics/field_trial.h"
|
||||
#include "base/metrics/field_trial_params.h"
|
||||
@@ -194,8 +195,12 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
|
||||
raw_ref(features::kFedCmIdPRegistration), kDefault},
|
||||
{wf::EnableFedCmLightweightMode,
|
||||
raw_ref(features::kFedCmLightweightMode), kDefault},
|
||||
// We want to enable interception when either of these two flags is
|
||||
// enabled because interception can happen with either flag.
|
||||
{wf::EnableFedCmNavigationInterception,
|
||||
raw_ref(features::kFedCmNavigationInterception), kDefault},
|
||||
{wf::EnableFedCmNavigationInterception,
|
||||
raw_ref(features::kFedCmEmbedderInitiatedLogin), kDefault},
|
||||
{wf::EnableFedCmErrorAttribute,
|
||||
raw_ref(features::kFedCmErrorAttribute), kDefault},
|
||||
{wf::EnableFedCmNonStringToken,
|
||||
@@ -292,8 +297,6 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
|
||||
raw_ref(device::features::kWebXRIncubations)},
|
||||
#endif
|
||||
{wf::EnableXSLT, raw_ref(blink::features::kXSLT)},
|
||||
{wf::EnablePermissions, raw_ref(features::kWebPermissionsApi),
|
||||
kSetOnlyIfOverridden},
|
||||
};
|
||||
for (const auto& mapping : blinkFeatureToBaseFeatureMapping) {
|
||||
SetRuntimeFeatureFromChromiumFeature(
|
||||
@@ -621,6 +624,28 @@ void ResolveInvalidConfigurations() {
|
||||
WebRuntimeFeatures::EnableUserMediaElement(false);
|
||||
}
|
||||
|
||||
// InstallElement cannot be enabled without the support of the browser
|
||||
// process.
|
||||
if (!base::FeatureList::IsEnabled(blink::features::kInstallElement)) {
|
||||
LOG_IF(WARNING, WebRuntimeFeatures::IsInstallElementEnabledByRuntimeFlag())
|
||||
<< "InstallElement cannot be enabled in this configuration. Use --"
|
||||
<< switches::kEnableFeatures << "="
|
||||
<< blink::features::kInstallElement.name << " instead.";
|
||||
WebRuntimeFeatures::EnableInstallElement(false);
|
||||
}
|
||||
|
||||
// WebAppInstallation cannot be enabled without the support of the browser
|
||||
// process.
|
||||
if (!base::FeatureList::IsEnabled(blink::features::kWebAppInstallation)) {
|
||||
LOG_IF(WARNING,
|
||||
WebRuntimeFeatures::IsWebAppInstallationEnabledByRuntimeFlag())
|
||||
<< "WebAppInstallation cannot be enabled in this configuration. Use "
|
||||
"--"
|
||||
<< switches::kEnableFeatures << "="
|
||||
<< blink::features::kWebAppInstallation.name << " instead.";
|
||||
WebRuntimeFeatures::EnableWebAppInstallation(false);
|
||||
}
|
||||
|
||||
// CSP Hashes in V1 cannot be enabled without the support of the network
|
||||
// service.
|
||||
if (!base::FeatureList::IsEnabled(
|
||||
|
||||
@@ -499,11 +499,6 @@ bool ContentBrowserClient::ShouldTryToUpdateServiceWorkerRegistration(
|
||||
return true;
|
||||
}
|
||||
|
||||
void ContentBrowserClient::UpdateEnabledBlinkRuntimeFeaturesInIsolatedWorker(
|
||||
BrowserContext* context,
|
||||
const GURL& script_url,
|
||||
std::vector<std::string>& out_forced_enabled_runtime_features) {}
|
||||
|
||||
bool ContentBrowserClient::AllowSharedWorker(
|
||||
const GURL& worker_url,
|
||||
const net::SiteForCookies& site_for_cookies,
|
||||
@@ -547,6 +542,11 @@ bool ContentBrowserClient::AllowSharedWorkerBlobURLFix(
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ContentBrowserClient::AllowSharedWorkerExtendedLifetime(
|
||||
BrowserContext* context) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ContentBrowserClient::OverrideWebPreferencesAfterNavigation(
|
||||
WebContents* web_contents,
|
||||
SiteInstance& main_frame_site,
|
||||
@@ -613,19 +613,6 @@ bool ContentBrowserClient::AllowWorkerWebLocks(
|
||||
return true;
|
||||
}
|
||||
|
||||
ContentBrowserClient::AllowWebBluetoothResult
|
||||
ContentBrowserClient::AllowWebBluetooth(
|
||||
content::BrowserContext* browser_context,
|
||||
const url::Origin& requesting_origin,
|
||||
const url::Origin& embedding_origin) {
|
||||
DCHECK(browser_context);
|
||||
return AllowWebBluetoothResult::ALLOW;
|
||||
}
|
||||
|
||||
std::string ContentBrowserClient::GetWebBluetoothBlocklist() {
|
||||
return std::string();
|
||||
}
|
||||
|
||||
bool ContentBrowserClient::IsInterestGroupAPIAllowed(
|
||||
content::BrowserContext* browser_context,
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
@@ -706,14 +693,6 @@ bool ContentBrowserClient::IsSharedStorageSelectURLAllowed(
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ContentBrowserClient::IsFencedStorageReadAllowed(
|
||||
content::BrowserContext* browser_context,
|
||||
content::RenderFrameHost* rfh,
|
||||
const url::Origin& top_frame_origin,
|
||||
const url::Origin& accessing_origin) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ContentBrowserClient::IsPrivateAggregationAllowed(
|
||||
content::BrowserContext* browser_context,
|
||||
const url::Origin& top_frame_origin,
|
||||
@@ -749,13 +728,6 @@ bool ContentBrowserClient::IsServiceWorkerSyntheticResponseAllowed(
|
||||
return false;
|
||||
}
|
||||
|
||||
void ContentBrowserClient::GrantCookieAccessDueToHeuristic(
|
||||
content::BrowserContext* browser_context,
|
||||
const net::SchemefulSite& top_frame_site,
|
||||
const net::SchemefulSite& accessing_site,
|
||||
base::TimeDelta ttl,
|
||||
bool ignore_schemes) {}
|
||||
|
||||
bool ContentBrowserClient::AreThirdPartyCookiesGenerallyAllowed(
|
||||
content::BrowserContext* browser_context,
|
||||
content::WebContents* web_contents) {
|
||||
@@ -866,6 +838,11 @@ FeatureObserverClient* ContentBrowserClient::GetFeatureObserverClient() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool ContentBrowserClient::IsPopupBypassAllowed(
|
||||
RenderFrameHost* render_frame_host) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ContentBrowserClient::CanCreateWindow(
|
||||
RenderFrameHost* opener,
|
||||
const GURL& opener_url,
|
||||
@@ -1538,18 +1515,6 @@ int ContentBrowserClient::NumVersionsInTopicsEpochs(
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool ContentBrowserClient::IsBluetoothScanningBlocked(
|
||||
content::BrowserContext* browser_context,
|
||||
const url::Origin& requesting_origin,
|
||||
const url::Origin& embedding_origin) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void ContentBrowserClient::BlockBluetoothScanning(
|
||||
content::BrowserContext* browser_context,
|
||||
const url::Origin& requesting_origin,
|
||||
const url::Origin& embedding_origin) {}
|
||||
|
||||
void ContentBrowserClient::GetMediaDeviceIDSalt(
|
||||
content::RenderFrameHost* rfh,
|
||||
const net::SiteForCookies& site_for_cookies,
|
||||
@@ -2067,4 +2032,13 @@ bool ContentBrowserClient::OriginSupportsConcreteCrossOriginIsolation(
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ContentBrowserClient::IsAttributionInternalsWebUIEnabled() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ContentBrowserClient::IsFullscreenAllowedForUnfocusedWebContents(
|
||||
content::WebContents* unfocused_web_contents) {
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace content
|
||||
|
||||
@@ -1,492 +0,0 @@
|
||||
// Copyright 2012 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.app.window</code> API to create windows. Windows
|
||||
// have an optional frame with title bar and size controls. They are not
|
||||
// associated with any Chrome browser windows. See the <a
|
||||
// href="https://github.com/GoogleChrome/chrome-app-samples/tree/master/samples/window-state">
|
||||
// Window State Sample</a> for a demonstration of these options.
|
||||
namespace app.window {
|
||||
|
||||
// Previously named Bounds.
|
||||
dictionary ContentBounds {
|
||||
long? left;
|
||||
long? top;
|
||||
long? width;
|
||||
long? height;
|
||||
};
|
||||
|
||||
dictionary BoundsSpecification {
|
||||
// The X coordinate of the content or window.
|
||||
long? left;
|
||||
|
||||
// The Y coordinate of the content or window.
|
||||
long? top;
|
||||
|
||||
// The width of the content or window.
|
||||
long? width;
|
||||
|
||||
// The height of the content or window.
|
||||
long? height;
|
||||
|
||||
// The minimum width of the content or window.
|
||||
long? minWidth;
|
||||
|
||||
// The minimum height of the content or window.
|
||||
long? minHeight;
|
||||
|
||||
// The maximum width of the content or window.
|
||||
long? maxWidth;
|
||||
|
||||
// The maximum height of the content or window.
|
||||
long? maxHeight;
|
||||
};
|
||||
|
||||
dictionary Bounds {
|
||||
// This property can be used to read or write the current X coordinate of
|
||||
// the content or window.
|
||||
long left;
|
||||
|
||||
// This property can be used to read or write the current Y coordinate of
|
||||
// the content or window.
|
||||
long top;
|
||||
|
||||
// This property can be used to read or write the current width of the
|
||||
// content or window.
|
||||
long width;
|
||||
|
||||
// This property can be used to read or write the current height of the
|
||||
// content or window.
|
||||
long height;
|
||||
|
||||
// This property can be used to read or write the current minimum width of
|
||||
// the content or window. A value of <code>null</code> indicates
|
||||
// 'unspecified'.
|
||||
long? minWidth;
|
||||
|
||||
// This property can be used to read or write the current minimum height of
|
||||
// the content or window. A value of <code>null</code> indicates
|
||||
// 'unspecified'.
|
||||
long? minHeight;
|
||||
|
||||
// This property can be used to read or write the current maximum width of
|
||||
// the content or window. A value of <code>null</code> indicates
|
||||
// 'unspecified'.
|
||||
long? maxWidth;
|
||||
|
||||
// This property can be used to read or write the current maximum height of
|
||||
// the content or window. A value of <code>null</code> indicates
|
||||
// 'unspecified'.
|
||||
long? maxHeight;
|
||||
|
||||
// Set the left and top position of the content or window.
|
||||
static void setPosition(long left, long top);
|
||||
|
||||
// Set the width and height of the content or window.
|
||||
static void setSize(long width, long height);
|
||||
|
||||
// Set the minimum size constraints of the content or window. The minimum
|
||||
// width or height can be set to <code>null</code> to remove the constraint.
|
||||
// A value of <code>undefined</code> will leave a constraint unchanged.
|
||||
static void setMinimumSize(long minWidth, long minHeight);
|
||||
|
||||
// Set the maximum size constraints of the content or window. The maximum
|
||||
// width or height can be set to <code>null</code> to remove the constraint.
|
||||
// A value of <code>undefined</code> will leave a constraint unchanged.
|
||||
static void setMaximumSize(long maxWidth, long maxHeight);
|
||||
};
|
||||
|
||||
dictionary FrameOptions {
|
||||
// Frame type: <code>none</code> or <code>chrome</code> (defaults to
|
||||
// <code>chrome</code>).
|
||||
//
|
||||
// For <code>none</code>, the <code>-webkit-app-region</code> CSS property
|
||||
// can be used to apply draggability to the app's window.
|
||||
//
|
||||
// <code>-webkit-app-region: drag</code> can be used to mark regions
|
||||
// draggable. <code>no-drag</code> can be used to disable this style on
|
||||
// nested elements.
|
||||
DOMString? type;
|
||||
// Allows the frame color to be set. Frame coloring is only available if the
|
||||
// frame type is <code>chrome</code>.
|
||||
//
|
||||
// Frame coloring is new in Chrome 36.
|
||||
DOMString? color;
|
||||
// Allows the frame color of the window when active to be set. Frame
|
||||
// coloring is only available if the frame type is <code>chrome</code>.
|
||||
//
|
||||
// Frame coloring is only available if the frame type is
|
||||
// <code>chrome</code>.
|
||||
//
|
||||
// Frame coloring is new in Chrome 36.
|
||||
DOMString? activeColor;
|
||||
// Allows the frame color of the window when inactive to be set differently
|
||||
// to the active color. Frame
|
||||
// coloring is only available if the frame type is <code>chrome</code>.
|
||||
//
|
||||
// <code>inactiveColor</code> must be used in conjunction with <code>
|
||||
// color</code>.
|
||||
//
|
||||
// Frame coloring is new in Chrome 36.
|
||||
DOMString? inactiveColor;
|
||||
};
|
||||
|
||||
// State of a window: normal, fullscreen, maximized, minimized.
|
||||
enum State { normal, fullscreen, maximized, minimized };
|
||||
|
||||
// Specifies the type of window to create.
|
||||
enum WindowType {
|
||||
// Default window type.
|
||||
shell,
|
||||
// OS managed window (Deprecated).
|
||||
panel
|
||||
};
|
||||
|
||||
[noinline_doc] dictionary CreateWindowOptions {
|
||||
// Id to identify the window. This will be used to remember the size
|
||||
// and position of the window and restore that geometry when a window
|
||||
// with the same id is later opened.
|
||||
// If a window with a given id is created while another window with the same
|
||||
// id already exists, the currently opened window will be focused instead of
|
||||
// creating a new window.
|
||||
DOMString? id;
|
||||
|
||||
// Used to specify the initial position, initial size and constraints of the
|
||||
// window's content (excluding window decorations).
|
||||
// If an <code>id</code> is also specified and a window with a matching
|
||||
// <code>id</code> has been shown before, the remembered bounds will be used
|
||||
// instead.
|
||||
//
|
||||
// Note that the padding between the inner and outer bounds is determined by
|
||||
// the OS. Therefore setting the same bounds property for both the
|
||||
// <code>innerBounds</code> and <code>outerBounds</code> will result in an
|
||||
// error.
|
||||
//
|
||||
// This property is new in Chrome 36.
|
||||
BoundsSpecification? innerBounds;
|
||||
|
||||
// Used to specify the initial position, initial size and constraints of the
|
||||
// window (including window decorations such as the title bar and frame).
|
||||
// If an <code>id</code> is also specified and a window with a matching
|
||||
// <code>id</code> has been shown before, the remembered bounds will be used
|
||||
// instead.
|
||||
//
|
||||
// Note that the padding between the inner and outer bounds is determined by
|
||||
// the OS. Therefore setting the same bounds property for both the
|
||||
// <code>innerBounds</code> and <code>outerBounds</code> will result in an
|
||||
// error.
|
||||
//
|
||||
// This property is new in Chrome 36.
|
||||
BoundsSpecification? outerBounds;
|
||||
|
||||
// Default width of the window.
|
||||
[nodoc, deprecated="Use $(ref:BoundsSpecification)."] long? defaultWidth;
|
||||
|
||||
// Default height of the window.
|
||||
[nodoc, deprecated="Use $(ref:BoundsSpecification)."] long? defaultHeight;
|
||||
|
||||
// Default X coordinate of the window.
|
||||
[nodoc, deprecated="Use $(ref:BoundsSpecification)."] long? defaultLeft;
|
||||
|
||||
// Default Y coordinate of the window.
|
||||
[nodoc, deprecated="Use $(ref:BoundsSpecification)."] long? defaultTop;
|
||||
|
||||
// Width of the window.
|
||||
[nodoc, deprecated="Use $(ref:BoundsSpecification)."] long? width;
|
||||
|
||||
// Height of the window.
|
||||
[nodoc, deprecated="Use $(ref:BoundsSpecification)."] long? height;
|
||||
|
||||
// X coordinate of the window.
|
||||
[nodoc, deprecated="Use $(ref:BoundsSpecification)."] long? left;
|
||||
|
||||
// Y coordinate of the window.
|
||||
[nodoc, deprecated="Use $(ref:BoundsSpecification)."] long? top;
|
||||
|
||||
// Minimum width of the window.
|
||||
[deprecated="Use innerBounds or outerBounds."] long? minWidth;
|
||||
|
||||
// Minimum height of the window.
|
||||
[deprecated="Use innerBounds or outerBounds."] long? minHeight;
|
||||
|
||||
// Maximum width of the window.
|
||||
[deprecated="Use innerBounds or outerBounds."] long? maxWidth;
|
||||
|
||||
// Maximum height of the window.
|
||||
[deprecated="Use innerBounds or outerBounds."] long? maxHeight;
|
||||
|
||||
// Type of window to create.
|
||||
[deprecated="All app windows use the 'shell' window type"] WindowType? type;
|
||||
|
||||
// Creates a special ime window. This window is not focusable and can be
|
||||
// stacked above virtual keyboard window. This is restriced to component ime
|
||||
// extensions.
|
||||
// Requires the <code>app.window.ime</code> API permission.
|
||||
[nodoc] boolean? ime;
|
||||
|
||||
// If true, the window will have its own shelf icon. Otherwise the window
|
||||
// will be grouped in the shelf with other windows that are associated with
|
||||
// the app. Defaults to false. If showInShelf is set to true you need to
|
||||
// specify an id for the window.
|
||||
boolean? showInShelf;
|
||||
|
||||
// URL of the window icon. A window can have its own icon when showInShelf
|
||||
// is set to true. The URL should be a global or an extension local URL.
|
||||
DOMString? icon;
|
||||
|
||||
// Frame type: <code>none</code> or <code>chrome</code> (defaults to
|
||||
// <code>chrome</code>). For <code>none</code>, the
|
||||
// <code>-webkit-app-region</code> CSS property can be used to apply
|
||||
// draggability to the app's window. <code>-webkit-app-region: drag</code>
|
||||
// can be used to mark regions draggable. <code>no-drag</code> can be used
|
||||
// to disable this style on nested elements.
|
||||
//
|
||||
// Use of <code>FrameOptions</code> is new in M36.
|
||||
(DOMString or FrameOptions)? frame;
|
||||
|
||||
// Size and position of the content in the window (excluding the titlebar).
|
||||
// If an id is also specified and a window with a matching id has been shown
|
||||
// before, the remembered bounds of the window will be used instead.
|
||||
[deprecated="Use innerBounds or outerBounds."] ContentBounds? bounds;
|
||||
|
||||
// Enable window background transparency.
|
||||
// Only supported in ash. Requires the <code>app.window.alpha</code> API
|
||||
// permission.
|
||||
[nodoc] boolean? alphaEnabled;
|
||||
|
||||
// The initial state of the window, allowing it to be created already
|
||||
// fullscreen, maximized, or minimized. Defaults to 'normal'.
|
||||
State? state;
|
||||
|
||||
// If true, the window will be created in a hidden state. Call show() on
|
||||
// the window to show it once it has been created. Defaults to false.
|
||||
boolean? hidden;
|
||||
|
||||
// If true, the window will be resizable by the user. Defaults to true.
|
||||
boolean? resizable;
|
||||
|
||||
// By default if you specify an id for the window, the window will only be
|
||||
// created if another window with the same id doesn't already exist. If a
|
||||
// window with the same id already exists that window is activated instead.
|
||||
// If you do want to create multiple windows with the same id, you can
|
||||
// set this property to false.
|
||||
[deprecated="Multiple windows with the same id is no longer supported."] boolean? singleton;
|
||||
|
||||
// If true, the window will stay above most other windows. If there are
|
||||
// multiple windows of this kind, the currently focused window will be in
|
||||
// the foreground. Requires the <code>alwaysOnTopWindows</code>
|
||||
// permission. Defaults to false.
|
||||
//
|
||||
// Call <code>setAlwaysOnTop()</code> on the window to change this property
|
||||
// after creation.
|
||||
boolean? alwaysOnTop;
|
||||
|
||||
// If true, the window will be focused when created. Defaults to true.
|
||||
boolean? focused;
|
||||
|
||||
// If true, and supported by the platform, the window will be visible on all
|
||||
// workspaces.
|
||||
boolean? visibleOnAllWorkspaces;
|
||||
};
|
||||
|
||||
// Called in the creating window (parent) before the load event is called in
|
||||
// the created window (child). The parent can set fields or functions on the
|
||||
// child usable from onload. E.g. background.js:
|
||||
//
|
||||
// <code>function(createdWindow) { createdWindow.contentWindow.foo =
|
||||
// function () { }; };</code>
|
||||
//
|
||||
// window.js:
|
||||
//
|
||||
// <code>window.onload = function () { foo(); }</code>
|
||||
callback CreateWindowCallback =
|
||||
void ([instanceOf=AppWindow] object createdWindow);
|
||||
|
||||
[noinline_doc] dictionary AppWindow {
|
||||
// Focus the window.
|
||||
static void focus();
|
||||
|
||||
// Fullscreens the window.
|
||||
//
|
||||
// The user will be able to restore the window by pressing ESC. An
|
||||
// application can prevent the fullscreen state to be left when ESC is
|
||||
// pressed by requesting the <code>app.window.fullscreen.overrideEsc</code>
|
||||
// permission and canceling the event by calling .preventDefault(), in the
|
||||
// keydown and keyup handlers, like this:
|
||||
//
|
||||
// <code>window.onkeydown = window.onkeyup = function(e) { if (e.keyCode ==
|
||||
// 27 /* ESC */) { e.preventDefault(); } };</code>
|
||||
//
|
||||
// Note <code>window.fullscreen()</code> will cause the entire window to
|
||||
// become fullscreen and does not require a user gesture. The HTML5
|
||||
// fullscreen API can also be used to enter fullscreen mode (see
|
||||
// <a href="http://developer.chrome.com/apps/api_other.html">Web APIs</a>
|
||||
// for more details).
|
||||
static void fullscreen();
|
||||
|
||||
// Is the window fullscreen? This will be true if the window has been
|
||||
// created fullscreen or was made fullscreen via the
|
||||
// <code>AppWindow</code> or HTML5 fullscreen APIs.
|
||||
static boolean isFullscreen();
|
||||
|
||||
// Minimize the window.
|
||||
static void minimize();
|
||||
|
||||
// Is the window minimized?
|
||||
static boolean isMinimized();
|
||||
|
||||
// Maximize the window.
|
||||
static void maximize();
|
||||
|
||||
// Is the window maximized?
|
||||
static boolean isMaximized();
|
||||
|
||||
// Restore the window, exiting a maximized, minimized, or fullscreen state.
|
||||
static void restore();
|
||||
|
||||
// Move the window to the position (|left|, |top|).
|
||||
[deprecated="Use outerBounds."] static void moveTo(long left, long top);
|
||||
|
||||
// Resize the window to |width|x|height| pixels in size.
|
||||
[deprecated="Use outerBounds."] static void resizeTo(long width, long height);
|
||||
|
||||
// Draw attention to the window.
|
||||
static void drawAttention();
|
||||
|
||||
// Clear attention to the window.
|
||||
static void clearAttention();
|
||||
|
||||
// Close the window.
|
||||
static void close();
|
||||
|
||||
// Show the window. Does nothing if the window is already visible.
|
||||
// Focus the window if |focused| is set to true or omitted.
|
||||
static void show(optional boolean focused);
|
||||
|
||||
// Hide the window. Does nothing if the window is already hidden.
|
||||
static void hide();
|
||||
|
||||
// Get the window's inner bounds as a $(ref:ContentBounds) object.
|
||||
[nocompile, deprecated="Use innerBounds or outerBounds."] static ContentBounds getBounds();
|
||||
|
||||
// Set the window's inner bounds.
|
||||
[nocompile, deprecated="Use innerBounds or outerBounds."] static void setBounds(ContentBounds bounds);
|
||||
|
||||
// Set the app icon for the window (experimental).
|
||||
// Currently this is only being implemented on Ash.
|
||||
// TODO(stevenjb): Investigate implementing this on Windows and OSX.
|
||||
[nodoc] static void setIcon(DOMString iconUrl);
|
||||
|
||||
// Is the window always on top?
|
||||
static boolean isAlwaysOnTop();
|
||||
|
||||
// Accessors for testing.
|
||||
[nodoc] boolean hasFrameColor;
|
||||
[nodoc] long activeFrameColor;
|
||||
[nodoc] long inactiveFrameColor;
|
||||
|
||||
// Set whether the window should stay above most other windows. Requires the
|
||||
// <code>alwaysOnTopWindows</code> permission.
|
||||
static void setAlwaysOnTop(boolean alwaysOnTop);
|
||||
|
||||
// Can the window use alpha transparency?
|
||||
// TODO(jackhou): Document this properly before going to stable.
|
||||
[nodoc] static boolean alphaEnabled();
|
||||
|
||||
// Set whether the window is visible on all workspaces. (Only for platforms
|
||||
// that support this).
|
||||
static void setVisibleOnAllWorkspaces(boolean alwaysVisible);
|
||||
|
||||
// The JavaScript 'window' object for the created child.
|
||||
[instanceOf=Window] object contentWindow;
|
||||
|
||||
// The id the window was created with.
|
||||
DOMString id;
|
||||
|
||||
// The position, size and constraints of the window's content, which does
|
||||
// not include window decorations.
|
||||
// This property is new in Chrome 36.
|
||||
Bounds innerBounds;
|
||||
|
||||
// The position, size and constraints of the window, which includes window
|
||||
// decorations, such as the title bar and frame.
|
||||
// This property is new in Chrome 36.
|
||||
Bounds outerBounds;
|
||||
};
|
||||
|
||||
interface Functions {
|
||||
// The size and position of a window can be specified in a number of
|
||||
// different ways. The most simple option is not specifying anything at
|
||||
// all, in which case a default size and platform dependent position will
|
||||
// be used.
|
||||
//
|
||||
// To set the position, size and constraints of the window, use the
|
||||
// <code>innerBounds</code> or <code>outerBounds</code> properties. Inner
|
||||
// bounds do not include window decorations. Outer bounds include the
|
||||
// window's title bar and frame. Note that the padding between the inner and
|
||||
// outer bounds is determined by the OS. Therefore setting the same property
|
||||
// for both inner and outer bounds is considered an error (for example,
|
||||
// setting both <code>innerBounds.left</code> and
|
||||
// <code>outerBounds.left</code>).
|
||||
//
|
||||
// To automatically remember the positions of windows you can give them ids.
|
||||
// If a window has an id, This id is used to remember the size and position
|
||||
// of the window whenever it is moved or resized. This size and position is
|
||||
// then used instead of the specified bounds on subsequent opening of a
|
||||
// window with the same id. If you need to open a window with an id at a
|
||||
// location other than the remembered default, you can create it hidden,
|
||||
// move it to the desired location, then show it.
|
||||
static void create(
|
||||
DOMString url,
|
||||
optional CreateWindowOptions options,
|
||||
optional CreateWindowCallback callback);
|
||||
|
||||
// Returns an $(ref:AppWindow) object for the
|
||||
// current script context (ie JavaScript 'window' object). This can also be
|
||||
// called on a handle to a script context for another page, for example:
|
||||
// otherWindow.chrome.app.window.current().
|
||||
[nocompile] static AppWindow current();
|
||||
[nocompile, nodoc] static void initializeAppWindow(object state);
|
||||
|
||||
// Gets an array of all currently created app windows. This method is new in
|
||||
// Chrome 33.
|
||||
[nocompile] static AppWindow[] getAll();
|
||||
|
||||
// Gets an $(ref:AppWindow) with the given id. If no window with the given id
|
||||
// exists null is returned. This method is new in Chrome 33.
|
||||
[nocompile] static AppWindow get(DOMString id);
|
||||
|
||||
// Whether the current platform supports windows being visible on all
|
||||
// workspaces.
|
||||
[nocompile] static boolean canSetVisibleOnAllWorkspaces();
|
||||
};
|
||||
|
||||
interface Events {
|
||||
// Fired when the window is resized.
|
||||
[nocompile] static void onBoundsChanged();
|
||||
|
||||
// Fired when the window is closed. Note, this should be listened to from
|
||||
// a window other than the window being closed, for example from the
|
||||
// background page. This is because the window being closed will be in the
|
||||
// process of being torn down when the event is fired, which means not all
|
||||
// APIs in the window's script context will be functional.
|
||||
[nocompile] static void onClosed();
|
||||
|
||||
// Fired when the window is fullscreened (either via the
|
||||
// <code>AppWindow</code> or HTML5 APIs).
|
||||
[nocompile] static void onFullscreened();
|
||||
|
||||
// Fired when the window is maximized.
|
||||
[nocompile] static void onMaximized();
|
||||
|
||||
// Fired when the window is minimized.
|
||||
[nocompile] static void onMinimized();
|
||||
|
||||
// Fired when the window is restored from being minimized or maximized.
|
||||
[nocompile] static void onRestored();
|
||||
|
||||
// Fired when the window's ability to use alpha transparency changes.
|
||||
[nocompile, nodoc] static void onAlphaEnabledChanged();
|
||||
};
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
@@ -29,7 +29,6 @@
|
||||
#include "base/lazy_instance.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/metrics/histogram_functions.h"
|
||||
#include "base/metrics/histogram_macros.h"
|
||||
#include "base/notreached.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/rand_util.h"
|
||||
@@ -385,9 +384,6 @@ void SetFeatureFlags() {
|
||||
features::kV8ExperimentalRegexpEngine,
|
||||
"--enable-experimental-regexp-engine-on-excessive-backtracks",
|
||||
"--no-enable-experimental-regexp-engine-on-excessive-backtracks");
|
||||
SetV8FlagsIfOverridden(features::kV8ExternalMemoryAccountedInGlobalLimit,
|
||||
"--external-memory-accounted-in-global-limit",
|
||||
"--no-external-memory-accounted-in-global-limit");
|
||||
SetV8FlagsIfOverridden(features::kV8TurboFastApiCalls,
|
||||
"--turbo-fast-api-calls", "--no-turbo-fast-api-calls");
|
||||
SetV8FlagsIfOverridden(features::kV8MegaDomIC, "--mega-dom-ic",
|
||||
|
||||
@@ -80,6 +80,7 @@
|
||||
#include "net/cookies/cookie_setting_override.h"
|
||||
#include "net/device_bound_sessions/session_service.h"
|
||||
#include "net/disk_cache/disk_cache.h"
|
||||
#include "net/dns/context_host_resolver.h"
|
||||
#include "net/dns/host_cache.h"
|
||||
#include "net/dns/mapped_host_resolver.h"
|
||||
#include "net/extras/sqlite/cookie_crypto_delegate.h"
|
||||
@@ -135,6 +136,7 @@
|
||||
#include "services/network/proxy_resolving_socket_factory_mojo.h"
|
||||
#include "services/network/public/cpp/cert_verifier/mojo_cert_verifier.h"
|
||||
#include "services/network/public/cpp/content_security_policy/content_security_policy.h"
|
||||
#include "services/network/public/cpp/features.h"
|
||||
#include "services/network/public/cpp/network_switches.h"
|
||||
#include "services/network/public/cpp/parsed_headers.h"
|
||||
#include "services/network/public/cpp/resource_request.h"
|
||||
@@ -181,6 +183,7 @@
|
||||
#endif // BUILDFLAG(IS_CT_SUPPORTED)
|
||||
|
||||
#if BUILDFLAG(ENABLE_WEBSOCKETS)
|
||||
#include "services/network/websocket.h"
|
||||
#include "services/network/websocket_factory.h"
|
||||
#endif // BUILDFLAG(ENABLE_WEBSOCKETS)
|
||||
|
||||
@@ -648,6 +651,14 @@ bool NetworkContext::NetworkContextHttpAuthPreferences::AllowGssapiLibraryLoad()
|
||||
}
|
||||
#endif // BUILDFLAG(IS_LINUX)
|
||||
|
||||
NetworkContext::NetworkRestriction::NetworkRestriction() = default;
|
||||
NetworkContext::NetworkRestriction::NetworkRestriction(
|
||||
NetworkRestriction&& other) = default;
|
||||
NetworkContext::NetworkRestriction&
|
||||
NetworkContext::NetworkRestriction::operator=(NetworkRestriction&& other) =
|
||||
default;
|
||||
NetworkContext::NetworkRestriction::~NetworkRestriction() = default;
|
||||
|
||||
NetworkContext::PendingCertVerify::PendingCertVerify() = default;
|
||||
NetworkContext::PendingCertVerify::~PendingCertVerify() = default;
|
||||
|
||||
@@ -679,7 +690,7 @@ NetworkContext::NetworkContext(
|
||||
#endif // BUILDFLAG(ENABLE_REPORTING)
|
||||
params_(std::move(params)),
|
||||
on_connection_close_callback_(std::move(on_connection_close_callback)),
|
||||
receiver_(this, std::move(receiver)),
|
||||
receiver_(std::in_place_type<Receiver>, this),
|
||||
first_party_sets_access_delegate_(
|
||||
std::move(params_->first_party_sets_access_delegate_receiver),
|
||||
std::move(params_->first_party_sets_access_delegate_params),
|
||||
@@ -694,6 +705,15 @@ NetworkContext::NetworkContext(
|
||||
features::kCorsNonWildcardRequestHeadersSupport)),
|
||||
prefetch_cache_(prefetch_enabled_ ? std::make_unique<PrefetchCache>()
|
||||
: nullptr) {
|
||||
|
||||
if (features::ShouldBindNetworkContextDirectReceiver()) {
|
||||
receiver_.emplace<DirectReceiver>(mojo::DirectReceiverKey{}, this);
|
||||
}
|
||||
std::visit(
|
||||
[&](auto& receiver_to_bind) {
|
||||
receiver_to_bind.Bind(std::move(receiver));
|
||||
},
|
||||
receiver_);
|
||||
#if BUILDFLAG(IS_WIN) && DCHECK_IS_ON()
|
||||
if (params_->file_paths) {
|
||||
DCHECK(params_->win_permissions_set)
|
||||
@@ -781,8 +801,12 @@ NetworkContext::NetworkContext(
|
||||
// by the NetworkService. In the other constructors, lifetime is shared with
|
||||
// other consumers, and thus self-deletion is not safe and can result in
|
||||
// double-frees.
|
||||
receiver_.set_disconnect_handler(base::BindOnce(
|
||||
&NetworkContext::OnConnectionError, base::Unretained(this)));
|
||||
std::visit(
|
||||
[&](auto& receiver) {
|
||||
receiver.set_disconnect_handler(base::BindOnce(
|
||||
&NetworkContext::OnConnectionError, base::Unretained(this)));
|
||||
},
|
||||
receiver_);
|
||||
|
||||
socket_factory_ = std::make_unique<SocketFactory>(
|
||||
url_request_context_->net_log(), url_request_context_);
|
||||
@@ -828,6 +852,8 @@ NetworkContext::NetworkContext(
|
||||
|
||||
SetBlockTrustTokens(params_->block_trust_tokens);
|
||||
|
||||
SetDohFallbackUpgradeAllowed(params_->doh_fallback_upgrade_allowed);
|
||||
|
||||
if (params_ && params_->http_cache_file_operations_factory) {
|
||||
http_cache_file_operations_factory_ =
|
||||
base::MakeRefCounted<MojoBackendFileOperationsFactory>(
|
||||
@@ -853,7 +879,7 @@ NetworkContext::NetworkContext(
|
||||
#if BUILDFLAG(ENABLE_REPORTING)
|
||||
is_observing_reporting_service_(false),
|
||||
#endif // BUILDFLAG(ENABLE_REPORTING)
|
||||
receiver_(this, std::move(receiver)),
|
||||
receiver_(std::in_place_type<Receiver>, this),
|
||||
first_party_sets_access_delegate_(
|
||||
/*receiver=*/mojo::NullReceiver(),
|
||||
/*params=*/nullptr,
|
||||
@@ -877,6 +903,15 @@ NetworkContext::NetworkContext(
|
||||
prefetch_cache_(prefetch_enabled_ ? std::make_unique<PrefetchCache>()
|
||||
: nullptr) {
|
||||
|
||||
if (features::ShouldBindNetworkContextDirectReceiver()) {
|
||||
receiver_.emplace<DirectReceiver>(mojo::DirectReceiverKey{}, this);
|
||||
}
|
||||
std::visit(
|
||||
[&](auto& receiver_to_bind) {
|
||||
receiver_to_bind.Bind(std::move(receiver));
|
||||
},
|
||||
receiver_);
|
||||
|
||||
shared_resource_checker_ = std::make_unique<SharedResourceChecker>(
|
||||
cookie_manager_->cookie_settings());
|
||||
|
||||
@@ -895,6 +930,16 @@ NetworkContext::NetworkContext(
|
||||
}
|
||||
}
|
||||
|
||||
#if BUILDFLAG(ENABLE_WEBSOCKETS)
|
||||
void NetworkContext::CreateNetLogEntriesForActiveWebSockets(
|
||||
net::NetLog::ThreadSafeObserver* observer) const {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
if (websocket_factory_) {
|
||||
websocket_factory_->CreateNetLogEntriesForActiveConnections(observer);
|
||||
}
|
||||
}
|
||||
#endif // BUILDFLAG(ENABLE_WEBSOCKETS)
|
||||
|
||||
NetworkContext::~NetworkContext() {
|
||||
is_destructing_ = true;
|
||||
|
||||
@@ -1234,6 +1279,13 @@ void NetworkContext::SetBlockTrustTokens(bool block) {
|
||||
block_trust_tokens_ = block;
|
||||
}
|
||||
|
||||
void NetworkContext::SetDohFallbackUpgradeAllowed(bool allowed) {
|
||||
if (url_request_context_->host_resolver()) {
|
||||
url_request_context_->host_resolver()->SetDohFallbackUpgradeAllowed(
|
||||
allowed);
|
||||
}
|
||||
}
|
||||
|
||||
void NetworkContext::OnProxyLookupComplete(
|
||||
ProxyLookupRequest* proxy_lookup_request) {
|
||||
auto it = proxy_lookup_requests_.find(proxy_lookup_request);
|
||||
@@ -1621,7 +1673,8 @@ void NetworkContext::QueueReportInternal(
|
||||
// Reporting is disallowed if network access is disabled for the nonce.
|
||||
if (network_anonymization_key.GetNonce().has_value() &&
|
||||
!IsNetworkForNonceAndUrlAllowed(
|
||||
network_anonymization_key.GetNonce().value(), url)) {
|
||||
network_anonymization_key.GetNonce().value(), url,
|
||||
network_anonymization_key)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1637,6 +1690,22 @@ void NetworkContext::QueueReportInternal(
|
||||
#endif // BUILDFLAG(ENABLE_REPORTING)
|
||||
}
|
||||
|
||||
void NetworkContext::QueueConnectionAllowlistReport(
|
||||
const GURL& context,
|
||||
const GURL& resource,
|
||||
const net::NetworkAnonymizationKey& key,
|
||||
const std::optional<base::UnguessableToken>& reporting_source,
|
||||
const std::string& group,
|
||||
bool enforced) {
|
||||
base::DictValue body;
|
||||
// Strip username, password, and ref fragments from the blocked resource URL.
|
||||
body.Set("connection", resource.GetAsReferrer().spec());
|
||||
body.Set("disposition", enforced ? "enforce" : "report");
|
||||
|
||||
QueueReport("connection-allowlist", group, context, reporting_source, key,
|
||||
std::move(body));
|
||||
}
|
||||
|
||||
void NetworkContext::QueueSignedExchangeReport(
|
||||
mojom::SignedExchangeReportPtr report,
|
||||
const net::NetworkAnonymizationKey& network_anonymization_key) {
|
||||
@@ -1654,7 +1723,8 @@ void NetworkContext::QueueSignedExchangeReport(
|
||||
// Reporting is disallowed if network access is disabled for the nonce.
|
||||
if (network_anonymization_key.GetNonce().has_value() &&
|
||||
!IsNetworkForNonceAndUrlAllowed(
|
||||
network_anonymization_key.GetNonce().value(), report->outer_url)) {
|
||||
network_anonymization_key.GetNonce().value(), report->outer_url,
|
||||
network_anonymization_key)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1876,12 +1946,13 @@ void NetworkContext::CreateRestrictedUDPSocket(
|
||||
mojo::PendingReceiver<mojom::RestrictedUDPSocket> receiver,
|
||||
mojo::PendingRemote<mojom::UDPSocketListener> listener,
|
||||
bool allow_multicast,
|
||||
bool allow_source_specific_multicast,
|
||||
CreateRestrictedUDPSocketCallback callback) {
|
||||
// SimpleHostResolver is transitively owned by |this|.
|
||||
socket_factory_->CreateRestrictedUDPSocket(
|
||||
addr, mode, traffic_annotation, std::move(params), std::move(receiver),
|
||||
std::move(listener), SimpleHostResolver::Create(this), allow_multicast,
|
||||
std::move(callback));
|
||||
allow_source_specific_multicast, std::move(callback));
|
||||
}
|
||||
|
||||
void NetworkContext::CreateTCPServerSocket(
|
||||
@@ -1980,7 +2051,8 @@ void NetworkContext::CreateWebSocket(
|
||||
url_loader_network_observer,
|
||||
mojo::PendingRemote<mojom::WebSocketAuthenticationHandler> auth_handler,
|
||||
mojo::PendingRemote<mojom::TrustedHeaderClient> header_client,
|
||||
const std::optional<base::UnguessableToken>& throttling_profile_id) {
|
||||
const std::optional<base::UnguessableToken>& throttling_profile_id,
|
||||
const std::optional<base::UnguessableToken>& network_restrictions_id) {
|
||||
#if BUILDFLAG(ENABLE_WEBSOCKETS)
|
||||
if (!websocket_factory_) {
|
||||
websocket_factory_ = std::make_unique<WebSocketFactory>(this);
|
||||
@@ -1994,7 +2066,8 @@ void NetworkContext::CreateWebSocket(
|
||||
std::move(client_security_state), options,
|
||||
static_cast<net::NetworkTrafficAnnotationTag>(traffic_annotation),
|
||||
std::move(handshake_client), std::move(url_loader_network_observer),
|
||||
std::move(auth_handler), std::move(header_client), throttling_profile_id);
|
||||
std::move(auth_handler), std::move(header_client), throttling_profile_id,
|
||||
network_restrictions_id);
|
||||
#endif // BUILDFLAG(ENABLE_WEBSOCKETS)
|
||||
}
|
||||
|
||||
@@ -2010,7 +2083,7 @@ void NetworkContext::CreateWebTransport(
|
||||
url_loader_network_observer,
|
||||
mojom::ClientSecurityStatePtr client_security_state) {
|
||||
if (!IsNetworkForNonceAndUrlAllowed(
|
||||
key.GetNonce().value_or(base::UnguessableToken::Null()), url)) {
|
||||
key.GetNonce().value_or(base::UnguessableToken::Null()), url, key)) {
|
||||
mojo::Remote<mojom::WebTransportHandshakeClient> remote_handshake_client(
|
||||
std::move(pending_handshake_client));
|
||||
remote_handshake_client->OnHandshakeFailed(
|
||||
@@ -2048,12 +2121,14 @@ void NetworkContext::ResolveHost(
|
||||
bool is_network_disallowed_for_nonce =
|
||||
network_anonymization_key.GetNonce().has_value() &&
|
||||
!IsNetworkForNonceAndUrlAllowed(
|
||||
network_anonymization_key.GetNonce().value(), url);
|
||||
network_anonymization_key.GetNonce().value(), url,
|
||||
network_anonymization_key);
|
||||
bool is_network_disallowed_for_restrictions_id =
|
||||
(optional_parameters &&
|
||||
optional_parameters->network_restrictions_id.has_value() &&
|
||||
!IsHostResolutionForNonceAndHostAllowed(
|
||||
optional_parameters->network_restrictions_id.value(), *host));
|
||||
optional_parameters->network_restrictions_id.value(), *host,
|
||||
network_anonymization_key));
|
||||
if (is_network_disallowed_for_nonce ||
|
||||
is_network_disallowed_for_restrictions_id) {
|
||||
mojo::Remote<mojom::ResolveHostClient> remote_response_client(
|
||||
@@ -2395,11 +2470,13 @@ void NetworkContext::PreconnectSockets(
|
||||
// Preconnect is disallowed if network access is disabled for the nonce.
|
||||
if (network_anonymization_key.GetNonce().has_value() &&
|
||||
!IsNetworkForNonceAndUrlAllowed(
|
||||
network_anonymization_key.GetNonce().value(), url)) {
|
||||
network_anonymization_key.GetNonce().value(), url,
|
||||
network_anonymization_key)) {
|
||||
return;
|
||||
}
|
||||
if (network_restrictions_id.has_value() &&
|
||||
!IsNetworkForNonceAndUrlAllowed(*network_restrictions_id, url)) {
|
||||
!IsNetworkForNonceAndUrlAllowed(*network_restrictions_id, url,
|
||||
network_anonymization_key)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3524,31 +3601,64 @@ void NetworkContext::FlushClientCertCache() {
|
||||
void NetworkContext::RevokeNetworkForNonces(
|
||||
std::vector<mojom::NonceAndAllowlistedPatternsPtr> nonces_to_patterns,
|
||||
RevokeNetworkForNoncesCallback callback) {
|
||||
auto parse_allowlist =
|
||||
[](std::optional<ConnectionAllowlist>& source,
|
||||
std::optional<std::string>& dest_endpoint,
|
||||
std::optional<
|
||||
std::set<std::unique_ptr<url_pattern::SimpleUrlPatternMatcher>>>&
|
||||
dest_patterns,
|
||||
ConnectionAllowlist::RedirectBehavior& dest_redirect_behavior) {
|
||||
if (!source) {
|
||||
return;
|
||||
}
|
||||
dest_endpoint = source->reporting_endpoint;
|
||||
dest_redirect_behavior = source->redirect_behavior;
|
||||
dest_patterns.emplace();
|
||||
for (const std::string& pattern : source->allowlist) {
|
||||
// TODO(crbug.com/447954811): We can safely DCHECK here, as we've done
|
||||
// pattern validation already while validating the header's syntax.
|
||||
// That said, parsing the pattern twice has performance overhead, and
|
||||
// it would be ideal to change our infrastructure to allow passing a
|
||||
// SimpleUrlPatternMatcher directly rather than creating it anew here.
|
||||
auto matcher = url_pattern::SimpleUrlPatternMatcher::Create(
|
||||
pattern, /*base_url=*/nullptr);
|
||||
|
||||
DCHECK(matcher.has_value());
|
||||
dest_patterns->insert(std::move(matcher.value()));
|
||||
}
|
||||
};
|
||||
|
||||
for (auto& entry : nonces_to_patterns) {
|
||||
const base::UnguessableToken& nonce = entry->nonce;
|
||||
|
||||
// Accessing `network_revocation_nonces_[nonce]` here ensures that if it's
|
||||
// not already present in the set, it's default-constructed. This is
|
||||
// important, as an empty `entry->allowlisted_patterns` represents complete
|
||||
// network revocation.
|
||||
auto& revocation_set = network_revocation_nonces_[nonce];
|
||||
for (const std::string& pattern : entry->allowlisted_patterns) {
|
||||
// TODO(crbug.com/447954811): We can safely DCHECK here, as we've done
|
||||
// pattern validation already while validating the header's syntax. That
|
||||
// said, parsing the pattern twice has performance overhead, and it would
|
||||
// be ideal to change our infrastructure to allow passing a
|
||||
// SimpleUrlPatternMatcher directly rather than creating it anew here.
|
||||
auto matcher = url_pattern::SimpleUrlPatternMatcher::Create(
|
||||
pattern, /*base_url=*/nullptr);
|
||||
DCHECK(matcher.has_value());
|
||||
revocation_set.insert(std::move(matcher.value()));
|
||||
}
|
||||
// important, as an empty `entry->allowlists.enforced->allowlist` represents
|
||||
// complete network revocation.
|
||||
NetworkRestriction& restriction = network_revocation_nonces_[nonce];
|
||||
restriction.response_url = entry->allowlists.response_url;
|
||||
restriction.reporting_source = entry->allowlists.reporting_source;
|
||||
|
||||
parse_allowlist(entry->allowlists.enforced,
|
||||
restriction.enforced_reporting_endpoint,
|
||||
restriction.enforced_allowlisted_patterns,
|
||||
restriction.enforced_redirect_behavior);
|
||||
parse_allowlist(entry->allowlists.report_only,
|
||||
restriction.report_only_reporting_endpoint,
|
||||
restriction.report_only_allowlisted_patterns,
|
||||
restriction.report_only_redirect_behavior);
|
||||
|
||||
// CancelRequestsIfNonceMatchesAndUrlNotExempted is not needed for
|
||||
// connection allowlist since there should not be any ongoing
|
||||
// requests.
|
||||
const std::set<GURL>& exemptions = network_revocation_exemptions_[nonce];
|
||||
for (const auto& factory : url_loader_factories_) {
|
||||
// Destroying all of a factory's URLLoaders may delete the factory,
|
||||
// invalidating the iterator, so have to advance the iterator before calling
|
||||
// CancelRequestsIfNonceMatchesAndUrlNotExempted().
|
||||
for (auto factory_it = url_loader_factories_.begin();
|
||||
factory_it != url_loader_factories_.end();) {
|
||||
auto* factory = factory_it->get();
|
||||
++factory_it;
|
||||
factory->CancelRequestsIfNonceMatchesAndUrlNotExempted(nonce, exemptions);
|
||||
}
|
||||
#if BUILDFLAG(ENABLE_WEBSOCKETS)
|
||||
@@ -3653,44 +3763,93 @@ void NetworkContext::AddQuicHints(
|
||||
bool NetworkContext::IsNetworkForNonceAndUrlAllowed(
|
||||
const base::UnguessableToken& nonce,
|
||||
const GURL& url,
|
||||
bool is_redirect) const {
|
||||
const net::NetworkAnonymizationKey& network_anonymization_key,
|
||||
bool is_redirect) {
|
||||
// If network hasn't been revoked for the nonce, it's allowed.
|
||||
if (!network_revocation_nonces_.contains(nonce)) {
|
||||
auto it = network_revocation_nonces_.find(nonce);
|
||||
if (it == network_revocation_nonces_.end()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Note: network_revocation_exemptions_ is only used for fenced frames and the
|
||||
// disableUntrustedNetwork API for testing scenarios.
|
||||
if (auto it_exempt = network_revocation_exemptions_.find(nonce);
|
||||
it_exempt != network_revocation_exemptions_.end() &&
|
||||
it_exempt->second.contains(url.GetWithoutFilename())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const NetworkRestriction& restriction = it->second;
|
||||
|
||||
// Temporary disgusting hack: if we have a NetworkRestriction but we've not
|
||||
// actually specified anything to be restricted, then this restriction must
|
||||
// be for a fenced frame. Given that there were no fenced frames exemptions
|
||||
// detected above, we can just return false here. The fenced frame portion of
|
||||
// this function is slated for removal, so this will be cleaned up within
|
||||
// 1-2 milestones. TODO(crbug.com/499191497): Remove this check.
|
||||
if (!restriction.enforced_allowlisted_patterns.has_value() &&
|
||||
!restriction.report_only_allowlisted_patterns.has_value()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// For connection allowlist feature, network_revocation_nonces_ map contains
|
||||
// the allowed URL Patterns.
|
||||
// Note that the network_revocation_exemptions_ check below which was added
|
||||
// Note that the network_revocation_exemptions_ check above which was added
|
||||
// to enable fenced frames testing is orthogonal to this feature.
|
||||
// If there are no allowlisted URLs then it is assumed that all network URLs
|
||||
// are restricted (unless exempted for FF testing).
|
||||
if (base::FeatureList::IsEnabled(network::features::kConnectionAllowlists)) {
|
||||
const std::set<std::unique_ptr<url_pattern::SimpleUrlPatternMatcher>>&
|
||||
allowlisted_patterns = network_revocation_nonces_.find(nonce)->second;
|
||||
for (const std::unique_ptr<url_pattern::SimpleUrlPatternMatcher>& pattern :
|
||||
allowlisted_patterns) {
|
||||
if (pattern->Match(url)) {
|
||||
// Redirects are blocked for URLs allowed through connection allowlists.
|
||||
return !is_redirect;
|
||||
}
|
||||
}
|
||||
}
|
||||
auto restriction_allowed = [&](const NetworkRestriction& r, bool enforced) {
|
||||
const auto& patterns = enforced ? r.enforced_allowlisted_patterns
|
||||
: r.report_only_allowlisted_patterns;
|
||||
const auto& redirect_behavior = enforced
|
||||
? r.enforced_redirect_behavior
|
||||
: r.report_only_redirect_behavior;
|
||||
|
||||
if (is_redirect) {
|
||||
return redirect_behavior ==
|
||||
ConnectionAllowlist::RedirectBehavior::kAllow;
|
||||
}
|
||||
return !patterns.has_value() ||
|
||||
std::ranges::any_of(
|
||||
*patterns,
|
||||
[&url](const std::unique_ptr<
|
||||
url_pattern::SimpleUrlPatternMatcher>& matcher) {
|
||||
return matcher->Match(url);
|
||||
});
|
||||
};
|
||||
|
||||
// First, check against the report-only allowlist, reporting violations:
|
||||
if (restriction.report_only_reporting_endpoint.has_value() &&
|
||||
!restriction_allowed(restriction, /*enforced=*/false)) {
|
||||
QueueConnectionAllowlistReport(
|
||||
restriction.response_url, url, network_anonymization_key,
|
||||
restriction.reporting_source,
|
||||
*restriction.report_only_reporting_endpoint, /*enforced=*/false);
|
||||
}
|
||||
|
||||
// Then, match against the enforced allowlist, and return `false` to cancel
|
||||
// the request if a violation is found:
|
||||
if (!restriction_allowed(restriction, /*enforced=*/true)) {
|
||||
if (restriction.enforced_reporting_endpoint.has_value()) {
|
||||
QueueConnectionAllowlistReport(
|
||||
restriction.response_url, url, network_anonymization_key,
|
||||
restriction.reporting_source,
|
||||
*restriction.enforced_reporting_endpoint, /*enforced=*/true);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// If network has been revoked for the nonce, but the url is exempted, it's
|
||||
// allowed.
|
||||
if (auto it = network_revocation_exemptions_.find(nonce);
|
||||
it != network_revocation_exemptions_.end() &&
|
||||
it->second.contains(url.GetWithoutFilename())) {
|
||||
return true;
|
||||
}
|
||||
// The nonce was revoked and the url isn't exempted.
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool NetworkContext::IsHostResolutionForNonceAndHostAllowed(
|
||||
const base::UnguessableToken& nonce,
|
||||
const mojom::HostResolverHost& host) const {
|
||||
const mojom::HostResolverHost& host,
|
||||
const net::NetworkAnonymizationKey& network_anonymization_key) {
|
||||
if (!base::FeatureList::IsEnabled(network::features::kConnectionAllowlists)) {
|
||||
return true;
|
||||
}
|
||||
@@ -3713,16 +3872,47 @@ bool NetworkContext::IsHostResolutionForNonceAndHostAllowed(
|
||||
// https://wicg.github.io/connection-allowlists/#abstract-opdef-match-a-host-to-a-connection-allowlist,
|
||||
// we need to match `synthetic_url` against a host-only variant against each
|
||||
// URLPattern corresponding to `nonce`.
|
||||
const std::set<std::unique_ptr<url_pattern::SimpleUrlPatternMatcher>>&
|
||||
allowlisted_patterns = it->second;
|
||||
for (const std::unique_ptr<url_pattern::SimpleUrlPatternMatcher>& pattern :
|
||||
allowlisted_patterns) {
|
||||
if (pattern->HostOnlyMatch(synthetic_url)) {
|
||||
return true;
|
||||
}
|
||||
const NetworkRestriction& restriction = it->second;
|
||||
|
||||
auto restriction_allowed = [&](const NetworkRestriction& r, bool enforced) {
|
||||
const auto& patterns = enforced ? r.enforced_allowlisted_patterns
|
||||
: r.report_only_allowlisted_patterns;
|
||||
return !patterns.has_value() ||
|
||||
std::ranges::any_of(
|
||||
*patterns,
|
||||
[&synthetic_url](
|
||||
const std::unique_ptr<url_pattern::SimpleUrlPatternMatcher>&
|
||||
matcher) {
|
||||
return matcher->HostOnlyMatch(synthetic_url);
|
||||
});
|
||||
};
|
||||
|
||||
// First, check against the report-only allowlist, reporting violations:
|
||||
if (restriction.report_only_reporting_endpoint.has_value() &&
|
||||
!restriction_allowed(restriction, /*enforced=*/false)) {
|
||||
QueueConnectionAllowlistReport(restriction.response_url, synthetic_url,
|
||||
network_anonymization_key,
|
||||
restriction.reporting_source,
|
||||
*restriction.report_only_reporting_endpoint,
|
||||
/*enforced=*/false);
|
||||
}
|
||||
|
||||
return false;
|
||||
// Then, match against the enforced allowlist, and return `false` to cancel
|
||||
// the request if a violation is found:
|
||||
if (!restriction_allowed(restriction, /*enforced=*/true)) {
|
||||
if (restriction.enforced_reporting_endpoint.has_value()) {
|
||||
QueueConnectionAllowlistReport(restriction.response_url, synthetic_url,
|
||||
network_anonymization_key,
|
||||
restriction.reporting_source,
|
||||
*restriction.enforced_reporting_endpoint,
|
||||
/*enforced=*/true);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// If we didn't block the request via the enforcement check directly above,
|
||||
// it should be allowed:
|
||||
return true;
|
||||
}
|
||||
|
||||
void NetworkContext::InitializePrefetchURLLoaderFactory() {
|
||||
@@ -3732,4 +3922,13 @@ void NetworkContext::InitializePrefetchURLLoaderFactory() {
|
||||
CreateURLLoaderFactoryParamsForPrefetch());
|
||||
}
|
||||
|
||||
GURL NetworkContext::GetNetworkRestrictionResponseUrlForTesting(
|
||||
const base::UnguessableToken& nonce) const {
|
||||
auto it = network_revocation_nonces_.find(nonce);
|
||||
if (it == network_revocation_nonces_.end()) {
|
||||
return GURL();
|
||||
}
|
||||
return it->second.response_url;
|
||||
}
|
||||
|
||||
} // namespace network
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Vendored
+54
-3
@@ -3651,7 +3651,7 @@ enum WebFeature {
|
||||
kEligibleForImageLoadingPrioritizationFix = 4376,
|
||||
kExecutedNonTrivialJavaScriptURL = 4377,
|
||||
kStorageBucketsOpen = 4378,
|
||||
kPerformanceEntryBufferSwaps = 4379,
|
||||
kOBSOLETE_PerformanceEntryBufferSwaps = 4379,
|
||||
kClearPerformanceEntries = 4380,
|
||||
kViewportDependentLazyLoadedImageWithoutSizesAttribute = 4381,
|
||||
kV8MediaStreamTrack_ApplyConstraints_Method = 4382,
|
||||
@@ -4686,7 +4686,7 @@ enum WebFeature {
|
||||
kDOMWindowOpenPopup = 5377,
|
||||
kFencedFrameDisableUntrustedNetwork = 5378,
|
||||
kFencedFrameNotifyEvent = 5379,
|
||||
kSharedStorageGetInFencedFrame = 5380,
|
||||
kOBSOLETE_SharedStorageGetInFencedFrame = 5380,
|
||||
kOBSOLETE_Translator_MeasureInputUsage_Method = 5381,
|
||||
kOBSOLETE_Translator_InputQuota_AttributeGetter = 5382,
|
||||
kAriaNotify = 5383,
|
||||
@@ -5043,7 +5043,7 @@ enum WebFeature {
|
||||
kV8Origin_FromURL_Method = 5727,
|
||||
kV8Origin_Parse_Method = 5728,
|
||||
kExtendedTextMetrics = 5729,
|
||||
kUseCssSizingProperties = 5730,
|
||||
kOBSOLETE_UseCssSizingProperties = 5730,
|
||||
kSharedStorageAPIAll = 5731,
|
||||
kGamepadRawInputChangeEventListener = 5732,
|
||||
kLetterSpacingWithMargin = 5733,
|
||||
@@ -5133,6 +5133,57 @@ enum WebFeature {
|
||||
kHTMLInputElementTypeChangedWhileConnected = 5816,
|
||||
kHTMLButtonElementTypeChangedWhileDisconnected = 5817,
|
||||
kHTMLInputElementTypeChangedWhileDisconnected = 5818,
|
||||
kSynthesizedMiddleClickAnchor = 5819,
|
||||
kSynthesizedMiddleClickArea = 5820,
|
||||
kSynthesizedMiddleClickSVGAnchor = 5821,
|
||||
kWebAuthenticationCspDisallowsRpId = 5822,
|
||||
kHistoryGoBackWouldSkipAd = 5823,
|
||||
kHistoryGoForwardWouldSkipAd = 5824,
|
||||
kHistoryGoBackWouldNotSkipAdDueToSameOriginExclusion = 5825,
|
||||
kHistoryGoForwardWouldNotSkipAdDueToSameOriginExclusion = 5826,
|
||||
kSvgFilterPaintedOnLocalFrame = 5827,
|
||||
kSvgFilterPaintedOnRemoteFrame = 5828,
|
||||
kSvgFilterPaintedOnWebPlugin = 5829,
|
||||
kSubtleCryptoEncapsulateKey = 5830,
|
||||
kSubtleCryptoEncapsulateBits = 5831,
|
||||
kSubtleCryptoDecapsulateKey = 5832,
|
||||
kSubtleCryptoDecapsulateBits = 5833,
|
||||
kCSSDiscardedVarWithValidArgumentGrammar = 5834,
|
||||
kCSSDiscardedAttrWithValidArgumentGrammar = 5835,
|
||||
kCSSDiscardedEnvWithValidArgumentGrammar = 5836,
|
||||
kCSSDiscardedIfWithValidArgumentGrammar = 5837,
|
||||
kHttpOnlyCookieShadowedByNonHttpOnlyPartitioned = 5838,
|
||||
kXRMeshDetection = 5839,
|
||||
kXRFrameDetectedMeshes = 5840,
|
||||
kCSSLightDarkImage = 5841,
|
||||
kCSSTimelineLookupFoundNothing = 5842,
|
||||
kCSSTimelineScopeAttachedMultiple = 5843,
|
||||
kSVGForeignObjectInImage = 5844,
|
||||
kSVGForeignObjectDrawnIntoCanvas = 5845,
|
||||
kHTMLPatching = 5846,
|
||||
kHTMLStreaming = 5847,
|
||||
kHTMLPositionalSetters = 5848,
|
||||
kLazyLoadVideoLoadingAttributeLazy = 5849,
|
||||
kLazyLoadVideoLoadingAttributeEager = 5850,
|
||||
kLazyLoadAudioLoadingAttributeLazy = 5851,
|
||||
kLazyLoadAudioLoadingAttributeEager = 5852,
|
||||
kResourceTimingWorkerMatchedSourceType = 5853,
|
||||
kResourceTimingWorkerFinalSourceType = 5854,
|
||||
kNoVarySearchWithBooleanParams = 5855,
|
||||
kDataUrlWorkerBroadcastChannel = 5856,
|
||||
kNoscriptMarkupWithScriptingDisabledTemplate = 5857,
|
||||
kNoscriptMarkupWithScriptingDisabledIframeSandbox = 5858,
|
||||
kNoscriptMarkupWithScriptingDisabledXHR = 5859,
|
||||
kNoscriptMarkupWithScriptingDisabledDOMParser = 5860,
|
||||
kNoscriptMarkupWithScriptingDisabledNoBrowsingContext = 5861,
|
||||
kSingleAxisScroller = 5862,
|
||||
kV8HoleyArrayReadthrough = 5863,
|
||||
kLanguageModel_Create_Temperature = 5864,
|
||||
kLanguageModel_Create_TopK = 5865,
|
||||
kHTMLInCanvas = 5866,
|
||||
kConnectionAllowlist = 5867,
|
||||
kStyleTypeModule = 5868,
|
||||
kShadowRootAdoptedStyleSheets = 5869,
|
||||
|
||||
// Add new features immediately above this line. Don't change the existing
|
||||
// numbers of any item, and don't reuse removed slots. Also don't add extra
|
||||
|
||||
Vendored
+10
-1
@@ -5,6 +5,7 @@
|
||||
module blink.mojom;
|
||||
|
||||
import "mojo/public/mojom/base/string16.mojom";
|
||||
import "mojo/public/mojom/base/time.mojom";
|
||||
import "skia/public/mojom/skcolor.mojom";
|
||||
import "third_party/blink/public/mojom/css/preferred_color_scheme.mojom";
|
||||
import "third_party/blink/public/mojom/css/preferred_contrast.mojom";
|
||||
@@ -137,7 +138,7 @@ struct WebPreferences {
|
||||
bool shrinks_standalone_images_to_fit;
|
||||
bool text_areas_are_resizable;
|
||||
bool allow_scripts_to_close_windows;
|
||||
bool allow_window_focus_without_user_gesture;
|
||||
bool allow_unrestricted_window_focus;
|
||||
bool remote_fonts_enabled;
|
||||
bool javascript_can_access_clipboard;
|
||||
// We don't use dns_prefetching_enabled to disable DNS prefetching. Instead,
|
||||
@@ -518,6 +519,14 @@ struct WebPreferences {
|
||||
// devtools extension panels.
|
||||
bool ai_ot_apis_enabled = false;
|
||||
|
||||
// Whether IgnoreDuplicateNavs is enabled. Controlled by WebView settings on
|
||||
// WebView and by `kIgnoreDuplicateNavs` feature flag everywhere.
|
||||
bool ignore_duplicate_nav_enabled = false;
|
||||
|
||||
// Threshold in ms for IgnoreDuplicateNavs. Controlled by WebView settings on
|
||||
// WebView and by `kDuplicateNavThreshold` feature param everywhere.
|
||||
mojo_base.mojom.TimeDelta duplicate_nav_threshold = default;
|
||||
|
||||
[EnableIf=is_android]
|
||||
bool should_screenshot_on_mainframe_same_doc_navigation = true;
|
||||
|
||||
|
||||
+1
-1
@@ -10,5 +10,5 @@
|
||||
RuntimeEnabled=CSSColorTypedOM
|
||||
] interface CSSColorValue {
|
||||
|
||||
[RaisesException, NewObject, Exposed=Window, CallWith=ExecutionContext] static (CSSColorValue or CSSStyleValue) parse(USVString cssText);
|
||||
[RaisesException, NewObject, Exposed=Window, CallWith=ScriptState] static (CSSColorValue or CSSStyleValue) parse(USVString cssText);
|
||||
};
|
||||
|
||||
+3
-3
@@ -169,8 +169,8 @@ MediaQueryParser::MediaQueryParser(ParserType parser_type,
|
||||
fake_context_(*MakeGarbageCollected<CSSParserContext>(
|
||||
kHTMLStandardMode,
|
||||
SecureContextMode::kInsecureContext,
|
||||
DynamicTo<LocalDOMWindow>(execution_context)
|
||||
? DynamicTo<LocalDOMWindow>(execution_context)->document()
|
||||
IsA<LocalDOMWindow>(execution_context)
|
||||
? To<LocalDOMWindow>(*execution_context).document()
|
||||
: nullptr)) {}
|
||||
|
||||
namespace {
|
||||
@@ -319,7 +319,7 @@ AtomicString MediaQueryParser::ConsumeAllowedName(
|
||||
}
|
||||
AtomicString name = stream.Peek().Value().ToAtomicString();
|
||||
if (!feature_set.IsCaseSensitive(name)) {
|
||||
name = name.LowerASCII();
|
||||
name = name.ToAsciiLower();
|
||||
}
|
||||
if (!feature_set.IsAllowed(name)) {
|
||||
return g_null_atom;
|
||||
|
||||
+12
-6
@@ -28,10 +28,16 @@ interface mixin ChildNode {
|
||||
[Unscopable, RaisesException, CEReactions] undefined remove();
|
||||
|
||||
// https://github.com/whatwg/html/issues/11669
|
||||
[RuntimeEnabled=DocumentPatching, RaisesException] void beforeHTML(DOMString html, optional (SetHTMLOptions or TrustedParserOptions) options = {});
|
||||
[RuntimeEnabled=DocumentPatching, RaisesException] void beforeHTMLUnsafe((TrustedHTML or DOMString) html, optional (SetHTMLUnsafeOptions or TrustedParserOptions) options = {});
|
||||
[RuntimeEnabled=DocumentPatching, RaisesException] void afterHTML(DOMString html, optional (SetHTMLOptions or TrustedParserOptions) options = {});
|
||||
[RuntimeEnabled=DocumentPatching, RaisesException] void afterHTMLUnsafe((TrustedHTML or DOMString) html, optional (SetHTMLUnsafeOptions or TrustedParserOptions) options = {});
|
||||
[RuntimeEnabled=DocumentPatching, RaisesException] void replaceWithHTML(DOMString html, optional (SetHTMLOptions or TrustedParserOptions) options = {});
|
||||
[RuntimeEnabled=DocumentPatching, RaisesException] void replaceWithHTMLUnsafe((TrustedHTML or DOMString) html, optional (SetHTMLUnsafeOptions or TrustedParserOptions) options = {});
|
||||
[RuntimeEnabled=NewHTMLSettingMethods, RaisesException, MeasureAs=HTMLPositionalSetters] void beforeHTML(DOMString html, optional SetHTMLOptions options = {});
|
||||
[RuntimeEnabled=NewHTMLSettingMethods, RaisesException, MeasureAs=HTMLPositionalSetters] void beforeHTMLUnsafe((TrustedHTML or DOMString) html, optional (SetHTMLUnsafeOptions or TrustedParserOptions) options = {});
|
||||
[RuntimeEnabled=NewHTMLSettingMethods, RaisesException, MeasureAs=HTMLPositionalSetters] void afterHTML(DOMString html, optional SetHTMLOptions options = {});
|
||||
[RuntimeEnabled=NewHTMLSettingMethods, RaisesException, MeasureAs=HTMLPositionalSetters] void afterHTMLUnsafe((TrustedHTML or DOMString) html, optional (SetHTMLUnsafeOptions or TrustedParserOptions) options = {});
|
||||
[RuntimeEnabled=NewHTMLSettingMethods, RaisesException, MeasureAs=HTMLPositionalSetters] void replaceWithHTML(DOMString html, optional SetHTMLOptions options = {});
|
||||
[RuntimeEnabled=NewHTMLSettingMethods, RaisesException, MeasureAs=HTMLPositionalSetters] void replaceWithHTMLUnsafe((TrustedHTML or DOMString) html, optional (SetHTMLUnsafeOptions or TrustedParserOptions) options = {});
|
||||
[RuntimeEnabled=NewHTMLSettingMethods, CallWith=ScriptState, RaisesException, MeasureAs=HTMLStreaming] WritableStream streamBeforeHTML(optional SetHTMLOptions options = {});
|
||||
[RuntimeEnabled=NewHTMLSettingMethods, CallWith=ScriptState, RaisesException, MeasureAs=HTMLStreaming] WritableStream streamBeforeHTMLUnsafe(optional (SetHTMLUnsafeOptions or TrustedParserOptions) options = {});
|
||||
[RuntimeEnabled=NewHTMLSettingMethods, CallWith=ScriptState, RaisesException, MeasureAs=HTMLStreaming] WritableStream streamAfterHTML(optional SetHTMLOptions options = {});
|
||||
[RuntimeEnabled=NewHTMLSettingMethods, CallWith=ScriptState, RaisesException, MeasureAs=HTMLStreaming] WritableStream streamAfterHTMLUnsafe(optional (SetHTMLUnsafeOptions or TrustedParserOptions) options = {});
|
||||
[RuntimeEnabled=NewHTMLSettingMethods, CallWith=ScriptState, RaisesException, MeasureAs=HTMLStreaming] WritableStream streamReplaceWithHTML(optional SetHTMLOptions options = {});
|
||||
[RuntimeEnabled=NewHTMLSettingMethods, CallWith=ScriptState, RaisesException, MeasureAs=HTMLStreaming] WritableStream streamReplaceWithHTMLUnsafe(optional (SetHTMLUnsafeOptions or TrustedParserOptions) options = {});
|
||||
};
|
||||
|
||||
@@ -118,21 +118,18 @@ dictionary SetHTMLUnsafeOptions {
|
||||
[RuntimeEnabled=SanitizerAPI,RaisesException,MeasureAs=SetHTMLUnsafe,CEReactions] void setHTMLUnsafe((TrustedHTML or DOMString) html, SetHTMLUnsafeOptions options);
|
||||
[RuntimeEnabled=TrustedTypesCreateParserOptions,RaisesException,MeasureAs=SetHTMLUnsafe,CEReactions] void setHTMLUnsafe((TrustedHTML or DOMString) html, TrustedParserOptions options);
|
||||
[RuntimeEnabled=SanitizerAPI,RaisesException,MeasureAs=SetHTMLSafe,CEReactions] void setHTML(DOMString html, optional SetHTMLOptions options = {});
|
||||
[RuntimeEnabled=TrustedTypesCreateParserOptions,RaisesException,MeasureAs=SetHTMLSafe,CEReactions] void setHTML(DOMString html, TrustedParserOptions options);
|
||||
|
||||
// https://github.com/whatwg/html/issues/2142
|
||||
// https://github.com/whatwg/html/issues/11542
|
||||
[RuntimeEnabled=DocumentPatching, CallWith=ScriptState, RaisesException] WritableStream streamAppendHTMLUnsafe(optional (SetHTMLUnsafeOptions or TrustedParserOptions) options = {});
|
||||
[RuntimeEnabled=DocumentPatching, CallWith=ScriptState, RaisesException] WritableStream streamHTMLUnsafe(optional (SetHTMLUnsafeOptions or TrustedParserOptions) options = {});
|
||||
[RuntimeEnabled=DocumentPatching, CallWith=ScriptState, RaisesException] WritableStream streamAppendHTML(optional (SetHTMLOptions or TrustedParserOptions) options = {});
|
||||
[RuntimeEnabled=DocumentPatching, CallWith=ScriptState, RaisesException] WritableStream streamHTML(optional (SetHTMLOptions or TrustedParserOptions) options = {});
|
||||
[SameObject, PutForwards=value, RuntimeEnabled=DocumentPatching] readonly attribute DOMTokenList marker;
|
||||
|
||||
// https://github.com/whatwg/html/issues/11669
|
||||
[RuntimeEnabled=DocumentPatching, RaisesException] void appendHTML(DOMString html, optional (SetHTMLOptions or TrustedParserOptions) options = {});
|
||||
[RuntimeEnabled=DocumentPatching, RaisesException] void appendHTMLUnsafe((TrustedHTML or DOMString) html, optional (SetHTMLUnsafeOptions or TrustedParserOptions) options = {});
|
||||
[RuntimeEnabled=DocumentPatching, RaisesException] void prependHTML(DOMString html, optional (SetHTMLOptions or TrustedParserOptions) options = {});
|
||||
[RuntimeEnabled=DocumentPatching, RaisesException] void prependHTMLUnsafe((TrustedHTML or DOMString) html, optional (SetHTMLUnsafeOptions or TrustedParserOptions) options = {});
|
||||
[RuntimeEnabled=NewHTMLSettingMethods, CallWith=ScriptState, RaisesException, MeasureAs=HTMLStreaming] WritableStream streamAppendHTMLUnsafe(optional (SetHTMLUnsafeOptions or TrustedParserOptions) options = {});
|
||||
[RuntimeEnabled=NewHTMLSettingMethods, CallWith=ScriptState, RaisesException, MeasureAs=HTMLStreaming] WritableStream streamHTMLUnsafe(optional (SetHTMLUnsafeOptions or TrustedParserOptions) options = {});
|
||||
[RuntimeEnabled=NewHTMLSettingMethods, CallWith=ScriptState, RaisesException, MeasureAs=HTMLStreaming] WritableStream streamPrependHTMLUnsafe(optional (SetHTMLUnsafeOptions or TrustedParserOptions) options = {});
|
||||
[RuntimeEnabled=NewHTMLSettingMethods, CallWith=ScriptState, RaisesException, MeasureAs=HTMLStreaming] WritableStream streamAppendHTML(optional SetHTMLOptions options = {});
|
||||
[RuntimeEnabled=NewHTMLSettingMethods, CallWith=ScriptState, RaisesException, MeasureAs=HTMLStreaming] WritableStream streamHTML(optional SetHTMLOptions options = {});
|
||||
[RuntimeEnabled=NewHTMLSettingMethods, CallWith=ScriptState, RaisesException, MeasureAs=HTMLStreaming] WritableStream streamPrependHTML(optional SetHTMLOptions options = {});
|
||||
[RuntimeEnabled=NewHTMLSettingMethods, RaisesException, MeasureAs=HTMLPositionalSetters] void appendHTML(DOMString html, optional SetHTMLOptions options = {});
|
||||
[RuntimeEnabled=NewHTMLSettingMethods, RaisesException, MeasureAs=HTMLPositionalSetters] void appendHTMLUnsafe((TrustedHTML or DOMString) html, optional (SetHTMLUnsafeOptions or TrustedParserOptions) options = {});
|
||||
[RuntimeEnabled=NewHTMLSettingMethods, RaisesException, MeasureAs=HTMLPositionalSetters] void prependHTML(DOMString html, optional SetHTMLOptions options = {});
|
||||
[RuntimeEnabled=NewHTMLSettingMethods, RaisesException, MeasureAs=HTMLPositionalSetters] void prependHTMLUnsafe((TrustedHTML or DOMString) html, optional (SetHTMLUnsafeOptions or TrustedParserOptions) options = {});
|
||||
|
||||
// Declarative Shadow DOM getHTML() function.
|
||||
[Affects=Nothing, MeasureAs=ElementGetHTML, RaisesException] DOMString getHTML(optional GetHTMLOptions options = {});
|
||||
|
||||
+4
-1
@@ -80,7 +80,10 @@ interface mixin GlobalEventHandlers {
|
||||
attribute EventHandler onmouseover;
|
||||
attribute EventHandler onmouseup;
|
||||
attribute EventHandler onmousewheel;
|
||||
[RuntimeEnabled=OverscrollGestures] attribute EventHandler onoverscroll;
|
||||
[RuntimeEnabled=OverscrollGestures] attribute EventHandler onoverscrollcancel;
|
||||
[RuntimeEnabled=OverscrollGestures] attribute EventHandler onoverscrollchanging;
|
||||
[RuntimeEnabled=OverscrollGestures] attribute EventHandler onoverscrollend;
|
||||
[RuntimeEnabled=OverscrollGestures] attribute EventHandler onoverscrollstart;
|
||||
attribute EventHandler onpause;
|
||||
attribute EventHandler onplay;
|
||||
attribute EventHandler onplaying;
|
||||
|
||||
+10
-13
@@ -48,8 +48,6 @@ interface ShadowRoot : DocumentFragment {
|
||||
// cloned by DOM cloning operations.
|
||||
readonly attribute boolean clonable;
|
||||
|
||||
[RuntimeEnabled=DocumentPatching] readonly attribute FrozenArray<DOMString> marker;
|
||||
|
||||
// The referenceTarget attribute is the ID of an element in the shadow tree.
|
||||
// When the host element is the target of an IDREF attribute like
|
||||
// aria-activedescendant, the reference resolves to the referenceTarget.
|
||||
@@ -61,19 +59,18 @@ interface ShadowRoot : DocumentFragment {
|
||||
[RuntimeEnabled=SanitizerAPI,RaisesException,MeasureAs=SetHTMLUnsafe,CEReactions] void setHTMLUnsafe((TrustedHTML or DOMString) html, SetHTMLUnsafeOptions options);
|
||||
[RuntimeEnabled=SanitizerAPI,RaisesException,MeasureAs=SetHTMLSafe,CEReactions] void setHTML(DOMString html, optional SetHTMLOptions options = {});
|
||||
[RuntimeEnabled=TrustedTypesCreateParserOptions,RaisesException,MeasureAs=SetHTMLUnsafe,CEReactions] void setHTMLUnsafe((TrustedHTML or DOMString) html, TrustedParserOptions options);
|
||||
[RuntimeEnabled=TrustedTypesCreateParserOptions,RaisesException,MeasureAs=SetHTMLSafe,CEReactions] void setHTML(DOMString html, TrustedParserOptions options);
|
||||
|
||||
// https://github.com/whatwg/html/issues/2142
|
||||
[RuntimeEnabled=DocumentPatching, CallWith=ScriptState, RaisesException] WritableStream streamAppendHTMLUnsafe(optional (SetHTMLUnsafeOptions or TrustedParserOptions) options = {});
|
||||
[RuntimeEnabled=DocumentPatching, CallWith=ScriptState, RaisesException] WritableStream streamHTMLUnsafe(optional (SetHTMLUnsafeOptions or TrustedParserOptions) options = {});
|
||||
[RuntimeEnabled=DocumentPatching, CallWith=ScriptState, RaisesException] WritableStream streamAppendHTML(optional (SetHTMLOptions or TrustedParserOptions) options = {});
|
||||
[RuntimeEnabled=DocumentPatching, CallWith=ScriptState, RaisesException] WritableStream streamHTML(optional (SetHTMLOptions or TrustedParserOptions) options = {});
|
||||
|
||||
// https://github.com/whatwg/html/issues/11669
|
||||
[RuntimeEnabled=DocumentPatching, RaisesException] void appendHTML(DOMString html, optional (SetHTMLOptions or TrustedParserOptions) options = {});
|
||||
[RuntimeEnabled=DocumentPatching, RaisesException] void appendHTMLUnsafe((TrustedHTML or DOMString) html, optional (SetHTMLUnsafeOptions or TrustedParserOptions) options = {});
|
||||
[RuntimeEnabled=DocumentPatching, RaisesException] void prependHTML(DOMString html, optional (SetHTMLOptions or TrustedParserOptions) options = {});
|
||||
[RuntimeEnabled=DocumentPatching, RaisesException] void prependHTMLUnsafe((TrustedHTML or DOMString) html, optional (SetHTMLUnsafeOptions or TrustedParserOptions) options = {});
|
||||
[RuntimeEnabled=NewHTMLSettingMethods, CallWith=ScriptState, RaisesException, MeasureAs=HTMLStreaming] WritableStream streamAppendHTMLUnsafe(optional (SetHTMLUnsafeOptions or TrustedParserOptions) options = {});
|
||||
[RuntimeEnabled=NewHTMLSettingMethods, CallWith=ScriptState, RaisesException, MeasureAs=HTMLStreaming] WritableStream streamHTMLUnsafe(optional (SetHTMLUnsafeOptions or TrustedParserOptions) options = {});
|
||||
[RuntimeEnabled=NewHTMLSettingMethods, CallWith=ScriptState, RaisesException, MeasureAs=HTMLStreaming] WritableStream streamAppendHTML(optional SetHTMLOptions options = {});
|
||||
[RuntimeEnabled=NewHTMLSettingMethods, CallWith=ScriptState, RaisesException, MeasureAs=HTMLStreaming] WritableStream streamHTML(optional SetHTMLOptions options = {});
|
||||
[RuntimeEnabled=NewHTMLSettingMethods, CallWith=ScriptState, RaisesException, MeasureAs=HTMLStreaming] WritableStream streamPrependHTMLUnsafe(optional (SetHTMLUnsafeOptions or TrustedParserOptions) options = {});
|
||||
[RuntimeEnabled=NewHTMLSettingMethods, CallWith=ScriptState, RaisesException, MeasureAs=HTMLStreaming] WritableStream streamPrependHTML(optional SetHTMLOptions options = {});
|
||||
[RuntimeEnabled=NewHTMLSettingMethods, RaisesException, MeasureAs=HTMLPositionalSetters] void appendHTML(DOMString html, optional SetHTMLOptions options = {});
|
||||
[RuntimeEnabled=NewHTMLSettingMethods, RaisesException, MeasureAs=HTMLPositionalSetters] void appendHTMLUnsafe((TrustedHTML or DOMString) html, optional (SetHTMLUnsafeOptions or TrustedParserOptions) options = {});
|
||||
[RuntimeEnabled=NewHTMLSettingMethods, RaisesException, MeasureAs=HTMLPositionalSetters] void prependHTML(DOMString html, optional SetHTMLOptions options = {});
|
||||
[RuntimeEnabled=NewHTMLSettingMethods, RaisesException, MeasureAs=HTMLPositionalSetters] void prependHTMLUnsafe((TrustedHTML or DOMString) html, optional (SetHTMLUnsafeOptions or TrustedParserOptions) options = {});
|
||||
};
|
||||
|
||||
ShadowRoot includes DocumentOrShadowRoot;
|
||||
|
||||
-1
@@ -15,7 +15,6 @@ dictionary ShadowRootInit {
|
||||
boolean serializable;
|
||||
boolean clonable;
|
||||
[RuntimeEnabled=ShadowRootReferenceTarget] DOMString? referenceTarget;
|
||||
[RuntimeEnabled=DocumentPatching] sequence<DOMString> marker;
|
||||
// Note: if you add a parameter here, be sure to add it to the list of checks
|
||||
// in Element::attachShadow() for existing declarative shadow roots.
|
||||
};
|
||||
|
||||
+4
-1
@@ -219,7 +219,10 @@
|
||||
"online",
|
||||
"open",
|
||||
"orientationchange",
|
||||
"overscroll",
|
||||
"overscrollcancel",
|
||||
"overscrollchanging",
|
||||
"overscrollend",
|
||||
"overscrollstart",
|
||||
"pagehide",
|
||||
"pagereveal",
|
||||
"pageshow",
|
||||
|
||||
Vendored
+3
@@ -51,4 +51,7 @@ enum SecurityPolicyViolationEventDisposition {
|
||||
// Contains the hashes of scripts that were blocked from being run through
|
||||
// eval due to unsafe-eval not being set.
|
||||
[RuntimeEnabled=CSPHashesV1] readonly attribute DOMString evalHash;
|
||||
// Contains the hash of the URL of the script that was blocked from being
|
||||
// loaded.
|
||||
[RuntimeEnabled=CSPHashesV1] readonly attribute DOMString urlHash;
|
||||
};
|
||||
|
||||
+1
@@ -25,4 +25,5 @@ dictionary SecurityPolicyViolationEventInit : EventInit {
|
||||
|
||||
DOMString violatedDirective = "";
|
||||
[RuntimeEnabled=CSPHashesV1] DOMString evalHash;
|
||||
[RuntimeEnabled=CSPHashesV1] DOMString urlHash;
|
||||
};
|
||||
|
||||
+53
-77
@@ -35,9 +35,6 @@
|
||||
#include <vector>
|
||||
|
||||
#include "base/command_line.h"
|
||||
#include "base/debug/alias.h"
|
||||
#include "base/debug/crash_logging.h"
|
||||
#include "base/debug/dump_without_crashing.h"
|
||||
#include "base/memory/scoped_refptr.h"
|
||||
#include "base/metrics/histogram_macros.h"
|
||||
#include "base/observer_list.h"
|
||||
@@ -52,7 +49,6 @@
|
||||
#include "third_party/blink/public/common/fingerprinting_protection/noise_token.h"
|
||||
#include "third_party/blink/public/common/history/session_history_constants.h"
|
||||
#include "third_party/blink/public/common/input/web_input_event.h"
|
||||
#include "third_party/blink/public/common/input/web_menu_source_type.h"
|
||||
#include "third_party/blink/public/common/page/color_provider_color_maps.h"
|
||||
#include "third_party/blink/public/common/page/page_zoom.h"
|
||||
#include "third_party/blink/public/common/renderer_preferences/renderer_preferences.h"
|
||||
@@ -193,6 +189,7 @@
|
||||
#include "third_party/blink/renderer/platform/wtf/functional.h"
|
||||
#include "third_party/blink/renderer/platform/wtf/text/string_to_number.h"
|
||||
#include "third_party/icu/source/common/unicode/uscript.h"
|
||||
#include "ui/base/mojom/menu_source_type.mojom-blink.h"
|
||||
#include "ui/base/ui_base_features.h"
|
||||
#include "ui/gfx/geometry/skia_conversions.h"
|
||||
|
||||
@@ -276,43 +273,43 @@ typedef void (*SetFontFamilyWrapper)(blink::WebSettings*,
|
||||
void SetStandardFontFamilyWrapper(WebSettings* settings,
|
||||
const std::u16string& font,
|
||||
UScriptCode script) {
|
||||
settings->SetStandardFontFamily(WebString::FromUTF16(font), script);
|
||||
settings->SetStandardFontFamily(WebString::FromUtf16(font), script);
|
||||
}
|
||||
|
||||
void SetFixedFontFamilyWrapper(WebSettings* settings,
|
||||
const std::u16string& font,
|
||||
UScriptCode script) {
|
||||
settings->SetFixedFontFamily(WebString::FromUTF16(font), script);
|
||||
settings->SetFixedFontFamily(WebString::FromUtf16(font), script);
|
||||
}
|
||||
|
||||
void SetSerifFontFamilyWrapper(WebSettings* settings,
|
||||
const std::u16string& font,
|
||||
UScriptCode script) {
|
||||
settings->SetSerifFontFamily(WebString::FromUTF16(font), script);
|
||||
settings->SetSerifFontFamily(WebString::FromUtf16(font), script);
|
||||
}
|
||||
|
||||
void SetSansSerifFontFamilyWrapper(WebSettings* settings,
|
||||
const std::u16string& font,
|
||||
UScriptCode script) {
|
||||
settings->SetSansSerifFontFamily(WebString::FromUTF16(font), script);
|
||||
settings->SetSansSerifFontFamily(WebString::FromUtf16(font), script);
|
||||
}
|
||||
|
||||
void SetCursiveFontFamilyWrapper(WebSettings* settings,
|
||||
const std::u16string& font,
|
||||
UScriptCode script) {
|
||||
settings->SetCursiveFontFamily(WebString::FromUTF16(font), script);
|
||||
settings->SetCursiveFontFamily(WebString::FromUtf16(font), script);
|
||||
}
|
||||
|
||||
void SetFantasyFontFamilyWrapper(WebSettings* settings,
|
||||
const std::u16string& font,
|
||||
UScriptCode script) {
|
||||
settings->SetFantasyFontFamily(WebString::FromUTF16(font), script);
|
||||
settings->SetFantasyFontFamily(WebString::FromUtf16(font), script);
|
||||
}
|
||||
|
||||
void SetMathFontFamilyWrapper(WebSettings* settings,
|
||||
const std::u16string& font,
|
||||
UScriptCode script) {
|
||||
settings->SetMathFontFamily(WebString::FromUTF16(font), script);
|
||||
settings->SetMathFontFamily(WebString::FromUtf16(font), script);
|
||||
}
|
||||
|
||||
// If |scriptCode| is a member of a family of "similar" script codes, returns
|
||||
@@ -547,20 +544,6 @@ void WebViewImpl::SetNoStatePrefetchClient(
|
||||
}
|
||||
|
||||
void WebViewImpl::CloseWindow() {
|
||||
#if !(BUILDFLAG(IS_ANDROID) || \
|
||||
(BUILDFLAG(IS_CHROMEOS) && defined(ARCH_CPU_ARM64)))
|
||||
auto close_task_trace = close_task_posted_stack_trace_;
|
||||
base::debug::Alias(&close_task_trace);
|
||||
auto close_trace = close_called_stack_trace_;
|
||||
base::debug::Alias(&close_trace);
|
||||
auto prev_close_window_trace = close_window_called_stack_trace_;
|
||||
base::debug::Alias(&prev_close_window_trace);
|
||||
close_window_called_stack_trace_.emplace();
|
||||
auto cur_close_window_trace = close_window_called_stack_trace_;
|
||||
base::debug::Alias(&cur_close_window_trace);
|
||||
#endif
|
||||
SCOPED_CRASH_KEY_BOOL("Bug1499519", "page_exists", !!page_);
|
||||
|
||||
// Have the browser process a close request. We should have either a
|
||||
// |local_main_frame_host_remote_| or |remote_main_frame_host_remote_|.
|
||||
// This method will not execute if Close has been called as WeakPtrs
|
||||
@@ -1069,7 +1052,7 @@ WebInputEventResult WebViewImpl::SendContextMenuEvent() {
|
||||
focused_local_frame->GetDocument()->FocusedElement())
|
||||
focused_element->scrollIntoViewIfNeeded();
|
||||
return focused_local_frame->GetEventHandler().ShowNonLocatedContextMenu(
|
||||
nullptr, kMenuSourceKeyboard);
|
||||
nullptr, ui::mojom::blink::MenuSourceType::kKeyboard);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1182,20 +1165,6 @@ Frame* WebViewImpl::FocusedCoreFrame() const {
|
||||
// WebWidget ------------------------------------------------------------------
|
||||
|
||||
void WebViewImpl::Close() {
|
||||
#if !(BUILDFLAG(IS_ANDROID) || \
|
||||
(BUILDFLAG(IS_CHROMEOS) && defined(ARCH_CPU_ARM64)))
|
||||
auto close_task_trace = close_task_posted_stack_trace_;
|
||||
base::debug::Alias(&close_task_trace);
|
||||
auto prev_close_trace = close_called_stack_trace_;
|
||||
base::debug::Alias(&prev_close_trace);
|
||||
close_called_stack_trace_.emplace();
|
||||
auto cur_close_trace = close_called_stack_trace_;
|
||||
base::debug::Alias(&cur_close_trace);
|
||||
auto close_window_trace = close_window_called_stack_trace_;
|
||||
base::debug::Alias(&close_window_trace);
|
||||
#endif
|
||||
SCOPED_CRASH_KEY_BOOL("Bug1499519", "page_exists", !!page_);
|
||||
|
||||
// Closership is a single relationship, so only 1 call to Close() should
|
||||
// occur.
|
||||
CHECK(page_);
|
||||
@@ -1599,7 +1568,7 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs,
|
||||
settings->SetMinimumFontSize(prefs.minimum_font_size);
|
||||
settings->SetMinimumLogicalFontSize(prefs.minimum_logical_font_size);
|
||||
settings->SetDefaultTextEncodingName(
|
||||
WebString::FromASCII(prefs.default_encoding));
|
||||
WebString::FromAscii(prefs.default_encoding));
|
||||
settings->SetJavaScriptEnabled(prefs.javascript_enabled);
|
||||
settings->SetWebSecurityEnabled(prefs.web_security_enabled);
|
||||
settings->SetLoadsImagesAutomatically(prefs.loads_images_automatically);
|
||||
@@ -1608,8 +1577,8 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs,
|
||||
settings->SetDOMPasteAllowed(prefs.dom_paste_enabled);
|
||||
settings->SetTextAreasAreResizable(prefs.text_areas_are_resizable);
|
||||
settings->SetAllowScriptsToCloseWindows(prefs.allow_scripts_to_close_windows);
|
||||
settings->SetAllowWindowFocusWithoutUserGesture(
|
||||
prefs.allow_window_focus_without_user_gesture);
|
||||
settings->SetAllowUnrestrictedWindowFocus(
|
||||
prefs.allow_unrestricted_window_focus);
|
||||
settings->SetDownloadableBinaryFontsEnabled(prefs.remote_fonts_enabled);
|
||||
settings->SetJavaScriptCanAccessClipboard(
|
||||
prefs.javascript_can_access_clipboard);
|
||||
@@ -1733,24 +1702,24 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs,
|
||||
WebSettings::TextTrackKindUserPreference::kDefault);
|
||||
}
|
||||
settings->SetTextTrackBackgroundColor(
|
||||
WebString::FromASCII(prefs.text_track_background_color));
|
||||
WebString::FromAscii(prefs.text_track_background_color));
|
||||
settings->SetTextTrackTextColor(
|
||||
WebString::FromASCII(prefs.text_track_text_color));
|
||||
WebString::FromAscii(prefs.text_track_text_color));
|
||||
settings->SetTextTrackTextSize(
|
||||
WebString::FromASCII(prefs.text_track_text_size));
|
||||
WebString::FromAscii(prefs.text_track_text_size));
|
||||
settings->SetTextTrackTextShadow(
|
||||
WebString::FromASCII(prefs.text_track_text_shadow));
|
||||
WebString::FromAscii(prefs.text_track_text_shadow));
|
||||
settings->SetTextTrackFontFamily(
|
||||
WebString::FromASCII(prefs.text_track_font_family));
|
||||
WebString::FromAscii(prefs.text_track_font_family));
|
||||
settings->SetTextTrackFontStyle(
|
||||
WebString::FromASCII(prefs.text_track_font_style));
|
||||
WebString::FromAscii(prefs.text_track_font_style));
|
||||
settings->SetTextTrackFontVariant(
|
||||
WebString::FromASCII(prefs.text_track_font_variant));
|
||||
WebString::FromAscii(prefs.text_track_font_variant));
|
||||
settings->SetTextTrackMarginPercentage(prefs.text_track_margin_percentage);
|
||||
settings->SetTextTrackWindowColor(
|
||||
WebString::FromASCII(prefs.text_track_window_color));
|
||||
WebString::FromAscii(prefs.text_track_window_color));
|
||||
settings->SetTextTrackWindowRadius(
|
||||
WebString::FromASCII(prefs.text_track_window_radius));
|
||||
WebString::FromAscii(prefs.text_track_window_radius));
|
||||
|
||||
// Needs to happen before SetDefaultPageScaleLimits below since that'll
|
||||
// recalculate the final page scale limits and that depends on this setting.
|
||||
@@ -1770,7 +1739,7 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs,
|
||||
|
||||
settings->SetDontSendKeyEventsToJavascript(
|
||||
prefs.dont_send_key_events_to_javascript);
|
||||
settings->SetWebAppScope(WebString::FromASCII(prefs.web_app_scope.spec()));
|
||||
settings->SetWebAppScope(WebString::FromAscii(prefs.web_app_scope.spec()));
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
settings->SetAllowCustomScrollbarInMainFrame(false);
|
||||
@@ -1781,7 +1750,7 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs,
|
||||
settings->SetDeviceScaleAdjustment(prefs.device_scale_adjustment);
|
||||
web_view_impl->SetIgnoreViewportTagScaleLimits(prefs.force_enable_zoom);
|
||||
settings->SetDefaultVideoPosterURL(
|
||||
WebString::FromASCII(prefs.default_video_poster_url.spec()));
|
||||
WebString::FromAscii(prefs.default_video_poster_url.spec()));
|
||||
settings->SetSupportDeprecatedTargetDensityDPI(
|
||||
prefs.support_deprecated_target_density_dpi);
|
||||
settings->SetWideViewportQuirkEnabled(prefs.wide_viewport_quirk);
|
||||
@@ -2531,8 +2500,10 @@ void WebViewImpl::SetPageLifecycleStateInternal(
|
||||
(new_state->pagehide_dispatch !=
|
||||
mojom::blink::PagehideDispatch::kNotDispatched) &&
|
||||
!GetPage()->DispatchedPagehideAndStillHidden();
|
||||
bool dispatching_pageshow =
|
||||
last_page_lifecycle_state_update_restored_from_bfcache_ =
|
||||
IsRestoredFromBackForwardCache(old_state, new_state);
|
||||
bool dispatching_pageshow =
|
||||
last_page_lifecycle_state_update_restored_from_bfcache_;
|
||||
bool eviction_changed =
|
||||
new_state->eviction_enabled != old_state->eviction_enabled;
|
||||
|
||||
@@ -2818,11 +2789,9 @@ void ValidatePausedStateConsistency() {
|
||||
if (!window) {
|
||||
continue;
|
||||
}
|
||||
const bool microtasks_are_paused = window->GetAgent()
|
||||
->event_loop()
|
||||
->microtask_queue()
|
||||
->GetMicrotasksScopeDepth();
|
||||
CHECK(!microtasks_are_paused, base::NotFatalUntil::M148);
|
||||
const bool microtasks_are_paused =
|
||||
window->GetAgent()->event_loop()->AreMicrotasksPaused();
|
||||
CHECK(!microtasks_are_paused, base::NotFatalUntil::M150);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3159,6 +3128,20 @@ void WebViewImpl::DidAccessInitialMainDocument() {
|
||||
local_main_frame_host_remote_->DidAccessInitialMainDocument();
|
||||
}
|
||||
|
||||
void WebViewImpl::DidChangeThemeColor(std::optional<SkColor> theme_color) {
|
||||
// This is only called for main frames, so the remote must be bound.
|
||||
CHECK(local_main_frame_host_remote_);
|
||||
local_main_frame_host_remote_->DidChangeThemeColor(theme_color);
|
||||
}
|
||||
|
||||
void WebViewImpl::DidChangeBackgroundColor(SkColor4f background_color,
|
||||
bool color_adjust) {
|
||||
// This is only called for main frames, so the remote must be bound.
|
||||
CHECK(local_main_frame_host_remote_);
|
||||
local_main_frame_host_remote_->DidChangeBackgroundColor(background_color,
|
||||
color_adjust);
|
||||
}
|
||||
|
||||
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
|
||||
// TODO(https://crbug.com/40946306): Add timeouts to the callbacks and consider
|
||||
// queuing requests instead of rejecting them.
|
||||
@@ -3404,6 +3387,10 @@ void WebViewImpl::ResetScaleStateImmediately() {
|
||||
}
|
||||
|
||||
void WebViewImpl::ResetScrollAndScaleState() {
|
||||
// Skip scroll restoration when restoring from back-forward cache.
|
||||
if (last_page_lifecycle_state_update_restored_from_bfcache_) {
|
||||
return;
|
||||
}
|
||||
GetPage()->GetVisualViewport().Reset();
|
||||
|
||||
auto* main_local_frame = DynamicTo<LocalFrame>(GetPage()->MainFrame());
|
||||
@@ -3603,14 +3590,14 @@ void WebViewImpl::UpdateFontRenderingFromRendererPrefs() {
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
// Cache the system font metrics in blink.
|
||||
WebFontRendering::SetMenuFontMetrics(
|
||||
WebString::FromUTF16(renderer_preferences_.menu_font_family_name),
|
||||
WebString::FromUtf16(renderer_preferences_.menu_font_family_name),
|
||||
renderer_preferences_.menu_font_height);
|
||||
WebFontRendering::SetSmallCaptionFontMetrics(
|
||||
WebString::FromUTF16(
|
||||
WebString::FromUtf16(
|
||||
renderer_preferences_.small_caption_font_family_name),
|
||||
renderer_preferences_.small_caption_font_height);
|
||||
WebFontRendering::SetStatusFontMetrics(
|
||||
WebString::FromUTF16(renderer_preferences_.status_font_family_name),
|
||||
WebString::FromUtf16(renderer_preferences_.status_font_family_name),
|
||||
renderer_preferences_.status_font_height);
|
||||
WebFontRendering::SetAntialiasedTextEnabled(
|
||||
renderer_preferences_.should_antialias_text);
|
||||
@@ -3757,10 +3744,10 @@ void WebViewImpl::UpdateRendererPreferences(
|
||||
|
||||
if (old_accept_languages != renderer_preferences_.accept_languages) {
|
||||
FontCache::AcceptLanguagesChanged(
|
||||
String::FromUTF8(renderer_preferences_.accept_languages));
|
||||
String::FromUtf8(renderer_preferences_.accept_languages));
|
||||
if (GetPage()) {
|
||||
GetPage()->GetSettings().SetAcceptLanguages(
|
||||
String::FromUTF8(renderer_preferences_.accept_languages));
|
||||
String::FromUtf8(renderer_preferences_.accept_languages));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3915,6 +3902,7 @@ void WebViewImpl::DidCommitLoad(bool is_new_navigation,
|
||||
GetPageScaleConstraintsSet().SetNeedsReset(true);
|
||||
}
|
||||
|
||||
last_page_lifecycle_state_update_restored_from_bfcache_ = false;
|
||||
// Give the visual viewport's scroll layer its initial size.
|
||||
GetPage()->GetVisualViewport().MainFrameDidChangeSize();
|
||||
}
|
||||
@@ -4313,18 +4301,6 @@ void WebViewImpl::DraggableRegionsChanged() {
|
||||
}
|
||||
|
||||
void WebViewImpl::MojoDisconnected() {
|
||||
#if !(BUILDFLAG(IS_ANDROID) || \
|
||||
(BUILDFLAG(IS_CHROMEOS) && defined(ARCH_CPU_ARM64)))
|
||||
auto prev_close_task_trace = close_task_posted_stack_trace_;
|
||||
base::debug::Alias(&prev_close_task_trace);
|
||||
close_task_posted_stack_trace_.emplace();
|
||||
auto cur_close_task_trace = close_task_posted_stack_trace_;
|
||||
base::debug::Alias(&cur_close_task_trace);
|
||||
auto close_trace = close_called_stack_trace_;
|
||||
base::debug::Alias(&close_trace);
|
||||
auto close_window_trace = close_window_called_stack_trace_;
|
||||
base::debug::Alias(&close_window_trace);
|
||||
#endif
|
||||
// This IPC can be called from re-entrant contexts. We can't destroy a
|
||||
// RenderViewImpl while references still exist on the stack, so we dispatch a
|
||||
// non-nestable task. This method is called exactly once by the browser
|
||||
|
||||
Vendored
+2
@@ -18,5 +18,7 @@
|
||||
readonly attribute unsigned short statusCode;
|
||||
readonly attribute unsigned long? lineNumber;
|
||||
readonly attribute unsigned long? columnNumber;
|
||||
[RuntimeEnabled=CSPHashesV1] readonly attribute DOMString? urlHash;
|
||||
[RuntimeEnabled=CSPHashesV1] readonly attribute DOMString? evalHash;
|
||||
[CallWith=ScriptState] object toJSON(optional DOMString key);
|
||||
};
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
[CallWith=Isolate, CrossOrigin, RaisesException, LegacyUnforgeable] void replace(USVString url);
|
||||
[LegacyUnforgeable] void reload();
|
||||
|
||||
// TODO(foolip): |ancestorOrigins| should have [LegacyUnforgeable, SameObject].
|
||||
[LegacyUnforgeable] readonly attribute DOMStringList ancestorOrigins;
|
||||
|
||||
[SetterCallWith=Isolate, CrossOrigin=Setter, RaisesException=Setter, LegacyUnforgeable] attribute USVString href;
|
||||
|
||||
+6
-1
@@ -197,8 +197,13 @@
|
||||
name: "allowScriptsToCloseWindows",
|
||||
initial: false,
|
||||
},
|
||||
|
||||
// Allows a window to focus itself or other windows programmatically
|
||||
// without requiring a user gesture.
|
||||
// This is primarily intended for Isolated Web Apps (IWAs) with the
|
||||
// to allow them to manage window focus order like native applications.
|
||||
{
|
||||
name: "allowWindowFocusWithoutUserGesture",
|
||||
name: "allowUnrestrictedWindowFocus",
|
||||
initial: false,
|
||||
},
|
||||
|
||||
|
||||
-4
@@ -15,8 +15,4 @@ enum HighlightType {
|
||||
setlike<AbstractRange>;
|
||||
attribute long priority;
|
||||
attribute HighlightType type;
|
||||
// TODO(crbug.com/1344319): Inherit from EventTarget
|
||||
[RuntimeEnabled = HighlightPointerEvents] void addEventListener(DOMString type, EventListener? listener, optional (AddEventListenerOptions or boolean) options);
|
||||
[RuntimeEnabled = HighlightPointerEvents] void removeEventListener(DOMString type, EventListener? listener, optional (EventListenerOptions or boolean) options);
|
||||
[ImplementedAs=dispatchEventForBindings, RaisesException, RuntimeCallStatsCounter=EventTargetDispatchEvent, RuntimeEnabled = HighlightPointerEvents] boolean dispatchEvent(Event event);
|
||||
};
|
||||
|
||||
Vendored
-14
@@ -1,14 +0,0 @@
|
||||
// Copyright 2022 The Chromium Authors
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
dictionary HighlightPointerEventInit : PointerEventInit {
|
||||
Range? range = null;
|
||||
};
|
||||
|
||||
[
|
||||
RuntimeEnabled = HighlightPointerEvents,
|
||||
Exposed = Window
|
||||
] interface HighlightPointerEvent : PointerEvent {
|
||||
readonly attribute Range? range;
|
||||
};
|
||||
Vendored
Executable
+12
@@ -0,0 +1,12 @@
|
||||
// Copyright 2026 The Chromium Authors
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
[RuntimeEnabled=CanvasDrawElement, Exposed=(Window,Worker), Transferable]
|
||||
interface ElementImage {
|
||||
// dimensions in canvas output bitmap pixels
|
||||
readonly attribute unsigned long width;
|
||||
readonly attribute unsigned long height;
|
||||
|
||||
void close();
|
||||
};
|
||||
Vendored
+2
-1
@@ -39,7 +39,8 @@
|
||||
[RuntimeEnabled=CanvasDrawElement] attribute boolean layoutSubtree;
|
||||
[RuntimeEnabled=CanvasDrawElement] attribute EventHandler onpaint;
|
||||
[RuntimeEnabled=CanvasDrawElement] void requestPaint();
|
||||
[RuntimeEnabled=CanvasDrawElement, RaisesException] DOMMatrix getElementTransform(Element element, DOMMatrix draw_transform);
|
||||
[RuntimeEnabled=CanvasDrawElement, RaisesException] DOMMatrix getElementTransform((Element or ElementImage) element, DOMMatrix draw_transform);
|
||||
[RuntimeEnabled=CanvasDrawElement, RaisesException] ElementImage captureElementImage(Element element);
|
||||
|
||||
[MeasureAs=CanvasToDataURL, RaisesException] DOMString toDataURL(optional DOMString type = "image/png", optional any quality);
|
||||
|
||||
|
||||
Vendored
Executable
+9
@@ -0,0 +1,9 @@
|
||||
// Copyright 2026 The Chromium Authors
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Options for HTMLElement.attachInternals().
|
||||
|
||||
dictionary AttachInternalsOptions {
|
||||
[RuntimeEnabled=ElementInternalsBehaviors] sequence<ElementBehavior> behaviors;
|
||||
};
|
||||
+4
@@ -36,5 +36,9 @@ interface ElementInternals {
|
||||
// Access to shadowRoot from custom elements. See crbug.com/1042130 and
|
||||
// https://github.com/w3c/webcomponents/issues/871#issuecomment-672082936
|
||||
[MeasureAs=ElementInternalsShadowRoot] readonly attribute ShadowRoot? shadowRoot;
|
||||
|
||||
// Platform-provided behaviors.
|
||||
// https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/PlatformProvidedBehaviors/explainer.md
|
||||
[RuntimeEnabled=ElementInternalsBehaviors] readonly attribute FrozenArray<ElementBehavior> behaviors;
|
||||
};
|
||||
|
||||
|
||||
Vendored
Executable
+14
@@ -0,0 +1,14 @@
|
||||
// Copyright 2026 The Chromium Authors
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Platform-provided behavior base interface.
|
||||
// Behaviors can be attached to custom elements via
|
||||
// attachInternals({ behaviors: [...] }).
|
||||
// https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/PlatformProvidedBehaviors/explainer.md
|
||||
[
|
||||
Exposed=Window,
|
||||
RuntimeEnabled=ElementInternalsBehaviors
|
||||
]
|
||||
interface ElementBehavior {
|
||||
};
|
||||
tools/under-control/src/third_party/blink/renderer/core/html/forms/html_form_controls_collection.idl
Vendored
+1
-1
@@ -24,7 +24,7 @@
|
||||
[Exposed=Window]
|
||||
interface HTMLFormControlsCollection : HTMLCollection {
|
||||
// inherits length and item()
|
||||
[ImplementedAs=namedGetter] getter (RadioNodeList or Element)? namedItem(DOMString name); // shadows inherited namedItem()
|
||||
[ImplementedAs=namedGetter, CallWith=ScriptState] getter (RadioNodeList or Element)? namedItem(DOMString name); // shadows inherited namedItem()
|
||||
// FIXME: This getter is not in the spec.
|
||||
[ImplementedAs=item] getter Node (unsigned long index);
|
||||
};
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@
|
||||
readonly attribute long length;
|
||||
[ImplementedAs=item] getter Element (unsigned long index);
|
||||
// FIXME: This getter should not have [NotEnumerable].
|
||||
[NotEnumerable] getter (RadioNodeList or Element) (DOMString name);
|
||||
[NotEnumerable, CallWith=ScriptState] getter (RadioNodeList or Element) (DOMString name);
|
||||
|
||||
[ImplementedAs=submitFromJavaScript] void submit();
|
||||
[RaisesException] void requestSubmit(optional HTMLElement? submitter = null);
|
||||
|
||||
Vendored
Executable
+25
@@ -0,0 +1,25 @@
|
||||
// Copyright 2026 The Chromium Authors
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// HTMLSubmitButtonBehavior provides submit button behavior to
|
||||
// custom elements.
|
||||
// https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/PlatformProvidedBehaviors/explainer.md
|
||||
[
|
||||
Exposed=Window,
|
||||
RuntimeEnabled=ElementInternalsBehaviors
|
||||
]
|
||||
interface HTMLSubmitButtonBehavior : ElementBehavior {
|
||||
[CallWith=ExecutionContext] constructor();
|
||||
|
||||
attribute boolean disabled;
|
||||
[RaisesException] readonly attribute HTMLFormElement? form;
|
||||
attribute USVString formAction;
|
||||
attribute DOMString formEnctype;
|
||||
attribute DOMString formMethod;
|
||||
attribute boolean formNoValidate;
|
||||
attribute DOMString formTarget;
|
||||
[RaisesException] readonly attribute NodeList labels;
|
||||
attribute DOMString name;
|
||||
attribute DOMString value;
|
||||
};
|
||||
+2
-2
@@ -30,7 +30,7 @@
|
||||
[CEReactions] attribute DOMString dir;
|
||||
|
||||
// user interaction
|
||||
[CEReactions] attribute (boolean or unrestricted double or DOMString)? hidden;
|
||||
[CEReactions, GetterCallWith=ScriptState] attribute (boolean or unrestricted double or DOMString)? hidden;
|
||||
|
||||
[RuntimeCallStatsCounter=HTMLElementClick] void click();
|
||||
[CEReactions, Reflect] attribute boolean inert;
|
||||
@@ -40,7 +40,7 @@
|
||||
[CEReactions] attribute boolean spellcheck;
|
||||
[Measure] attribute DOMString autocapitalize;
|
||||
|
||||
[RaisesException] ElementInternals attachInternals();
|
||||
[RaisesException] ElementInternals attachInternals(optional AttachInternalsOptions options);
|
||||
|
||||
// EditContext
|
||||
// https://w3c.github.io/edit-context/
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@
|
||||
[CEReactions] attribute boolean async;
|
||||
[CEReactions, Reflect] attribute boolean defer;
|
||||
[CEReactions, Reflect, ReflectOnly=("anonymous","use-credentials"), ReflectEmpty="anonymous", ReflectInvalid="anonymous"] attribute DOMString? crossOrigin;
|
||||
[CEReactions, RaisesException=Setter] attribute (TrustedScript or DOMString) text;
|
||||
[CEReactions, RaisesException=Setter, GetterCallWith=ScriptState] attribute (TrustedScript or DOMString) text;
|
||||
[CEReactions, Reflect, ReflectOnly=("", "no-referrer", "no-referrer-when-downgrade", "same-origin", "origin", "strict-origin", "origin-when-cross-origin", "strict-origin-when-cross-origin", "unsafe-url"), ReflectMissing="", ReflectInvalid=""] attribute DOMString? referrerPolicy;
|
||||
[CEReactions, MeasureAs=PriorityHints, Reflect, ReflectOnly=("low", "auto", "high"), ReflectMissing="auto", ReflectInvalid="auto"] attribute DOMString fetchPriority;
|
||||
|
||||
|
||||
+3
@@ -48,4 +48,7 @@
|
||||
|
||||
// Used by Scoped Element Registries
|
||||
[CEReactions, Reflect, RuntimeEnabled=ScopedCustomElementRegistry] attribute DOMString shadowRootCustomElementRegistry;
|
||||
|
||||
// Used by document patching
|
||||
[CEReactions, Reflect=for, RuntimeEnabled=DocumentPatching] attribute DOMString htmlFor;
|
||||
};
|
||||
|
||||
+6
@@ -6,6 +6,12 @@
|
||||
[RuntimeEnabled=UserMediaElement, Exposed=Window]
|
||||
interface HTMLUserMediaElement : HTMLElement {
|
||||
[HTMLConstructor] constructor();
|
||||
|
||||
// Legacy migration support: presence of this attribute indicates the legacy
|
||||
// behavior. When the 'type' attribute is explicitly defined, the element
|
||||
// falls back to legacy behavior, the same as the legacy <permission> element.
|
||||
// TODO(crbug.com/493632110): Deprecate `type` attribute once the adoption of
|
||||
// <usermedia> element is stable.
|
||||
[CEReactions, Reflect] attribute DOMString type;
|
||||
attribute EventHandler onstream;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user