Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fc26f22da2 | ||
|
|
cdf415cc86 | ||
|
|
cb3baf14f5 |
@@ -178,8 +178,6 @@ jobs:
|
||||
cp $OUTPUTFILE_LIN/product_logo_48.png chrome-lin/
|
||||
cp $OUTPUTFILE_LIN/resources.pak chrome-lin/
|
||||
cp $OUTPUTFILE_LIN/snapshot_blob.bin chrome-lin/
|
||||
cp $OUTPUTFILE_LIN/xdg-mime chrome-lin/
|
||||
cp $OUTPUTFILE_LIN/xdg-settings chrome-lin/
|
||||
cp $OUTPUTFILE_LIN/chrome_sandbox chrome-lin/
|
||||
|
||||
tar -czvf chrome-lin64.tar.gz chrome-lin/
|
||||
|
||||
@@ -18,14 +18,16 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
chrome/browser/ui/BUILD.gn | 2 +-
|
||||
.../strings/android_chrome_strings.grd | 3 -
|
||||
...translation_internals_page_handler_impl.cc | 8 +
|
||||
components/live_caption/BUILD.gn | 3 +
|
||||
components/live_caption/features.cc | 1 +
|
||||
.../buildflags/features.gni | 2 +-
|
||||
.../public/mojom/BUILD.gn | 2 +-
|
||||
.../core/browser/translate_manager.cc | 5 +-
|
||||
.../core/browser/translate_script.cc | 17 +-
|
||||
...n_device_speech_recognition_engine_impl.cc | 3 +-
|
||||
...on_device_speech_recognition_engine_impl.h | 2 +
|
||||
media/base/media_switches.cc | 1 +
|
||||
19 files changed, 32 insertions(+), 224 deletions(-)
|
||||
21 files changed, 36 insertions(+), 225 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
|
||||
--- a/chrome/browser/BUILD.gn
|
||||
@@ -458,6 +460,19 @@ diff --git a/chrome/browser/ui/webui/on_device_translation_internals/on_device_t
|
||||
page_->OnLanguagePackStatus(std::move(info_list));
|
||||
}
|
||||
|
||||
diff --git a/components/live_caption/BUILD.gn b/components/live_caption/BUILD.gn
|
||||
--- a/components/live_caption/BUILD.gn
|
||||
+++ b/components/live_caption/BUILD.gn
|
||||
@@ -109,6 +109,9 @@ if (!is_android && !is_ios) {
|
||||
"//ui/native_theme",
|
||||
]
|
||||
|
||||
+ public_deps += [
|
||||
+ "//components/on_device_translation/public/mojom",
|
||||
+ ]
|
||||
if (enable_on_device_translation) {
|
||||
sources += [
|
||||
"translation_dispatcher_on_device.cc",
|
||||
diff --git a/components/live_caption/features.cc b/components/live_caption/features.cc
|
||||
--- a/components/live_caption/features.cc
|
||||
+++ b/components/live_caption/features.cc
|
||||
@@ -478,6 +493,18 @@ diff --git a/components/on_device_translation/buildflags/features.gni b/componen
|
||||
- enable_on_device_translation = is_mac || is_win || is_linux || is_chromeos
|
||||
+ enable_on_device_translation = false
|
||||
}
|
||||
diff --git a/components/on_device_translation/public/mojom/BUILD.gn b/components/on_device_translation/public/mojom/BUILD.gn
|
||||
--- a/components/on_device_translation/public/mojom/BUILD.gn
|
||||
+++ b/components/on_device_translation/public/mojom/BUILD.gn
|
||||
@@ -5,7 +5,7 @@
|
||||
import("//components/on_device_translation/buildflags/features.gni")
|
||||
import("//mojo/public/tools/bindings/mojom.gni")
|
||||
|
||||
-assert(enable_on_device_translation)
|
||||
+# assert(enable_on_device_translation)
|
||||
|
||||
mojom("mojom") {
|
||||
sources = [
|
||||
diff --git a/components/translate/core/browser/translate_manager.cc b/components/translate/core/browser/translate_manager.cc
|
||||
--- a/components/translate/core/browser/translate_manager.cc
|
||||
+++ b/components/translate/core/browser/translate_manager.cc
|
||||
|
||||
@@ -1 +1 @@
|
||||
147.0.7727.102
|
||||
149.0.7827.59
|
||||
|
||||
@@ -31,6 +31,9 @@
|
||||
#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_manager_client.h"
|
||||
#include "android_webview/browser/content_restriction/aw_content_restriction_navigation_throttle.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"
|
||||
@@ -732,7 +735,7 @@ void AwContentBrowserClient::CreateThrottlesForNavigation(
|
||||
if ((navigation_handle.GetNavigatingFrameType() ==
|
||||
FrameType::kPrimaryMainFrame ||
|
||||
navigation_handle.GetNavigatingFrameType() == FrameType::kSubframe) &&
|
||||
registry.IsHTTPOrHTTPS()) {
|
||||
registry.GetNavigationHandle().GetURL().SchemeIsHTTPOrHTTPS()) {
|
||||
AwSupervisedUserUrlClassifier* urlClassifier =
|
||||
AwSupervisedUserUrlClassifier::GetInstance();
|
||||
if (urlClassifier->ShouldCreateThrottle()) {
|
||||
@@ -740,6 +743,14 @@ void AwContentBrowserClient::CreateThrottlesForNavigation(
|
||||
std::make_unique<AwSupervisedUserThrottle>(registry, urlClassifier));
|
||||
}
|
||||
}
|
||||
|
||||
if (base::FeatureList::IsEnabled(
|
||||
android_webview::features::kWebViewContentRestrictionSupport)) {
|
||||
registry.AddThrottle(
|
||||
std::make_unique<AwContentRestrictionNavigationThrottle>(
|
||||
registry,
|
||||
context->GetContentRestrictionBlockedNavigationTracker()));
|
||||
}
|
||||
}
|
||||
|
||||
std::unique_ptr<content::PrefetchServiceDelegate>
|
||||
@@ -794,6 +805,17 @@ AwContentBrowserClient::CreateURLLoaderThrottles(
|
||||
/* async_check_tracker */ async_check_tracker,
|
||||
/*referring_app_info=*/std::nullopt));
|
||||
|
||||
if (browser_context &&
|
||||
base::FeatureList::IsEnabled(
|
||||
android_webview::features::kWebViewContentRestrictionSupport)) {
|
||||
AwBrowserContext* const aw_browser_context =
|
||||
static_cast<AwBrowserContext*>(browser_context);
|
||||
result.push_back(std::make_unique<AwContentRestrictionURLLoaderThrottle>(
|
||||
aw_browser_context->GetContentRestrictionManagerClient(),
|
||||
aw_browser_context->GetContentRestrictionBlockedNavigationTracker(),
|
||||
navigation_id));
|
||||
}
|
||||
|
||||
if (request.destination == network::mojom::RequestDestination::kDocument) {
|
||||
const bool is_load_url =
|
||||
request.transition_type & ui::PAGE_TRANSITION_FROM_API;
|
||||
@@ -1488,7 +1510,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(
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include "third_party/blink/public/common/features.h"
|
||||
#include "third_party/blink/public/common/features_generated.h"
|
||||
#include "ui/android/ui_android_features.h"
|
||||
#include "ui/base/ui_base_features.h"
|
||||
#include "ui/gl/gl_features.h"
|
||||
#include "ui/gl/gl_switches.h"
|
||||
|
||||
@@ -71,6 +70,13 @@ void AwFieldTrials::RegisterFeatureOverrides(base::FeatureList* feature_list) {
|
||||
aw_feature_overrides.DisableFeature(
|
||||
input::features::kUpdateScrollPredictorInputMapping);
|
||||
|
||||
// InputVizard is disabled on WebView as it is a Chrome-only feature that
|
||||
// moves input handling to the VizCompositor thread, which is out of scope
|
||||
// for WebView's Synchronous Compositor architecture.
|
||||
aw_feature_overrides.DisableFeature(input::features::kInputOnViz);
|
||||
aw_feature_overrides.DisableFeature(
|
||||
input::features::kInputVizardSpeculativeTransfer);
|
||||
|
||||
// Disable enforcing `noopener` on Blob URL navigations on WebView.
|
||||
aw_feature_overrides.DisableFeature(
|
||||
blink::features::kEnforceNoopenerOnBlobURLNavigation);
|
||||
@@ -101,9 +107,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);
|
||||
@@ -114,11 +118,6 @@ void AwFieldTrials::RegisterFeatureOverrides(base::FeatureList* feature_list) {
|
||||
// Disable scrollbar-width on WebView.
|
||||
aw_feature_overrides.DisableFeature(blink::features::kScrollbarWidth);
|
||||
|
||||
// TODO(crbug.com/402144902): Remove this once webview experiment has
|
||||
// concluded.
|
||||
aw_feature_overrides.DisableFeature(
|
||||
::features::kSendEmptyGestureScrollUpdate);
|
||||
|
||||
// Disable Populating the VisitedLinkDatabase on WebView.
|
||||
aw_feature_overrides.DisableFeature(history::kPopulateVisitedLinkDatabase);
|
||||
|
||||
@@ -326,12 +325,18 @@ 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(
|
||||
::features::kVizDirectCompositorThreadIpcFrameSinkManager);
|
||||
|
||||
// TODO(crbug.com/441800312): Enable this once WebView experiment has
|
||||
// concluded.
|
||||
aw_feature_overrides.DisableFeature(
|
||||
blink::features::kUnthrottleAsyncTouchMoves);
|
||||
|
||||
// Disable `PrefetchRequestStatusListenerAsync` on WebView to run an
|
||||
// experiment on WebView.
|
||||
aw_feature_overrides.DisableFeature(
|
||||
::features::kPrefetchRequestStatusListenerAsync);
|
||||
}
|
||||
|
||||
+176
-21
@@ -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
|
||||
@@ -554,6 +556,7 @@ interface CSSConditionRule : CSSGroupingRule
|
||||
method constructor
|
||||
interface CSSContainerRule : CSSConditionRule
|
||||
attribute @@toStringTag
|
||||
getter conditions
|
||||
getter containerName
|
||||
getter containerQuery
|
||||
method constructor
|
||||
@@ -1262,7 +1265,6 @@ interface CanvasRenderingContext2D
|
||||
method createMesh2DVertexBuffer
|
||||
method createPattern
|
||||
method createRadialGradient
|
||||
method drawElement
|
||||
method drawElementImage
|
||||
method drawFocusIfNeeded
|
||||
method drawImage
|
||||
@@ -1377,6 +1379,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
|
||||
@@ -1449,6 +1457,10 @@ interface ContactsManager
|
||||
method constructor
|
||||
method getProperties
|
||||
method select
|
||||
interface ContainerQueryList : EventTarget
|
||||
attribute @@toStringTag
|
||||
getter matches
|
||||
method constructor
|
||||
interface ContentIndex
|
||||
attribute @@toStringTag
|
||||
method add
|
||||
@@ -1503,6 +1515,7 @@ interface CreateMonitor : EventTarget
|
||||
method constructor
|
||||
setter ondownloadprogress
|
||||
interface Credential
|
||||
static method isConditionalMediationAvailable
|
||||
attribute @@toStringTag
|
||||
getter id
|
||||
getter type
|
||||
@@ -1950,6 +1963,7 @@ interface Document : Node
|
||||
getter onauxclick
|
||||
getter onbeforecopy
|
||||
getter onbeforecut
|
||||
getter onbeforefilter
|
||||
getter onbeforeinput
|
||||
getter onbeforematch
|
||||
getter onbeforepaste
|
||||
@@ -2006,7 +2020,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
|
||||
@@ -2176,6 +2193,7 @@ interface Document : Node
|
||||
setter onauxclick
|
||||
setter onbeforecopy
|
||||
setter onbeforecut
|
||||
setter onbeforefilter
|
||||
setter onbeforeinput
|
||||
setter onbeforematch
|
||||
setter onbeforepaste
|
||||
@@ -2232,7 +2250,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 +2350,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 +2473,6 @@ interface Element : Node
|
||||
getter innerHTML
|
||||
getter lastElementChild
|
||||
getter localName
|
||||
getter marker
|
||||
getter namespaceURI
|
||||
getter nextElementSibling
|
||||
getter onbeforecopy
|
||||
@@ -2504,6 +2530,7 @@ interface Element : Node
|
||||
method insertAdjacentElement
|
||||
method insertAdjacentHTML
|
||||
method insertAdjacentText
|
||||
method matchContainer
|
||||
method matches
|
||||
method moveBefore
|
||||
method prepend
|
||||
@@ -2536,10 +2563,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 +2640,6 @@ interface Element : Node
|
||||
setter headingReset
|
||||
setter id
|
||||
setter innerHTML
|
||||
setter marker
|
||||
setter onbeforecopy
|
||||
setter onbeforecut
|
||||
setter onbeforepaste
|
||||
@@ -2620,6 +2654,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 +2717,7 @@ interface ElementInternals
|
||||
getter ariaValueNow
|
||||
getter ariaValueText
|
||||
getter ariaVirtualContent
|
||||
getter behaviors
|
||||
getter form
|
||||
getter labels
|
||||
getter role
|
||||
@@ -3414,6 +3458,10 @@ interface GeolocationCoordinates
|
||||
getter speed
|
||||
method constructor
|
||||
method toJSON
|
||||
interface GeolocationPermissionStatus : PermissionStatus
|
||||
attribute @@toStringTag
|
||||
getter accuracyMode
|
||||
method constructor
|
||||
interface GeolocationPosition
|
||||
attribute @@toStringTag
|
||||
getter coords
|
||||
@@ -3681,6 +3729,7 @@ interface HTMLCanvasElement : HTMLElement
|
||||
getter layoutSubtree
|
||||
getter onpaint
|
||||
getter width
|
||||
method captureElementImage
|
||||
method captureStream
|
||||
method configureHighDynamicRange
|
||||
method constructor
|
||||
@@ -3780,6 +3829,7 @@ interface HTMLElement : Element
|
||||
getter onanimationiteration
|
||||
getter onanimationstart
|
||||
getter onauxclick
|
||||
getter onbeforefilter
|
||||
getter onbeforeinput
|
||||
getter onbeforematch
|
||||
getter onbeforetoggle
|
||||
@@ -3832,7 +3882,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
|
||||
@@ -3882,6 +3935,8 @@ interface HTMLElement : Element
|
||||
getter onwebkittransitionend
|
||||
getter onwheel
|
||||
getter outerText
|
||||
getter overscrollarea
|
||||
getter overscrollcontainer
|
||||
getter popover
|
||||
getter scrollParent
|
||||
getter spellcheck
|
||||
@@ -3920,6 +3975,7 @@ interface HTMLElement : Element
|
||||
setter onanimationiteration
|
||||
setter onanimationstart
|
||||
setter onauxclick
|
||||
setter onbeforefilter
|
||||
setter onbeforeinput
|
||||
setter onbeforematch
|
||||
setter onbeforetoggle
|
||||
@@ -3972,7 +4028,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
|
||||
@@ -4022,6 +4081,8 @@ interface HTMLElement : Element
|
||||
setter onwebkittransitionend
|
||||
setter onwheel
|
||||
setter outerText
|
||||
setter overscrollarea
|
||||
setter overscrollcontainer
|
||||
setter popover
|
||||
setter spellcheck
|
||||
setter style
|
||||
@@ -4832,6 +4893,7 @@ interface HTMLScriptElement : HTMLElement
|
||||
getter async
|
||||
getter attributionSrc
|
||||
getter blocking
|
||||
getter cacheHint
|
||||
getter charset
|
||||
getter crossOrigin
|
||||
getter defer
|
||||
@@ -4851,6 +4913,7 @@ interface HTMLScriptElement : HTMLElement
|
||||
setter async
|
||||
setter attributionSrc
|
||||
setter blocking
|
||||
setter cacheHint
|
||||
setter charset
|
||||
setter crossOrigin
|
||||
setter defer
|
||||
@@ -4949,6 +5012,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 +5158,16 @@ interface HTMLTableSectionElement : HTMLElement
|
||||
interface HTMLTemplateElement : HTMLElement
|
||||
attribute @@toStringTag
|
||||
getter content
|
||||
getter htmlFor
|
||||
getter shadowRootAdoptedStyleSheets
|
||||
getter shadowRootClonable
|
||||
getter shadowRootCustomElementRegistry
|
||||
getter shadowRootDelegatesFocus
|
||||
getter shadowRootMode
|
||||
getter shadowRootSerializable
|
||||
method constructor
|
||||
setter htmlFor
|
||||
setter shadowRootAdoptedStyleSheets
|
||||
setter shadowRootClonable
|
||||
setter shadowRootCustomElementRegistry
|
||||
setter shadowRootDelegatesFocus
|
||||
@@ -5791,6 +5879,7 @@ interface MathMLElement : Element
|
||||
getter onanimationiteration
|
||||
getter onanimationstart
|
||||
getter onauxclick
|
||||
getter onbeforefilter
|
||||
getter onbeforeinput
|
||||
getter onbeforematch
|
||||
getter onbeforetoggle
|
||||
@@ -5843,7 +5932,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
|
||||
@@ -5906,6 +5998,7 @@ interface MathMLElement : Element
|
||||
setter onanimationiteration
|
||||
setter onanimationstart
|
||||
setter onauxclick
|
||||
setter onbeforefilter
|
||||
setter onbeforeinput
|
||||
setter onbeforematch
|
||||
setter onbeforetoggle
|
||||
@@ -5958,7 +6051,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
|
||||
@@ -6311,11 +6407,14 @@ interface MimeTypeArray
|
||||
method constructor
|
||||
method item
|
||||
method namedItem
|
||||
interface ModelContext
|
||||
interface ModelContext : EventTarget
|
||||
attribute @@toStringTag
|
||||
getter ontoolchange
|
||||
method constructor
|
||||
method executeTool
|
||||
method getTools
|
||||
method registerTool
|
||||
method unregisterTool
|
||||
setter ontoolchange
|
||||
interface Mojo
|
||||
static method bindInterface
|
||||
static method createDataPipe
|
||||
@@ -6786,6 +6885,7 @@ interface OffscreenCanvas : EventTarget
|
||||
method constructor
|
||||
method convertToBlob
|
||||
method getContext
|
||||
method getElementTransform
|
||||
method transferToImageBitmap
|
||||
setter height
|
||||
setter oncontextlost
|
||||
@@ -6839,6 +6939,7 @@ interface OffscreenCanvasRenderingContext2D
|
||||
method createMesh2DVertexBuffer
|
||||
method createPattern
|
||||
method createRadialGradient
|
||||
method drawElementImage
|
||||
method drawImage
|
||||
method drawMesh
|
||||
method ellipse
|
||||
@@ -6955,7 +7056,8 @@ interface OverconstrainedError : DOMException
|
||||
method constructor
|
||||
interface OverscrollEvent : Event
|
||||
attribute @@toStringTag
|
||||
getter overscrollElement
|
||||
getter overscrollTarget
|
||||
getter overscrolling
|
||||
method constructor
|
||||
interface PageRevealEvent : Event
|
||||
attribute @@toStringTag
|
||||
@@ -7090,6 +7192,7 @@ interface Performance : EventTarget
|
||||
method getEntries
|
||||
method getEntriesByName
|
||||
method getEntriesByType
|
||||
method getSpeculations
|
||||
method mark
|
||||
method measure
|
||||
method now
|
||||
@@ -7392,6 +7495,13 @@ interface PreferenceObject : EventTarget
|
||||
method constructor
|
||||
method requestOverride
|
||||
setter onchange
|
||||
interface PreloadData
|
||||
attribute @@toStringTag
|
||||
getter as
|
||||
getter crossorigin
|
||||
getter url
|
||||
getter used
|
||||
method constructor
|
||||
interface ProcessingInstruction : CharacterData
|
||||
attribute @@toStringTag
|
||||
getter sheet
|
||||
@@ -7430,7 +7540,7 @@ interface QuotaExceededError : DOMException
|
||||
getter quota
|
||||
getter requested
|
||||
method constructor
|
||||
interface RTC : EventTarget
|
||||
interface RTC
|
||||
attribute @@toStringTag
|
||||
method cancelDiagnosticLogging
|
||||
method constructor
|
||||
@@ -8122,6 +8232,7 @@ interface SVGElement : Element
|
||||
getter onanimationiteration
|
||||
getter onanimationstart
|
||||
getter onauxclick
|
||||
getter onbeforefilter
|
||||
getter onbeforeinput
|
||||
getter onbeforematch
|
||||
getter onbeforetoggle
|
||||
@@ -8174,7 +8285,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
|
||||
@@ -8239,6 +8353,7 @@ interface SVGElement : Element
|
||||
setter onanimationiteration
|
||||
setter onanimationstart
|
||||
setter onauxclick
|
||||
setter onbeforefilter
|
||||
setter onbeforeinput
|
||||
setter onbeforematch
|
||||
setter onbeforetoggle
|
||||
@@ -8291,7 +8406,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
|
||||
@@ -9130,10 +9248,12 @@ interface Sanitizer
|
||||
attribute @@toStringTag
|
||||
method allowAttribute
|
||||
method allowElement
|
||||
method allowProcessingInstruction
|
||||
method constructor
|
||||
method get
|
||||
method removeAttribute
|
||||
method removeElement
|
||||
method removeProcessingInstruction
|
||||
method removeUnsafe
|
||||
method replaceElementWithChildren
|
||||
method setComments
|
||||
@@ -9230,6 +9350,7 @@ interface SecurityPolicyViolationEvent : Event
|
||||
getter sample
|
||||
getter sourceFile
|
||||
getter statusCode
|
||||
getter urlHash
|
||||
getter violatedDirective
|
||||
method constructor
|
||||
interface Selection
|
||||
@@ -9337,7 +9458,6 @@ interface ShadowRoot : DocumentFragment
|
||||
getter fullscreenElement
|
||||
getter host
|
||||
getter innerHTML
|
||||
getter marker
|
||||
getter mode
|
||||
getter onslotchange
|
||||
getter pictureInPictureElement
|
||||
@@ -9362,6 +9482,8 @@ interface ShadowRoot : DocumentFragment
|
||||
method streamAppendHTMLUnsafe
|
||||
method streamHTML
|
||||
method streamHTMLUnsafe
|
||||
method streamPrependHTML
|
||||
method streamPrependHTMLUnsafe
|
||||
setter adoptedStyleSheets
|
||||
setter fullscreenElement
|
||||
setter innerHTML
|
||||
@@ -9376,7 +9498,6 @@ interface SharedStorage
|
||||
method constructor
|
||||
method createWorklet
|
||||
method delete
|
||||
method get
|
||||
method run
|
||||
method selectURL
|
||||
method set
|
||||
@@ -9455,6 +9576,10 @@ interface SourceBufferList : EventTarget
|
||||
method constructor
|
||||
setter onaddsourcebuffer
|
||||
setter onremovesourcebuffer
|
||||
interface SpeculationData
|
||||
attribute @@toStringTag
|
||||
getter preloads
|
||||
method constructor
|
||||
interface SpeechGrammar
|
||||
attribute @@toStringTag
|
||||
getter src
|
||||
@@ -9491,6 +9616,7 @@ interface SpeechRecognition : EventTarget
|
||||
getter onspeechstart
|
||||
getter onstart
|
||||
getter processLocally
|
||||
getter quality
|
||||
method abort
|
||||
method constructor
|
||||
method start
|
||||
@@ -9512,6 +9638,7 @@ interface SpeechRecognition : EventTarget
|
||||
setter onspeechstart
|
||||
setter onstart
|
||||
setter processLocally
|
||||
setter quality
|
||||
interface SpeechRecognitionErrorEvent : Event
|
||||
attribute @@toStringTag
|
||||
getter error
|
||||
@@ -9522,6 +9649,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 +11161,6 @@ interface WebGL2RenderingContext
|
||||
method stencilMaskSeparate
|
||||
method stencilOp
|
||||
method stencilOpSeparate
|
||||
method texElement2D
|
||||
method texElementImage2D
|
||||
method texImage2D
|
||||
method texImage3D
|
||||
@@ -11532,7 +11663,6 @@ interface WebGLRenderingContext
|
||||
method stencilMaskSeparate
|
||||
method stencilOp
|
||||
method stencilOpSeparate
|
||||
method texElement2D
|
||||
method texElementImage2D
|
||||
method texImage2D
|
||||
method texParameterf
|
||||
@@ -11706,6 +11836,7 @@ interface WebSocketStream
|
||||
interface WebTransport
|
||||
attribute @@toStringTag
|
||||
getter closed
|
||||
getter congestionControl
|
||||
getter datagrams
|
||||
getter incomingBidirectionalStreams
|
||||
getter incomingUnidirectionalStreams
|
||||
@@ -11714,6 +11845,7 @@ interface WebTransport
|
||||
method close
|
||||
method constructor
|
||||
method createBidirectionalStream
|
||||
method createSendGroup
|
||||
method createUnidirectionalStream
|
||||
method getStats
|
||||
interface WebTransportBidirectionalStream
|
||||
@@ -11740,6 +11872,18 @@ interface WebTransportError : DOMException
|
||||
getter source
|
||||
getter streamErrorCode
|
||||
method constructor
|
||||
interface WebTransportSendGroup
|
||||
attribute @@toStringTag
|
||||
method constructor
|
||||
method getStats
|
||||
interface WebTransportSendStream : WritableStream
|
||||
attribute @@toStringTag
|
||||
getter sendGroup
|
||||
getter sendOrder
|
||||
method constructor
|
||||
method getStats
|
||||
setter sendGroup
|
||||
setter sendOrder
|
||||
interface WheelEvent : MouseEvent
|
||||
attribute @@toStringTag
|
||||
attribute DOM_DELTA_LINE
|
||||
@@ -12047,6 +12191,7 @@ interface webkitSpeechRecognition : EventTarget
|
||||
getter onspeechstart
|
||||
getter onstart
|
||||
getter processLocally
|
||||
getter quality
|
||||
method abort
|
||||
method constructor
|
||||
method start
|
||||
@@ -12068,6 +12213,7 @@ interface webkitSpeechRecognition : EventTarget
|
||||
setter onspeechstart
|
||||
setter onstart
|
||||
setter processLocally
|
||||
setter quality
|
||||
interface webkitSpeechRecognitionError : Event
|
||||
attribute @@toStringTag
|
||||
getter error
|
||||
@@ -12301,6 +12447,7 @@ namespace console
|
||||
getter onanimationstart
|
||||
getter onappinstalled
|
||||
getter onauxclick
|
||||
getter onbeforefilter
|
||||
getter onbeforeinput
|
||||
getter onbeforeinstallprompt
|
||||
getter onbeforematch
|
||||
@@ -12368,7 +12515,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 +12600,7 @@ namespace console
|
||||
getter self
|
||||
getter sessionStorage
|
||||
getter sharedStorage
|
||||
getter spellCheckCustomDictionary
|
||||
getter status
|
||||
getter statusbar
|
||||
getter styleMedia
|
||||
@@ -12527,6 +12678,7 @@ namespace console
|
||||
setter onanimationstart
|
||||
setter onappinstalled
|
||||
setter onauxclick
|
||||
setter onbeforefilter
|
||||
setter onbeforeinput
|
||||
setter onbeforeinstallprompt
|
||||
setter onbeforematch
|
||||
@@ -12594,7 +12746,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"/>
|
||||
@@ -111,6 +103,7 @@ by a child template that "extends" this file.
|
||||
resizeTo, moveBy}|).
|
||||
-->
|
||||
<uses-permission android:name="android.permission.REPOSITION_SELF_WINDOWS"/>
|
||||
<uses-permission android:name="android.permission.REQUEST_FULLSCREEN_MODE"/>
|
||||
<uses-permission android:name="android.permission.USE_CREDENTIALS"/>
|
||||
<uses-permission-sdk-23 android:name="android.permission.USE_BIOMETRIC"/>
|
||||
<uses-permission-sdk-23 android:name="android.permission.USE_FINGERPRINT"/>
|
||||
@@ -397,9 +390,37 @@ by a child template that "extends" this file.
|
||||
<intent-filter tools:ignore="AppLinkUrlError">
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<!-- TODO(crbug.com/40557607): Limit these to supported MIME types. -->
|
||||
<data android:mimeType="image/*" />
|
||||
<data android:mimeType="video/*" />
|
||||
<!-- TODO(crbug.com/501213257): Find a way to unify the declaration of codecs between here and the media stack -->
|
||||
{% if enable_jxl_decoder == "true" %}
|
||||
<data android:mimeType="image/jxl" />
|
||||
{% endif %}
|
||||
{% if enable_av1_decoder == "true" %}
|
||||
<data android:mimeType="image/avif" />
|
||||
{% endif %}
|
||||
<data android:mimeType="image/webp" />
|
||||
<data android:mimeType="image/apng" />
|
||||
<data android:mimeType="image/svg+xml" />
|
||||
<data android:mimeType="image/jpeg" />
|
||||
<data android:mimeType="image/png" />
|
||||
<data android:mimeType="image/gif" />
|
||||
<data android:mimeType="image/x-icon" />
|
||||
<data android:mimeType="image/bmp" />
|
||||
<data android:mimeType="image/x-xbitmap" />
|
||||
<data android:mimeType="image/vnd.microsoft.icon" />
|
||||
<data android:mimeType="image/pjpeg" />
|
||||
<data android:mimeType="image/jpg" />
|
||||
<data android:mimeType="image/x-png" />
|
||||
|
||||
<data android:mimeType="video/webm" />
|
||||
<data android:mimeType="video/ogg" />
|
||||
<data android:mimeType="video/mp4" />
|
||||
<data android:mimeType="video/matroska" />
|
||||
<data android:mimeType="video/x-matroska" />
|
||||
{% if use_proprietary_codecs == "true" %}
|
||||
<data android:mimeType="video/x-m4v" />
|
||||
<data android:mimeType="video/3gpp" />
|
||||
{% endif %}
|
||||
|
||||
<data android:scheme="file" />
|
||||
<data android:scheme="content" />
|
||||
</intent-filter>
|
||||
@@ -437,8 +458,24 @@ by a child template that "extends" this file.
|
||||
<intent-filter tools:ignore="AppLinkUrlError">
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<!-- TODO(crbug.com/40557607): Limit these to supported MIME types. -->
|
||||
<data android:mimeType="audio/*" />
|
||||
<!-- TODO(crbug.com/501213257): Find a way to unify the declaration of codecs between here and the media stack -->
|
||||
<data android:mimeType="audio/wav" />
|
||||
<data android:mimeType="audio/x-wav" />
|
||||
<data android:mimeType="audio/webm" />
|
||||
<data android:mimeType="audio/ogg" />
|
||||
<data android:mimeType="audio/flac" />
|
||||
<data android:mimeType="audio/mpeg" />
|
||||
<data android:mimeType="audio/mp3" />
|
||||
<data android:mimeType="audio/x-mp3" />
|
||||
<data android:mimeType="audio/mp4" />
|
||||
<data android:mimeType="audio/matroska" />
|
||||
<data android:mimeType="audio/x-matroska" />
|
||||
<data android:mimeType="application/ogg" />
|
||||
{% if use_proprietary_codecs == "true" %}
|
||||
<data android:mimeType="audio/aac" />
|
||||
<data android:mimeType="audio/x-m4a" />
|
||||
{% endif %}
|
||||
|
||||
<data android:scheme="file" />
|
||||
<data android:scheme="content" />
|
||||
</intent-filter>
|
||||
@@ -738,31 +775,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"
|
||||
android:windowSoftInputMode="stateAlwaysHidden|adjustResize"
|
||||
android:exported="false"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize|uiMode">
|
||||
</activity>
|
||||
|
||||
<!-- Activities for history. -->
|
||||
<activity android:name="org.chromium.chrome.browser.history.HistoryActivity"
|
||||
@@ -1233,15 +1245,6 @@ by a child template that "extends" this file.
|
||||
<meta-data android:name="org.chromium.content.browser.SMART_CLIP_PROVIDER"
|
||||
android:value="org.chromium.content_public.browser.SmartClipProvider"/>
|
||||
|
||||
<activity
|
||||
android:name="org.chromium.chrome.browser.test_dummy.TestDummyActivity"
|
||||
android:excludeFromRecents="true"
|
||||
android:exported="true"
|
||||
android:noHistory="true"
|
||||
android:theme="@style/Theme.Material3Expressive.DayNight"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize" >
|
||||
</activity>
|
||||
|
||||
<!-- This activity is Android P- only which is not supported by Chrome now. -->
|
||||
<activity
|
||||
android:name="androidx.biometric.internal.ui.FingerprintDialogActivity"
|
||||
@@ -1324,7 +1327,9 @@ by a child template that "extends" this file.
|
||||
android:process=":sandboxed_process{{ i }}"
|
||||
android:permission="{{ manifest_package }}.permission.CHILD_SERVICE"
|
||||
android:isolatedProcess="true"
|
||||
{% if (i == 0) %}
|
||||
android:useAppZygote="true"
|
||||
{% endif %}
|
||||
android:exported="{{sandboxed_service_exported|default(false)}}"
|
||||
{% if (sandboxed_service_exported|default(false)) == 'true' %}
|
||||
android:externalService="true"
|
||||
@@ -1432,7 +1437,7 @@ by a child template that "extends" this file.
|
||||
android:grantUriPermissions="true">
|
||||
</provider>
|
||||
|
||||
<!-- Disables at startup init of Emoji2. See http://crbug.com/1205141 -->
|
||||
<!-- Disables at startup init of Emoji2. See http://crbug.com/40764422 -->
|
||||
<provider
|
||||
android:name="androidx.startup.InitializationProvider"
|
||||
tools:node="remove">
|
||||
@@ -1469,6 +1474,14 @@ by a child template that "extends" this file.
|
||||
android:grantUriPermissions="true">
|
||||
</provider>
|
||||
|
||||
<!-- Provider for screenshot content. -->
|
||||
<provider
|
||||
android:name="org.chromium.chrome.browser.screenshotprovider.ScreenshotContentProvider"
|
||||
android:authorities="{{ manifest_package }}.ScreenshotContentProvider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
</provider>
|
||||
|
||||
<!-- Provider for querying the Autofill third party mode state. -->
|
||||
<provider android:name="org.chromium.chrome.browser.autofill.AutofillThirdPartyModeContentProvider"
|
||||
android:authorities="{{ manifest_package }}.AutofillThirdPartyModeContentProvider"
|
||||
|
||||
+48
-9
@@ -33,7 +33,7 @@ import static androidx.browser.trusted.LaunchHandlerClientMode.NAVIGATE_EXISTING
|
||||
import static androidx.browser.trusted.LaunchHandlerClientMode.NAVIGATE_NEW;
|
||||
|
||||
import static org.chromium.build.NullUtil.assumeNonNull;
|
||||
import static org.chromium.chrome.browser.app.tab_activity_glue.PopupCreator.EXTRA_REQUESTED_WINDOW_FEATURES;
|
||||
import static org.chromium.chrome.browser.app.tab_activity_glue.PopupCreatorImpl.EXTRA_REQUESTED_WINDOW_FEATURES;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.ActivityOptions;
|
||||
@@ -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";
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -1874,7 +1905,7 @@ public class CustomTabIntentDataProvider extends BrowserServicesIntentDataProvid
|
||||
return true;
|
||||
}
|
||||
|
||||
if (WebAppHeaderUtils.isWindowControlsOverlayFlagEnabled()
|
||||
if (WebAppHeaderUtils.isWindowControlsOverlayEnabled()
|
||||
&& displayMode instanceof TrustedWebActivityDisplayMode.WindowControlsOverlayMode) {
|
||||
return isDisplayOverride;
|
||||
}
|
||||
@@ -1918,7 +1949,7 @@ public class CustomTabIntentDataProvider extends BrowserServicesIntentDataProvid
|
||||
return DisplayMode.MINIMAL_UI;
|
||||
}
|
||||
|
||||
if (WebAppHeaderUtils.isWindowControlsOverlayFlagEnabled()
|
||||
if (WebAppHeaderUtils.isWindowControlsOverlayEnabled()
|
||||
&& displayMode instanceof TrustedWebActivityDisplayMode.WindowControlsOverlayMode) {
|
||||
return DisplayMode.WINDOW_CONTROLS_OVERLAY;
|
||||
}
|
||||
@@ -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
+34
-36
@@ -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"
|
||||
@@ -156,6 +155,7 @@
|
||||
#include "content/public/browser/prefetch_service_delegate.h"
|
||||
#include "content/public/browser/ssl_host_state_delegate.h"
|
||||
#include "content/public/browser/storage_partition.h"
|
||||
#include "device/fido/platform_credential_store.h"
|
||||
#include "google_apis/gaia/gaia_urls.h"
|
||||
#include "media/base/media_switches.h"
|
||||
#include "media/mojo/services/video_decode_perf_history.h"
|
||||
@@ -175,9 +175,10 @@
|
||||
#include "chrome/browser/feed/feed_service_factory.h"
|
||||
#include "chrome/browser/offline_pages/offline_page_model_factory.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/browser/settings/jni_headers/RecentSearchQueue_jni.h"
|
||||
#include "chrome/browser/ui/android/tab_model/tab_model.h"
|
||||
#include "chrome/browser/ui/android/tab_model/tab_model_list.h"
|
||||
#include "components/cdm/browser/media_drm_storage_impl.h" // nogncheck crbug.com/1125897
|
||||
#include "components/cdm/browser/media_drm_storage_impl.h" // nogncheck crbug.com/40147906
|
||||
#include "components/feed/core/v2/public/feed_service.h" // nogncheck
|
||||
#include "components/feed/feed_feature_list.h"
|
||||
#include "components/installedapp/android/jni_headers/PackageHash_jni.h"
|
||||
@@ -200,14 +201,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 +431,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 +649,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());
|
||||
@@ -697,7 +690,7 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
|
||||
|
||||
profile_->GetDefaultStoragePartition()->ClearDataForOrigin(
|
||||
content::StoragePartition::REMOVE_DATA_MASK_LOCAL_STORAGE,
|
||||
GURL(chrome::kChromeUINewTabPageURL), base::DoNothing());
|
||||
chrome::ChromeUINewTabPageURLAsGURL(), base::DoNothing());
|
||||
}
|
||||
#endif // !BUILDFLAG(IS_ANDROID)
|
||||
|
||||
@@ -924,8 +917,6 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
|
||||
profile_, ServiceAccessType::EXPLICIT_ACCESS);
|
||||
|
||||
if (password_store) {
|
||||
// No sync completion callback is needed for profile passwords, since the
|
||||
// login token is persisted and can be used after cookie deletion.
|
||||
password_store->RemoveLoginsCreatedBetween(
|
||||
FROM_HERE, delete_begin_, delete_end_,
|
||||
CreateTaskCompletionCallback(
|
||||
@@ -979,23 +970,10 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
|
||||
profile_, ServiceAccessType::EXPLICIT_ACCESS);
|
||||
|
||||
if (account_store) {
|
||||
// Desktop must wait for DATA_TYPE_ACCOUNT_PASSWORDS deletions to be
|
||||
// uploaded to the sync server before deleting any other types (because
|
||||
// deleting DATA_TYPE_COOKIES first would revoke the account storage
|
||||
// opt-in and prevent the upload).
|
||||
// On Android, the account storage doesn't depend on cookies, so there's
|
||||
// no need to wait.
|
||||
base::OnceCallback<void(bool)> sync_completion;
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
sync_completion =
|
||||
CreateTaskCompletionCallback(TracingDataType::kAccountPasswordsSynced,
|
||||
constants::DATA_TYPE_ACCOUNT_PASSWORDS);
|
||||
#endif
|
||||
account_store->RemoveLoginsCreatedBetween(
|
||||
FROM_HERE, delete_begin_, delete_end_,
|
||||
CreateTaskCompletionCallback(TracingDataType::kAccountPasswords,
|
||||
constants::DATA_TYPE_ACCOUNT_PASSWORDS),
|
||||
std::move(sync_completion));
|
||||
constants::DATA_TYPE_ACCOUNT_PASSWORDS));
|
||||
}
|
||||
|
||||
// Record that a password removal action happened for the account store.
|
||||
@@ -1147,6 +1125,10 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
|
||||
filter,
|
||||
base::IgnoreArgs<offline_pages::OfflinePageModel::DeletePageResult>(
|
||||
CreateTaskCompletionClosure(TracingDataType::kOfflinePages)));
|
||||
|
||||
// Deletes the recent search entries for Android Settings.
|
||||
Java_RecentSearchQueue_deleteDiskData(
|
||||
base::android::AttachCurrentThread());
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1367,10 +1349,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)
|
||||
@@ -1559,6 +1556,7 @@ void ChromeBrowsingDataRemoverDelegate::OnTaskComplete(
|
||||
std::move(callback_).Run(failed_data_types_);
|
||||
}
|
||||
|
||||
// LINT.IfChange(TracingDataTypeHistogramSuffix)
|
||||
const char* ChromeBrowsingDataRemoverDelegate::GetHistogramSuffix(
|
||||
TracingDataType task) {
|
||||
switch (task) {
|
||||
@@ -1606,8 +1604,6 @@ const char* ChromeBrowsingDataRemoverDelegate::GetHistogramSuffix(
|
||||
return "UserDataSnapshot";
|
||||
case TracingDataType::kAccountPasswords:
|
||||
return "AccountPasswords";
|
||||
case TracingDataType::kAccountPasswordsSynced:
|
||||
return "AccountPasswordsSynced";
|
||||
case TracingDataType::kFaviconCacheExpiration:
|
||||
return "FaviconCacheExpiration";
|
||||
case TracingDataType::kSecurePaymentConfirmationCredentials:
|
||||
@@ -1622,6 +1618,7 @@ const char* ChromeBrowsingDataRemoverDelegate::GetHistogramSuffix(
|
||||
return "MediaDeviceSalts";
|
||||
}
|
||||
}
|
||||
// LINT.ThenChange(//tools/metrics/histograms/metadata/history/histograms.xml:History.ClearBrowsingData.Duration.ChromeTask.Task)
|
||||
|
||||
void ChromeBrowsingDataRemoverDelegate::OnStartRemoving() {
|
||||
profile_keep_alive_ = std::make_unique<ScopedProfileKeepAlive>(
|
||||
@@ -1744,4 +1741,5 @@ void ChromeBrowsingDataRemoverDelegate::DisablePasswordsAutoSignin(
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
DEFINE_JNI(PackageHash)
|
||||
DEFINE_JNI(RecentSearchQueue)
|
||||
#endif
|
||||
|
||||
@@ -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)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+34
-20
@@ -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"
|
||||
@@ -20,10 +21,12 @@
|
||||
#include "chrome/browser/history/history_service_factory.h"
|
||||
#include "chrome/browser/interstitials/enterprise_util.h"
|
||||
#include "chrome/browser/lookalikes/lookalike_url_navigation_throttle.h"
|
||||
#include "chrome/browser/omnibox/geolocation_navigation_throttle.h"
|
||||
#include "chrome/browser/plugins/pdf_iframe_navigation_throttle.h"
|
||||
#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,10 +93,7 @@
|
||||
#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"
|
||||
#include "chrome/browser/themes/theme_service_factory.h"
|
||||
#include "chrome/browser/ui/lens/lens_overlay_side_panel_navigation_throttle.h"
|
||||
#include "chrome/browser/ui/read_anything/read_anything_side_panel_navigation_throttle.h"
|
||||
@@ -121,14 +121,20 @@
|
||||
#include "chrome/browser/apps/platform_apps/platform_app_navigation_redirector.h"
|
||||
#endif // BUILDFLAG(ENABLE_PLATFORM_APPS)
|
||||
|
||||
#if BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
#include "chrome/browser/ui/browser_finder.h"
|
||||
#include "chrome/browser/ui/web_applications/app_browser_controller.h"
|
||||
#endif // BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
#endif // !BUILDFLAG(IS_ANDROID)
|
||||
|
||||
#if BUILDFLAG(ENABLE_GUEST_VIEW) && BUILDFLAG(ENABLE_EXTENSIONS_CORE)
|
||||
#if BUILDFLAG(ENABLE_DEVTOOLS_FRONTEND)
|
||||
#include "chrome/browser/devtools/devtools_window.h"
|
||||
#endif // BUILDFLAG(ENABLE_DEVTOOLS_FRONTEND)
|
||||
|
||||
#if BUILDFLAG(ENABLE_GUEST_VIEW)
|
||||
#if BUILDFLAG(ENABLE_EXTENSIONS_CORE)
|
||||
#include "extensions/browser/guest_view/web_view/web_view_guest.h"
|
||||
#endif // BUILDFLAG(ENABLE_GUEST_VIEW) && BUILDFLAG(ENABLE_EXTENSIONS_CORE)
|
||||
#endif // BUILDFLAG(ENABLE_EXTENSIONS_CORE)
|
||||
#endif // BUILDFLAG(ENABLE_GUEST_VIEW)
|
||||
|
||||
#if BUILDFLAG(ENABLE_PDF)
|
||||
#include "chrome/browser/pdf/chrome_pdf_stream_delegate.h"
|
||||
@@ -165,7 +171,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 +193,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) {
|
||||
@@ -217,9 +223,10 @@ void HandleSSLErrorWrapper(
|
||||
is_ssl_error_override_allowed_for_origin);
|
||||
}
|
||||
|
||||
// Returns whether `web_contents` is within a hosted app.
|
||||
bool IsInHostedApp(content::WebContents* web_contents) {
|
||||
#if BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
// Returns whether `web_contents` is within a web app.
|
||||
// TODO(crbug.com/505461569): Support Android.
|
||||
bool IsInWebApp(content::WebContents* web_contents) {
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
tabs::TabInterface* tab =
|
||||
tabs::TabInterface::MaybeGetFromContents(web_contents);
|
||||
return tab && web_app::AppBrowserController::IsWebApp(
|
||||
@@ -285,8 +292,16 @@ void CreateAndAddChromeThrottlesForNavigation(
|
||||
// should be cared by adding an attribute flag to
|
||||
// NavigationThrottleRegistry::AddThrottle().
|
||||
page_load_metrics::MetricsNavigationThrottle::CreateAndAdd(registry);
|
||||
|
||||
// Appends the X-Geo header to the navigation request if needed.
|
||||
if (auto throttle =
|
||||
GeolocationNavigationThrottle::MaybeCreateThrottleFor(registry)) {
|
||||
registry.AddThrottle(std::move(throttle));
|
||||
}
|
||||
}
|
||||
|
||||
DSEPrewarmNavigationThrottle::MaybeCreateAndAdd(registry);
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
// TODO(davidben): This is insufficient to integrate with prerender properly.
|
||||
// https://crbug.com/40364296
|
||||
@@ -320,7 +335,7 @@ void CreateAndAddChromeThrottlesForNavigation(
|
||||
// we are attempting to load a google property.
|
||||
if (ash::merge_session_throttling_utils::ShouldAttachNavigationThrottle() &&
|
||||
!ash::merge_session_throttling_utils::AreAllSessionMergedAlready() &&
|
||||
registry.IsHTTPOrHTTPS()) {
|
||||
registry.GetNavigationHandle().GetURL().SchemeIsHTTPOrHTTPS()) {
|
||||
ash::MergeSessionNavigationThrottle::CreateAndAdd(registry);
|
||||
}
|
||||
}
|
||||
@@ -424,7 +439,7 @@ void CreateAndAddChromeThrottlesForNavigation(
|
||||
base::BindRepeating(&MaybeTriggerSecurityInterstitialShownEvent));
|
||||
registry.AddThrottle(std::make_unique<SSLErrorNavigationThrottle>(
|
||||
registry, base::BindOnce(&HandleSSLErrorWrapper),
|
||||
base::BindOnce(&IsInHostedApp),
|
||||
base::BindOnce(&IsInWebApp),
|
||||
base::BindOnce(
|
||||
&ShouldIgnoreSslInterstitialBecauseNavigationDefaultedToHttps)));
|
||||
|
||||
@@ -463,7 +478,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,8 +485,11 @@ void CreateAndAddChromeThrottlesForNavigation(
|
||||
registry);
|
||||
}
|
||||
|
||||
#if BUILDFLAG(ENABLE_DEVTOOLS_FRONTEND)
|
||||
DevToolsWindow::MaybeCreateAndAddNavigationThrottle(registry);
|
||||
#endif // BUILDFLAG(ENABLE_DEVTOOLS_FRONTEND)
|
||||
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
if (base::FeatureList::IsEnabled(features::kInstantUsesSpareRenderer)) {
|
||||
ChromeSearchNavigationThrottle::MaybeCreateAndAdd(registry);
|
||||
}
|
||||
@@ -571,13 +588,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.
|
||||
@@ -597,9 +614,6 @@ void CreateAndAddChromeThrottlesForNavigation(
|
||||
}
|
||||
#endif // BUILDFLAG(ENABLE_EXTENSIONS_CORE)
|
||||
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
PreviewNavigationThrottle::MaybeCreateAndAdd(registry);
|
||||
#endif // !BUILDFLAG(IS_ANDROID)
|
||||
|
||||
MaybeCreateAndAddVisitedLinkNavigationThrottle(registry);
|
||||
|
||||
|
||||
+267
-152
File diff suppressed because it is too large
Load Diff
@@ -25,20 +25,22 @@
|
||||
#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"
|
||||
#include "chrome/browser/media/media_engagement_service.h"
|
||||
#include "chrome/browser/media/media_storage_id_salt.h"
|
||||
#include "chrome/browser/media/prefs/capture_device_ranking.h"
|
||||
#include "chrome/browser/media/unified_autoplay_config.h"
|
||||
#include "chrome/browser/media/webrtc/capture_policy_utils.h"
|
||||
#include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h"
|
||||
#include "chrome/browser/media/webrtc/permission_bubble_media_access_handler.h"
|
||||
@@ -48,6 +50,7 @@
|
||||
#include "chrome/browser/net/net_error_tab_helper.h"
|
||||
#include "chrome/browser/net/profile_network_context_service.h"
|
||||
#include "chrome/browser/net/system_network_context_manager.h"
|
||||
#include "chrome/browser/new_tab_page/ntp_pref_names.h"
|
||||
#include "chrome/browser/notifications/notification_display_service_impl.h"
|
||||
#include "chrome/browser/notifications/notifier_state_tracker.h"
|
||||
#include "chrome/browser/notifications/platform_notification_service_impl.h"
|
||||
@@ -77,7 +80,6 @@
|
||||
#include "chrome/browser/signin/chrome_signin_client.h"
|
||||
#include "chrome/browser/signin/signin_promo_util.h"
|
||||
#include "chrome/browser/ssl/ssl_config_service_manager.h"
|
||||
#include "chrome/browser/subscription_eligibility/subscription_eligibility_prefs.h"
|
||||
#include "chrome/browser/themes/theme_service.h"
|
||||
#include "chrome/browser/tracing/chrome_tracing_delegate.h"
|
||||
#include "chrome/browser/ui/browser_ui_prefs.h"
|
||||
@@ -85,7 +87,6 @@
|
||||
#include "chrome/browser/ui/performance_controls/performance_controls_metrics.h"
|
||||
#include "chrome/browser/ui/prefs/prefs_tab_helper.h"
|
||||
#include "chrome/browser/ui/safety_hub/safety_hub_prefs.h"
|
||||
#include "chrome/browser/ui/search_engines/keyword_editor_controller.h"
|
||||
#include "chrome/browser/ui/tabs/projects/projects_prefs.h"
|
||||
#include "chrome/browser/ui/tabs/tab_strip_prefs.h"
|
||||
#include "chrome/browser/ui/toolbar/chrome_labs/chrome_labs_prefs.h"
|
||||
@@ -102,6 +103,7 @@
|
||||
#include "chrome/common/buildflags.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "chrome/common/secure_origin_allowlist.h"
|
||||
#include "components/accessibility_annotator/core/prefs.h"
|
||||
#include "components/autofill/core/common/autofill_prefs.h"
|
||||
#include "components/blocked_content/safe_browsing_triggered_popup_blocker.h"
|
||||
#include "components/breadcrumbs/core/breadcrumbs_status.h"
|
||||
@@ -116,6 +118,7 @@
|
||||
#include "components/dom_distiller/core/distilled_page_prefs.h"
|
||||
#include "components/domain_reliability/domain_reliability_prefs.h"
|
||||
#include "components/embedder_support/origin_trials/origin_trial_prefs.h"
|
||||
#include "components/enterprise/browser/groups/groups_prefs.h"
|
||||
#include "components/enterprise/browser/identifiers/identifiers_prefs.h"
|
||||
#include "components/enterprise/browser/promotion/promotion_prefs.h"
|
||||
#include "components/enterprise/buildflags/buildflags.h"
|
||||
@@ -132,6 +135,7 @@
|
||||
#include "components/media_device_salt/media_device_id_salt.h"
|
||||
#include "components/metrics/demographics/user_demographics.h"
|
||||
#include "components/metrics/metrics_pref_names.h"
|
||||
#include "components/metrics/metrics_reporting_choice_service.h"
|
||||
#include "components/network_time/network_time_tracker.h"
|
||||
#include "components/ntp_tiles/custom_links_manager_impl.h"
|
||||
#include "components/ntp_tiles/enterprise/enterprise_shortcuts_manager_impl.h"
|
||||
@@ -152,7 +156,6 @@
|
||||
#include "components/performance_manager/public/user_tuning/prefs.h"
|
||||
#include "components/permissions/permission_hats_trigger_helper.h"
|
||||
#include "components/permissions/pref_names.h"
|
||||
#include "components/plus_addresses/core/common/plus_address_prefs.h"
|
||||
#include "components/policy/core/browser/browser_policy_connector.h"
|
||||
#include "components/policy/core/browser/url_list/url_blocklist_manager.h"
|
||||
#include "components/policy/core/common/local_test_policy_provider.h"
|
||||
@@ -185,8 +188,8 @@
|
||||
#include "components/site_engagement/content/site_engagement_service.h"
|
||||
#include "components/subresource_filter/content/browser/ruleset_service.h"
|
||||
#include "components/subresource_filter/core/common/constants.h"
|
||||
#include "components/subscription_eligibility/subscription_eligibility_prefs.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"
|
||||
@@ -195,7 +198,6 @@
|
||||
#include "components/sync_preferences/cross_device_pref_tracker/prefs/cross_device_pref_registry.h"
|
||||
#include "components/sync_preferences/pref_service_syncable.h"
|
||||
#include "components/sync_sessions/session_sync_prefs.h"
|
||||
#include "components/tpcd/metadata/browser/prefs.h"
|
||||
#include "components/tracing/common/pref_names.h"
|
||||
#include "components/translate/core/browser/translate_prefs.h"
|
||||
#include "components/update_client/update_client.h"
|
||||
@@ -211,6 +213,15 @@
|
||||
#include "pdf/buildflags.h"
|
||||
#include "printing/buildflags/buildflags.h"
|
||||
#include "rlz/buildflags/buildflags.h"
|
||||
#include "ui/webui/buildflags.h"
|
||||
|
||||
#if BUILDFLAG(ENABLE_WEBUI_NTP)
|
||||
#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"
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
#include "chrome/browser/ui/webui/new_tab_footer/new_tab_footer_ui.h"
|
||||
#endif // !BUILDFLAG(IS_ANDROID)
|
||||
#endif // BUILDFLAG(ENABLE_WEBUI_NTP)
|
||||
|
||||
#if BUILDFLAG(ENABLE_BACKGROUND_MODE)
|
||||
#include "chrome/browser/background/extensions/background_mode_manager.h"
|
||||
@@ -240,7 +251,9 @@
|
||||
#include "chrome/browser/pdf/pdf_pref_names.h"
|
||||
#endif // BUILDFLAG(ENABLE_PDF)
|
||||
|
||||
#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"
|
||||
@@ -257,16 +270,18 @@
|
||||
#include "chrome/browser/partnerbookmarks/partner_bookmarks_shim.h"
|
||||
#include "chrome/browser/readaloud/android/prefs.h"
|
||||
#include "chrome/browser/ssl/known_interception_disclosure_infobar_delegate.h"
|
||||
#include "components/cdm/browser/media_drm_storage_impl.h" // nogncheck crbug.com/1125897
|
||||
#include "components/cdm/browser/media_drm_storage_impl.h" // nogncheck crbug.com/40147906
|
||||
#include "components/feed/core/common/pref_names.h" // nogncheck
|
||||
#include "components/feed/core/shared_prefs/pref_names.h" // nogncheck
|
||||
#include "components/feed/core/v2/ios_shared_prefs.h" // nogncheck
|
||||
#include "components/ntp_tiles/popular_sites_impl.h"
|
||||
#include "components/permissions/contexts/geolocation_permission_context_android.h"
|
||||
#include "components/webapps/browser/android/install_prompt_prefs.h"
|
||||
#else // BUILDFLAG(IS_ANDROID)
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
#include "chrome/browser/actor/ui/actor_ui_state_manager_prefs.h"
|
||||
#include "chrome/browser/desktop_to_mobile_promos/promos_utils.h" // nogncheck crbug.com/1125897
|
||||
#include "chrome/browser/desktop_to_mobile_promos/promos_utils.h" // nogncheck crbug.com/40147906
|
||||
#include "chrome/browser/gcm/gcm_product_util.h"
|
||||
#include "chrome/browser/hid/hid_policy_allowed_devices.h"
|
||||
#include "chrome/browser/intranet_redirect_detector.h"
|
||||
@@ -275,7 +290,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,28 +307,22 @@
|
||||
#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"
|
||||
#include "chrome/browser/ui/webui/new_tab_page/ntp_pref_names.h"
|
||||
#include "chrome/browser/ui/webui/settings/settings_ui.h"
|
||||
#include "chrome/browser/ui/webui/tab_search/tab_search_prefs.h"
|
||||
#include "chrome/browser/upgrade_detector/upgrade_detector.h"
|
||||
#include "chrome/browser/user_education/browser_user_education_storage_service.h"
|
||||
#include "chrome/browser/webauthn/chrome_authenticator_request_delegate.h"
|
||||
#include "components/headless/policy/headless_mode_prefs.h"
|
||||
#include "components/headless/policy/headless_mode_prefs.h" // nogncheck crbug.com/40147906
|
||||
#include "components/lens/lens_overlay_permission_utils.h"
|
||||
#include "components/live_caption/live_caption_controller.h"
|
||||
#include "components/live_caption/live_translate_controller.h"
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
#endif // !BUILDFLAG(IS_ANDROID)
|
||||
|
||||
#if BUILDFLAG(ENABLE_DEVTOOLS_FRONTEND)
|
||||
#include "chrome/browser/devtools/devtools_window.h"
|
||||
@@ -328,6 +336,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 +383,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 +411,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"
|
||||
@@ -417,7 +428,6 @@
|
||||
#include "chrome/browser/ash/settings/stats_reporting_controller.h"
|
||||
#include "chrome/browser/ash/system/automatic_reboot_manager.h"
|
||||
#include "chrome/browser/ash/system/input_device_settings.h"
|
||||
#include "chrome/browser/ash/system_web_apps/apps/help_app/help_app_notification_controller.h"
|
||||
#include "chrome/browser/ash/system_web_apps/apps/media_app/media_app_guest_ui_config.h"
|
||||
#include "chrome/browser/ash/wallpaper_handlers/wallpaper_prefs.h"
|
||||
#include "chrome/browser/chromeos/enterprise/cloud_storage/pref_utils.h"
|
||||
@@ -495,16 +505,17 @@
|
||||
#include "chrome/browser/media/media_foundation_service_monitor.h"
|
||||
#include "chrome/browser/os_crypt/app_bound_encryption_provider_win.h"
|
||||
#include "chrome/browser/webnn/webnn_prefs.h"
|
||||
#include "components/os_crypt/async/browser/dpapi_key_provider.h"
|
||||
#include "components/os_crypt/async/browser/os_crypt_win.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"
|
||||
#include "components/os_crypt/sync/os_crypt.h" // nogncheck
|
||||
#endif
|
||||
#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_ANDROID)
|
||||
|
||||
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
|
||||
BUILDFLAG(IS_CHROMEOS)
|
||||
#include "components/device_signals/core/browser/pref_names.h" // nogncheck due to crbug.com/1125897
|
||||
#include "components/device_signals/core/browser/pref_names.h" // nogncheck due to crbug.com/40147906
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
|
||||
@@ -517,7 +528,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)
|
||||
@@ -551,86 +562,15 @@
|
||||
#include "components/safe_browsing/content/common/file_type_policies_prefs.h"
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(CHROME_FOR_TESTING)
|
||||
#include "chrome/browser/chrome_for_testing/prefs.h"
|
||||
#endif
|
||||
|
||||
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 +943,76 @@ 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";
|
||||
|
||||
// Deprecated 04/2026.
|
||||
constexpr char kTpcdMetadataCohorts[] = "tpcd.metadata.cohorts";
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
// Deprecated 04/2026.
|
||||
constexpr char kHasSeenWebFeed[] = "webfeed.has_seen_feed";
|
||||
constexpr char kLastBadgeAnimationTime[] = "webfeed.last_badge_animation_time";
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
|
||||
// Deprecated 04/2026.
|
||||
inline constexpr char kPreallocatedAddressesVersion[] =
|
||||
"plus_addresses.preallocation.version";
|
||||
inline constexpr char kPreallocatedAddresses[] =
|
||||
"plus_addresses.preallocation.addresses";
|
||||
inline constexpr char kPreallocatedAddressesNext[] =
|
||||
"plus_addresses.preallocation.next";
|
||||
inline constexpr char kFirstPlusAddressCreationTime[] =
|
||||
"plus_addresses.creation.first.time";
|
||||
inline constexpr char kLastPlusAddressFillingTime[] =
|
||||
"plus_addresses.last.filling.time";
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
// Deprecated 05/2026.
|
||||
constexpr char kWebFeedContentOrder[] = "webfeed.content_order";
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
|
||||
// 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 +1076,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);
|
||||
|
||||
@@ -1127,60 +1117,20 @@ void RegisterLocalStatePrefsForMigration(PrefRegistrySimple* registry) {
|
||||
|
||||
// Deprecated 02/2026.
|
||||
registry->RegisterListPref(kProfilesDeletedOld);
|
||||
|
||||
// Deprecated 04/2026.
|
||||
registry->RegisterDictionaryPref(kTpcdMetadataCohorts);
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
// Deprecated 04/2026.
|
||||
registry->RegisterBooleanPref(kHasSeenWebFeed, false);
|
||||
registry->RegisterTimePref(kLastBadgeAnimationTime, base::Time());
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
}
|
||||
|
||||
// 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);
|
||||
@@ -1311,10 +1261,10 @@ void RegisterProfilePrefsForMigration(
|
||||
kObsoleteAutofillableCredentialsAccountStoreLoginDatabase, false);
|
||||
#endif // !BUILDFLAG(IS_ANDROID)
|
||||
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
#if !BUILDFLAG(IS_ANDROID) || BUILDFLAG(ENABLE_WEBUI_NTP)
|
||||
// Deprecated 08/2025.
|
||||
registry->RegisterBooleanPref(ntp_prefs::kNtpUseMostVisitedTiles, false);
|
||||
#endif // !BUILDFLAG(IS_ANDROID)
|
||||
#endif // !BUILDFLAG(IS_ANDROID) || BUILDFLAG(ENABLE_WEBUI_NTP)
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
// Deprecated 08/2025.
|
||||
@@ -1347,10 +1297,10 @@ void RegisterProfilePrefsForMigration(
|
||||
// Deprecated 10/2025.
|
||||
registry->RegisterBooleanPref(kSessionRestorePrefChanged, false);
|
||||
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
#if !BUILDFLAG(IS_ANDROID) || BUILDFLAG(ENABLE_WEBUI_NTP)
|
||||
// Deprecated 10/2025.
|
||||
registry->RegisterIntegerPref(ntp_prefs::kNtpShortcutsType, 0);
|
||||
#endif // !BUILDFLAG(IS_ANDROID)
|
||||
#endif // !BUILDFLAG(IS_ANDROID) || BUILDFLAG(ENABLE_WEBUI_NTP)
|
||||
|
||||
// Deprecated 10/2025.
|
||||
registry->RegisterStringPref(kLegacySyncSessionsGUID, std::string());
|
||||
@@ -1401,6 +1351,48 @@ 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);
|
||||
|
||||
// Deprecated 04/2026.
|
||||
registry->RegisterIntegerPref(kPreallocatedAddressesVersion, 1);
|
||||
registry->RegisterListPref(kPreallocatedAddresses);
|
||||
registry->RegisterIntegerPref(kPreallocatedAddressesNext, 0);
|
||||
registry->RegisterTimePref(kFirstPlusAddressCreationTime, base::Time());
|
||||
registry->RegisterTimePref(kLastPlusAddressFillingTime, base::Time());
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
// Deprecated 05/2026.
|
||||
registry->RegisterIntegerPref(kWebFeedContentOrder, 0);
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
}
|
||||
|
||||
} // namespace
|
||||
@@ -1428,11 +1420,14 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
|
||||
browser_shutdown::RegisterPrefs(registry);
|
||||
BrowserProcessImpl::RegisterPrefs(registry);
|
||||
ChromeContentBrowserClient::RegisterLocalStatePrefs(registry);
|
||||
#if BUILDFLAG(CHROME_FOR_TESTING)
|
||||
chrome_for_testing::RegisterPrefs(registry);
|
||||
#endif
|
||||
chrome_labs_prefs::RegisterLocalStatePrefs(registry);
|
||||
chrome_urls::RegisterPrefs(registry);
|
||||
ChromeMetricsServiceClient::RegisterPrefs(registry);
|
||||
ChromeSigninClient::RegisterLocalStatePrefs(registry);
|
||||
enterprise_connectors::RegisterLocalStatePrefs(registry);
|
||||
enterprise_groups::RegisterLocalStatePrefs(registry);
|
||||
enterprise_util::RegisterLocalStatePrefs(registry);
|
||||
component_updater::RegisterPrefs(registry);
|
||||
domain_reliability::RegisterPrefs(registry);
|
||||
@@ -1447,6 +1442,7 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
|
||||
language::UlpLanguageCodeLocator::RegisterLocalStatePrefs(registry);
|
||||
memory::EnterpriseMemoryLimitPrefObserver::RegisterPrefs(registry);
|
||||
metrics::RegisterDemographicsLocalStatePrefs(registry);
|
||||
metrics::MetricsReportingChoiceService::RegisterPrefs(registry);
|
||||
metrics::TabStatsTracker::RegisterPrefs(registry);
|
||||
network_time::NetworkTimeTracker::RegisterPrefs(registry);
|
||||
omnibox::RegisterLocalStatePrefs(registry);
|
||||
@@ -1483,7 +1479,6 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
|
||||
subresource_filter::IndexedRulesetVersion::RegisterPrefs(
|
||||
registry, subresource_filter::kSafeBrowsingRulesetConfig.filter_tag);
|
||||
SystemNetworkContextManager::RegisterPrefs(registry);
|
||||
tpcd::metadata::RegisterLocalStatePrefs(registry);
|
||||
tracing::RegisterPrefs(registry);
|
||||
update_client::RegisterPrefs(registry);
|
||||
variations::VariationsService::RegisterPrefs(registry);
|
||||
@@ -1491,6 +1486,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 +1528,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 +1567,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 +1602,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);
|
||||
@@ -1634,7 +1634,7 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
OSCrypt::RegisterLocalPrefs(registry);
|
||||
os_crypt_async::RegisterLocalPrefs(registry);
|
||||
registry->RegisterBooleanPref(prefs::kRendererAppContainerEnabled, true);
|
||||
registry->RegisterBooleanPref(prefs::kBlockBrowserLegacyExtensionPoints,
|
||||
true);
|
||||
@@ -1668,9 +1668,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,
|
||||
@@ -1733,6 +1733,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
|
||||
// User prefs. Please keep this list alphabetized.
|
||||
AccessibilityLabelsService::RegisterProfilePrefs(registry);
|
||||
AccessibilityUIMessageHandler::RegisterProfilePrefs(registry);
|
||||
accessibility_annotator::prefs::RegisterProfilePrefs(registry);
|
||||
AimEligibilityService::RegisterProfilePrefs(registry);
|
||||
AnnouncementNotificationService::RegisterProfilePrefs(registry);
|
||||
autofill::prefs::RegisterProfilePrefs(registry);
|
||||
@@ -1747,7 +1748,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 +1758,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);
|
||||
@@ -1784,14 +1786,15 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
|
||||
#endif // BUILDFLAG(ENABLE_ON_DEVICE_TRANSLATION)
|
||||
optimization_guide::prefs::RegisterProfilePrefs(registry);
|
||||
optimization_guide::model_execution::prefs::RegisterProfilePrefs(registry);
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
PageColorsController::RegisterProfilePrefs(registry);
|
||||
#endif
|
||||
password_manager::PasswordManager::RegisterProfilePrefs(registry);
|
||||
payments::RegisterProfilePrefs(registry);
|
||||
performance_manager::user_tuning::prefs::RegisterProfilePrefs(registry);
|
||||
permissions::RegisterProfilePrefs(registry);
|
||||
PermissionBubbleMediaAccessHandler::RegisterProfilePrefs(registry);
|
||||
PlatformNotificationServiceImpl::RegisterProfilePrefs(registry);
|
||||
plus_addresses::prefs::RegisterProfilePrefs(registry);
|
||||
policy::URLBlocklistManager::RegisterProfilePrefs(registry);
|
||||
PolicyUI::RegisterProfilePrefs(registry);
|
||||
PrefProxyConfigTrackerImpl::RegisterProfilePrefs(registry);
|
||||
@@ -1868,6 +1871,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)
|
||||
@@ -1899,6 +1907,14 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
|
||||
#endif
|
||||
|
||||
UnifiedAutoplayConfig::RegisterProfilePrefs(registry);
|
||||
#if BUILDFLAG(ENABLE_WEBUI_NTP)
|
||||
// TODO(b/502297163): Implement for Android.
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
NewTabFooterUI::RegisterProfilePrefs(registry);
|
||||
#endif // !BUILDFLAG(IS_ANDROID)
|
||||
NewTabPageHandler::RegisterProfilePrefs(registry);
|
||||
NewTabPageUI::RegisterProfilePrefs(registry);
|
||||
#endif // BUILDFLAG(ENABLE_WEBUI_NTP)
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
AuxiliarySearchDonationService::RegisterProfilePrefs(registry);
|
||||
@@ -1932,15 +1948,10 @@ 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);
|
||||
MicrosoftFilesPageHandler::RegisterProfilePrefs(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 +1964,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)
|
||||
@@ -2032,10 +2046,10 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
|
||||
registry);
|
||||
ash::NetworkMetadataStore::RegisterPrefs(registry);
|
||||
ash::ReleaseNotesStorage::RegisterProfilePrefs(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 +2176,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 +2287,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 +2405,23 @@ void MigrateObsoleteLocalStatePrefs(PrefService* local_state) {
|
||||
local_state->ClearPref(kProfilesDeletedOld);
|
||||
}
|
||||
|
||||
// Added 03/2026.
|
||||
local_state->ClearPref(kGlicMultiInstanceEnabledBySubscriptionTier);
|
||||
|
||||
// Added 04/2026.
|
||||
local_state->ClearPref(kTpcdMetadataCohorts);
|
||||
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
// Added 04/2026.
|
||||
tabs::MigrateHoverCardMemoryPref(local_state);
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
// Added 04/2026.
|
||||
local_state->ClearPref(kHasSeenWebFeed);
|
||||
local_state->ClearPref(kLastBadgeAnimationTime);
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
|
||||
// Please don't delete the following line. It is used by PRESUBMIT.py.
|
||||
// END_MIGRATE_OBSOLETE_LOCAL_STATE_PREFS
|
||||
|
||||
@@ -2463,56 +2477,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);
|
||||
|
||||
@@ -2626,10 +2590,10 @@ void MigrateObsoleteProfilePrefs(PrefService* profile_prefs,
|
||||
kObsoleteAutofillableCredentialsAccountStoreLoginDatabase);
|
||||
#endif // !BUILDFLAG(IS_ANDROID)
|
||||
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
#if BUILDFLAG(ENABLE_WEBUI_NTP)
|
||||
// Added 08/2025.
|
||||
NewTabPageUI::MigrateDeprecatedUseMostVisitedTilesPref(profile_prefs);
|
||||
#endif // !BUILDFLAG(IS_ANDROID)
|
||||
#endif // BUILDFLAG(ENABLE_WEBUI_NTP)
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
// Added 08/2025.
|
||||
@@ -2652,7 +2616,9 @@ void MigrateObsoleteProfilePrefs(PrefService* profile_prefs,
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
|
||||
// Added 09/2025.
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
PageColorsController::MigrateObsoleteProfilePrefs(profile_prefs);
|
||||
#endif
|
||||
profile_prefs->ClearPref(kGaiaCookieLastListAccountsData);
|
||||
|
||||
// Added 09/2025.
|
||||
@@ -2660,10 +2626,10 @@ void MigrateObsoleteProfilePrefs(PrefService* profile_prefs,
|
||||
|
||||
SigninPrefs(*profile_prefs).MigrateObsoleteSigninPrefs();
|
||||
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
#if BUILDFLAG(ENABLE_WEBUI_NTP)
|
||||
// Added 10/2025
|
||||
NewTabPageUI::MigrateDeprecatedShortcutsTypePref(profile_prefs);
|
||||
#endif // !BUILDFLAG(IS_ANDROID)
|
||||
#endif // BUILDFLAG(ENABLE_WEBUI_NTP)
|
||||
|
||||
// Added 10/2025.
|
||||
profile_prefs->ClearPref(kLegacySyncSessionsGUID);
|
||||
@@ -2704,11 +2670,56 @@ 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);
|
||||
|
||||
// Added 04/2026.
|
||||
profile_prefs->ClearPref(kPreallocatedAddressesVersion);
|
||||
profile_prefs->ClearPref(kPreallocatedAddresses);
|
||||
profile_prefs->ClearPref(kPreallocatedAddressesNext);
|
||||
profile_prefs->ClearPref(kFirstPlusAddressCreationTime);
|
||||
profile_prefs->ClearPref(kLastPlusAddressFillingTime);
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
// Added 05/2026.
|
||||
profile_prefs->ClearPref(kWebFeedContentOrder);
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
|
||||
// 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"
|
||||
@@ -128,6 +129,7 @@
|
||||
#include "components/offline_pages/buildflags/buildflags.h"
|
||||
#include "components/omnibox/common/omnibox_feature_configs.h"
|
||||
#include "components/optimization_guide/core/optimization_guide_features.h"
|
||||
#include "components/page_content_annotations/content/annotate_page_content_request.h"
|
||||
#include "components/page_content_annotations/content/page_content_annotations_web_contents_observer.h"
|
||||
#include "components/page_content_annotations/core/page_content_extraction_types.h"
|
||||
#include "components/page_info/core/features.h"
|
||||
@@ -142,6 +144,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"
|
||||
@@ -212,8 +215,8 @@
|
||||
#include "chrome/browser/chromeos/cros_apps/cros_apps_tab_helper.h"
|
||||
#include "chrome/browser/chromeos/gemini_app/gemini_app_tab_helper.h"
|
||||
#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 {
|
||||
@@ -445,7 +454,7 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
|
||||
download::NavigationMonitorFactory::GetForKey(profile->GetProfileKey()));
|
||||
history::WebContentsTopSitesObserver::CreateForWebContents(
|
||||
web_contents, TopSitesFactory::GetForProfile(profile).get());
|
||||
{
|
||||
if (!profile->IsOffTheRecord()) {
|
||||
auto* history_tab_helper =
|
||||
HistoryTabHelper::GetOrCreateForWebContents(web_contents);
|
||||
HistoryClustersTabHelper::CreateForWebContents(web_contents,
|
||||
@@ -488,12 +497,19 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
|
||||
PageContentAnnotationsServiceFactory::GetForProfile(profile);
|
||||
if (page_content_annotations_service) {
|
||||
page_content_annotations::PageContentAnnotationsWebContentsObserver::
|
||||
CreateForWebContents(
|
||||
web_contents, *page_content_annotations_service,
|
||||
page_content_annotations::PageContentExtractionServiceFactory::
|
||||
GetForProfile(profile),
|
||||
base::BindRepeating(&page_content_annotations::FetchPageContext),
|
||||
base::BindRepeating(&GetPageContentAnnotationsTabId));
|
||||
CreateForWebContents(web_contents, *page_content_annotations_service);
|
||||
|
||||
// TODO(b/478883979): Consider decoupling this from
|
||||
// PageContentAnnotationsService.
|
||||
auto* page_content_extraction_service = page_content_annotations::
|
||||
PageContentExtractionServiceFactory::GetForProfile(profile);
|
||||
if (page_content_extraction_service) {
|
||||
page_content_annotations::AnnotatedPageContentRequest::
|
||||
CreateForWebContents(
|
||||
web_contents, *page_content_extraction_service,
|
||||
base::BindRepeating(&page_content_annotations::FetchPageContext),
|
||||
base::BindRepeating(&GetPageContentAnnotationsTabId));
|
||||
}
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
// If enabled, save sensitivity data for each non-incognito android tab.
|
||||
@@ -543,7 +559,7 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
|
||||
web_contents);
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
// TODO(siggi): Remove this once the Resource Coordinator refactoring is done.
|
||||
// See https://crbug.com/910288.
|
||||
// See https://crbug.com/40604438.
|
||||
resource_coordinator::ResourceCoordinatorTabHelper::CreateForWebContents(
|
||||
web_contents);
|
||||
#if BUILDFLAG(SAFE_BROWSING_AVAILABLE)
|
||||
@@ -581,6 +597,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 +626,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)
|
||||
@@ -628,7 +649,7 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
webapps::MLInstallabilityPromoter::CreateForWebContents(web_contents);
|
||||
{
|
||||
// Remove after fixing https://crbug/905919
|
||||
// Remove after fixing https://crbug.com/41426655
|
||||
TRACE_EVENT0("browser", "AppBannerManagerAndroid::CreateForWebContents");
|
||||
webapps::AppBannerManagerAndroid::CreateForWebContents(
|
||||
web_contents, std::make_unique<webapps::ChromeAppBannerManagerAndroid>(
|
||||
@@ -636,9 +657,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(
|
||||
@@ -689,8 +716,7 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
|
||||
}
|
||||
SearchTabHelper::CreateForWebContents(web_contents);
|
||||
TabDialogs::CreateForWebContents(web_contents);
|
||||
if (base::FeatureList::IsEnabled(features::kTabHoverCardImages) ||
|
||||
base::FeatureList::IsEnabled(features::kWebUITabStrip)) {
|
||||
if (base::FeatureList::IsEnabled(features::kTabHoverCardImages)) {
|
||||
ThumbnailTabHelper::CreateForWebContents(web_contents);
|
||||
}
|
||||
UMABrowsingActivityObserver::TabHelper::CreateForWebContents(web_contents);
|
||||
@@ -715,6 +741,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);
|
||||
@@ -792,15 +819,7 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
|
||||
PluginObserver::CreateForWebContents(web_contents);
|
||||
#endif
|
||||
|
||||
// Only enable ChromeOS print preview if `kPrintPreviewCrosPrimary` is enabled
|
||||
// and is a ChromeOS build. Otherwise instantiate browser print preview.
|
||||
#if BUILDFLAG(ENABLE_PRINTING) && BUILDFLAG(IS_CHROMEOS)
|
||||
if (base::FeatureList::IsEnabled(::features::kPrintPreviewCrosPrimary)) {
|
||||
chromeos::printing::InitializePrintingForWebContents(web_contents);
|
||||
} else {
|
||||
printing::InitializePrintingForWebContents(web_contents);
|
||||
}
|
||||
#elif BUILDFLAG(ENABLE_PRINTING)
|
||||
#if BUILDFLAG(ENABLE_PRINTING)
|
||||
printing::InitializePrintingForWebContents(web_contents);
|
||||
#endif
|
||||
|
||||
|
||||
+4
-11
@@ -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"
|
||||
@@ -72,15 +73,6 @@ void ChromeContentBrowserClientWebUiPart::OverrideWebPreferences(
|
||||
blink::web_pref::WebPreferences default_prefs;
|
||||
CopyFontPrefs(/*source=*/default_prefs, /*destination=*/web_prefs);
|
||||
|
||||
#if BUILDFLAG(ENABLE_WEBUI_TAB_STRIP)
|
||||
// Set some non-font prefs for webui tabstrip. The tabstrip renderer is never
|
||||
// navigated to or from, so we don't need to replicate this logic in
|
||||
// OverrideWebPreferencesAfterNavigation.
|
||||
if (url.host() == chrome::kChromeUITabStripHost) {
|
||||
web_prefs->touch_drag_drop_enabled = true;
|
||||
web_prefs->touch_dragend_context_menu = true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool ChromeContentBrowserClientWebUiPart::OverrideWebPreferencesAfterNavigation(
|
||||
@@ -95,8 +87,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
|
||||
};
|
||||
|
||||
@@ -190,6 +185,15 @@ namespace autofillPrivate {
|
||||
STRING
|
||||
};
|
||||
|
||||
// Entity types that have an equivalent in Wallet are referred to as "passes".
|
||||
// This enum represents what kind of pass (if any) an entity type represents.
|
||||
// Note that having a pass type doesn't imply that the entity is stored in
|
||||
// Wallet. Local passes are supported by AutofillAi as well.
|
||||
enum EntityPassType {
|
||||
PUBLIC_PASS,
|
||||
PRIVATE_PASS
|
||||
};
|
||||
|
||||
// Metadata about an autofill entry (address or credit card) which is used to
|
||||
// render a summary list of all entries.
|
||||
dictionary AutofillMetadata {
|
||||
@@ -388,6 +392,9 @@ namespace autofillPrivate {
|
||||
// Note that an entity type might support Wallet and local storage
|
||||
// as well. (e.g. Vehicle).
|
||||
boolean supportsWalletStorage;
|
||||
// What kind of pass the entity type represents, if any. This field is not
|
||||
// set for non-pass entities.
|
||||
EntityPassType? passType;
|
||||
};
|
||||
|
||||
// Contains date information: month, day and year.
|
||||
@@ -428,6 +435,8 @@ namespace autofillPrivate {
|
||||
boolean? shouldAuthenticateToView;
|
||||
// Whether the entity is (or should be) stored in Google Wallet servers.
|
||||
boolean? storedInWallet;
|
||||
// Whether the entity is read only.
|
||||
boolean? isReadOnly;
|
||||
};
|
||||
|
||||
// Contains the minimum amount of information needed to display an entity
|
||||
@@ -445,6 +454,11 @@ 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;
|
||||
// Whether the entity is read only.
|
||||
boolean? isReadOnly;
|
||||
};
|
||||
|
||||
// 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);
|
||||
};
|
||||
};
|
||||
-431
@@ -1,431 +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.
|
||||
|
||||
// Private API for reporting Chrome browser status to admin console.
|
||||
namespace enterprise.reportingPrivate {
|
||||
|
||||
// Invoked by <code>UploadChromeDesktopReport</code> when the upload is
|
||||
// finished.
|
||||
// Also Invoked by <code>setDeviceData</code> when data is stored.
|
||||
callback DoneCallback = void();
|
||||
|
||||
// Invoked by <code>getDeviceId</code> to return the ID.
|
||||
callback GetDeviceIdCallback = void(DOMString id);
|
||||
|
||||
// Invoked by <code>getPersistentSecret</code> to return the secret.
|
||||
callback GetPersistentSecretCallback = void(ArrayBuffer secret);
|
||||
|
||||
// Invoked by <code>getDeviceDataCallback</code> to return the device data.
|
||||
callback GetDeviceDataCallback = void(ArrayBuffer data);
|
||||
|
||||
// Possible states a particular device setting can be in.
|
||||
enum SettingValue { UNKNOWN, DISABLED, ENABLED };
|
||||
|
||||
// Device info fields returned by the getDeviceInfo API.
|
||||
dictionary DeviceInfo {
|
||||
DOMString osName;
|
||||
DOMString osVersion;
|
||||
DOMString deviceHostName;
|
||||
DOMString deviceModel;
|
||||
DOMString serialNumber;
|
||||
SettingValue screenLockSecured;
|
||||
SettingValue diskEncrypted;
|
||||
DOMString[] macAddresses;
|
||||
DOMString? windowsMachineDomain;
|
||||
DOMString? windowsUserDomain;
|
||||
DOMString securityPatchLevel;
|
||||
|
||||
// This value is only returned on Windows for now.
|
||||
SettingValue? secureBootEnabled;
|
||||
};
|
||||
|
||||
// Invoked by <code>getDeviceInfo</code> to return device information.
|
||||
callback GetDeviceInfoCallback = void(DeviceInfo deviceInfo);
|
||||
|
||||
// Possible states for the EnterpriseRealTimeUrlCheckMode policy.
|
||||
enum RealtimeUrlCheckMode { DISABLED, ENABLED_MAIN_FRAME };
|
||||
|
||||
// Possible states for the SafeBrowsingProtectionLevel policy.
|
||||
enum SafeBrowsingLevel { DISABLED, STANDARD, ENHANCED };
|
||||
|
||||
// Possible states for the PasswordProtectionWarningTrigger policy
|
||||
enum PasswordProtectionTrigger {
|
||||
PASSWORD_PROTECTION_OFF,
|
||||
PASSWORD_REUSE,
|
||||
PHISHING_REUSE,
|
||||
POLICY_UNSET
|
||||
};
|
||||
|
||||
// Context info fields returned by the getContextInfo API.
|
||||
dictionary ContextInfo {
|
||||
DOMString[] browserAffiliationIds;
|
||||
DOMString[] profileAffiliationIds;
|
||||
DOMString[] onFileAttachedProviders;
|
||||
DOMString[] onFileDownloadedProviders;
|
||||
DOMString[] onBulkDataEntryProviders;
|
||||
DOMString[] onPrintProviders;
|
||||
RealtimeUrlCheckMode realtimeUrlCheckMode;
|
||||
DOMString[] onSecurityEventProviders;
|
||||
DOMString browserVersion;
|
||||
SafeBrowsingLevel safeBrowsingProtectionLevel;
|
||||
boolean siteIsolationEnabled;
|
||||
boolean builtInDnsClientEnabled;
|
||||
PasswordProtectionTrigger passwordProtectionWarningTrigger;
|
||||
boolean chromeRemoteDesktopAppBlocked;
|
||||
SettingValue osFirewall;
|
||||
DOMString[] systemDnsServers;
|
||||
DOMString? enterpriseProfileId;
|
||||
};
|
||||
|
||||
// Invoked by <code>getContextInfo</code> to return context information.
|
||||
callback GetContextInfoCallback = void(ContextInfo contextInfo);
|
||||
|
||||
// The status passed to the callback of <code>getCertificate</code> to
|
||||
// indicate if the required policy is set.
|
||||
enum CertificateStatus { OK, POLICY_UNSET };
|
||||
|
||||
// The certificate, if one meets the requirements, returned by the
|
||||
// $(ref:getCertificate) API. <code>encodedCertificate</code> will be
|
||||
// the DER encoding (binary encoding following X.690 Distinguished Encoding
|
||||
// Rules) of the X.509 certificate.
|
||||
dictionary Certificate {
|
||||
CertificateStatus status;
|
||||
ArrayBuffer? encodedCertificate;
|
||||
};
|
||||
|
||||
// Invoked by <code>getCertificate</code> to return the selected certificate.
|
||||
callback CertificateCallback = void(Certificate certificate);
|
||||
|
||||
// Captures the type of event so it can be associated with user or device in
|
||||
// Chrome for reporting purposes
|
||||
enum EventType { DEVICE, USER };
|
||||
|
||||
// Composite object that captures the information we need to report events.
|
||||
// Some fields like the record and priority are serialized to avoid any
|
||||
// dependency on proto definitions here, given the fact that they will likely
|
||||
// change in the future. These will be deserialized and validated in Chrome.
|
||||
dictionary EnqueueRecordRequest {
|
||||
// Serialized record data binary based on the proto definition in
|
||||
// //components/reporting/proto/synced/record.proto.
|
||||
[instanceOf=Uint8Array] ArrayBufferView recordData;
|
||||
// Serialized priority based on the proto definition in
|
||||
// //components/reporting/proto/synced/record_constants.proto. Used to
|
||||
// determine which records are shed first.
|
||||
long priority;
|
||||
EventType eventType;
|
||||
};
|
||||
|
||||
// Context object containing the content-area user's ID for whom the signals
|
||||
// collection request is for. This will be used to identify the organization
|
||||
// in which the user is, and can then be used to determine their affiliation
|
||||
// with the current browser management state.
|
||||
dictionary UserContext {
|
||||
DOMString userId;
|
||||
};
|
||||
|
||||
// Enumeration of the various states an AntiVirus software product can be in.
|
||||
enum AntiVirusProductState { ON, OFF, SNOOZED, EXPIRED };
|
||||
|
||||
// Metadata about a specific AntiVirus software product.
|
||||
dictionary AntiVirusSignal {
|
||||
DOMString displayName;
|
||||
DOMString productId;
|
||||
AntiVirusProductState state;
|
||||
};
|
||||
|
||||
// Invoked by <code>getAvInfo</code> to return information about installed
|
||||
// AntiVirus software.
|
||||
callback AvInfoCallback = void(AntiVirusSignal[] avSignals);
|
||||
|
||||
// ID of an installed hotfix system update.
|
||||
dictionary HotfixSignal {
|
||||
DOMString hotfixId;
|
||||
};
|
||||
|
||||
// Invoked by <code>getHotfixes</code> to return the IDs of installed hotfix
|
||||
// system updates.
|
||||
callback HotfixesCallback = void(HotfixSignal[] hotfixSignals);
|
||||
|
||||
// Used to indicate whether a given signal was correctly found or not, or
|
||||
// indicate a reason for not being able to find it.
|
||||
enum PresenceValue {
|
||||
// Was unable to determine whether the signal source exists or not. This
|
||||
// typically indicates that a failure occurred before even trying to assess
|
||||
// its presence.
|
||||
UNSPECIFIED,
|
||||
|
||||
// Current user does not have access to the signal's source.
|
||||
ACCESS_DENIED,
|
||||
|
||||
// The resource was not found.
|
||||
NOT_FOUND,
|
||||
|
||||
// The resource was found.
|
||||
FOUND
|
||||
};
|
||||
|
||||
// Parameter used to collect information about a specific file system
|
||||
// resource.
|
||||
dictionary GetFileSystemInfoOptions {
|
||||
DOMString path;
|
||||
boolean computeSha256;
|
||||
boolean computeExecutableMetadata;
|
||||
};
|
||||
|
||||
dictionary GetFileSystemInfoRequest {
|
||||
// Information about the for whom the signal collection request is for.
|
||||
UserContext userContext;
|
||||
|
||||
// Collection of parameters used to conduct signals collection about
|
||||
// specific file system resources.
|
||||
GetFileSystemInfoOptions[] options;
|
||||
};
|
||||
|
||||
dictionary GetFileSystemInfoResponse {
|
||||
// Path to the file system object for whom those signals were collected.
|
||||
DOMString path;
|
||||
|
||||
// Value indicating whether the specific resource could be found or not.
|
||||
PresenceValue presence;
|
||||
|
||||
// Sha256 hash of a file's bytes. Ignored when path points to a
|
||||
// directory. Collected only when computeSha256 is set to true in the
|
||||
// given signals collection parameters.
|
||||
DOMString? sha256Hash;
|
||||
|
||||
// Set of properties only relevant for executable files. Will only be
|
||||
// collected if computeExecutableMetadata is set to true in the given
|
||||
// signals collection parameters and if path points to an executable file.
|
||||
|
||||
// Is true if a currently running process was spawned from this file.
|
||||
boolean? isRunning;
|
||||
|
||||
// SHA-256 hashes of the public keys of the certificates used to sign the
|
||||
// executable. A hash is computed over the DER-encoded SubjectPublicKeyInfo
|
||||
// representation of the key.
|
||||
DOMString[]? publicKeysHashes;
|
||||
|
||||
// Product name of this executable.
|
||||
DOMString? productName;
|
||||
|
||||
// Version of this executable.
|
||||
DOMString? version;
|
||||
};
|
||||
|
||||
callback FileSystemInfoCallback =
|
||||
void(GetFileSystemInfoResponse[] fileSystemSignals);
|
||||
|
||||
enum RegistryHive {
|
||||
HKEY_CLASSES_ROOT,
|
||||
HKEY_LOCAL_MACHINE,
|
||||
HKEY_CURRENT_USER
|
||||
};
|
||||
|
||||
dictionary GetSettingsOptions {
|
||||
// Path to a collection of settings.
|
||||
// On Windows it would be the path to the reg key inside the hive.
|
||||
// On Mac it would be the path to the plist file.
|
||||
DOMString path;
|
||||
|
||||
// Key specifying the setting entry we're looking for.
|
||||
// On Windows, that will be the registry key itself.
|
||||
// On Mac, this is a key path used to retrieve a value from
|
||||
// valueForKeyPath:.
|
||||
DOMString key;
|
||||
|
||||
// When set to true, the retrieved signal will also include the setting's
|
||||
// value. When false, the signal will only contain the setting's
|
||||
// presence.
|
||||
// Supported setting types on Windows:
|
||||
// - REG_SZ
|
||||
// - REG_DWORD
|
||||
// - REG_QWORD
|
||||
// Supported setting types on Mac:
|
||||
// - NSString
|
||||
// - NSNumber
|
||||
boolean getValue;
|
||||
|
||||
// Windows registry hive containing the desired value.
|
||||
// Required value on Windows, will be ignored on other platforms.
|
||||
RegistryHive? hive;
|
||||
};
|
||||
|
||||
dictionary GetSettingsRequest {
|
||||
// Information about the for whom the signal collection request is for.
|
||||
UserContext userContext;
|
||||
|
||||
// Collection of parameters used to conduct signals collection about
|
||||
// specific settings of the system.
|
||||
GetSettingsOptions[] options;
|
||||
};
|
||||
|
||||
dictionary GetSettingsResponse {
|
||||
// Path as given in the corresponding <code>GetSettingsOptions</code>
|
||||
// request.
|
||||
DOMString path;
|
||||
|
||||
// Key as given in the corresponding <code>GetSettingsOptions</code>
|
||||
// request.
|
||||
DOMString key;
|
||||
|
||||
// Hive as given in the corresponding <code>GetSettingsOptions</code>
|
||||
// request.
|
||||
// Present on Windows only.
|
||||
RegistryHive? hive;
|
||||
|
||||
// Value indicating whether the specific resource could be found or not.
|
||||
PresenceValue presence;
|
||||
|
||||
// JSON-stringified value of the setting. Only set if <code>getValue</code>
|
||||
// was true in the corresponding request, and if the setting value was
|
||||
// retrievable.
|
||||
DOMString? value;
|
||||
};
|
||||
|
||||
callback SettingsCallback =
|
||||
void(GetSettingsResponse[] settings);
|
||||
|
||||
// Indicates what resulted from an event sent through a `DataMaskingEvent`.
|
||||
enum EventResult { EVENT_RESULT_DATA_MASKED, EVENT_RESULT_DATA_UNMASKED };
|
||||
|
||||
// Indicates the type of detector that was used match against data by the data
|
||||
// masking extension.
|
||||
enum DetectorType { PREDEFINED_DLP, USER_DEFINED };
|
||||
|
||||
// Information for a data detector used to apply data masking functionality.
|
||||
// The fields of this dictionary correspond to the proto fields of
|
||||
// `MatchedUrlNavigationRule::DataMaskingAction`.
|
||||
dictionary MatchedDetector {
|
||||
DOMString detectorId;
|
||||
DOMString displayName;
|
||||
DOMString? maskType;
|
||||
DOMString? pattern;
|
||||
DetectorType? detectorType;
|
||||
DOMString? maskText;
|
||||
};
|
||||
|
||||
// Information for a data leak prevention rule that was used to mask data.
|
||||
dictionary TriggeredRuleInfo {
|
||||
DOMString ruleId;
|
||||
DOMString ruleName;
|
||||
MatchedDetector[] matchedDetectors;
|
||||
};
|
||||
|
||||
// Event representing that something happened in the data masking extension.
|
||||
dictionary DataMaskingEvent {
|
||||
DOMString url;
|
||||
EventResult eventResult;
|
||||
TriggeredRuleInfo[] triggeredRuleInfo;
|
||||
};
|
||||
|
||||
interface Functions {
|
||||
// Gets the identity of device that Chrome browser is running on. The ID is
|
||||
// retrieved from the local device and used by the Google admin console.
|
||||
[platforms = ("win", "mac", "linux")]
|
||||
static void getDeviceId(optional GetDeviceIdCallback callback);
|
||||
|
||||
// Gets a randomly generated persistent secret (symmetric key) that
|
||||
// can be used to encrypt the data stored with |setDeviceData|. If the
|
||||
// optional parameter |forceCreation| is set to true the secret is recreated
|
||||
// in case of any failure to retrieve the currently stored one. Sets
|
||||
// $(ref:runtime.lastError) on failure.
|
||||
[platforms = ("win", "mac")]
|
||||
static void getPersistentSecret(
|
||||
optional boolean resetSecret,
|
||||
GetPersistentSecretCallback callback);
|
||||
|
||||
// Gets the device data for |id|. Sets $(ref:runtime.lastError) on failure.
|
||||
[platforms = ("win", "mac", "linux")]
|
||||
static void getDeviceData(DOMString id, GetDeviceDataCallback callback);
|
||||
|
||||
// Sets the device data for |id|. Sets $(ref:runtime.lastError) on failure.
|
||||
// If the |data| parameter is undefined and there is already data
|
||||
// associated with |id| it will be cleared.
|
||||
[platforms = ("win", "mac", "linux")]
|
||||
static void setDeviceData(
|
||||
DOMString id,
|
||||
optional ArrayBuffer data,
|
||||
optional DoneCallback callback);
|
||||
|
||||
// Gets the device information (including disk encryption status,
|
||||
// screen lock status, serial number, model).
|
||||
[platforms = ("win", "mac", "linux")]
|
||||
static void getDeviceInfo(GetDeviceInfoCallback callback);
|
||||
|
||||
// Gets the context information (including management status of the browser,
|
||||
// state of key security policies, browser version).
|
||||
static void getContextInfo(
|
||||
GetContextInfoCallback callback);
|
||||
|
||||
// Returns the certificate that would be selected by the filters in the
|
||||
// AutoSelectCertificateForUrls policy for <code>url</code>.
|
||||
static void getCertificate(
|
||||
DOMString url,
|
||||
CertificateCallback callback);
|
||||
|
||||
// Enqueues a record for upload to the reporting service
|
||||
// |request|: Composite object that captures everything
|
||||
// we need for uploading records.
|
||||
// |callback|: Callback that is triggered upon completion
|
||||
[platforms = ("chromeos")]
|
||||
static void enqueueRecord(
|
||||
EnqueueRecordRequest request,
|
||||
optional DoneCallback callback);
|
||||
|
||||
// Gets information about file system resources, specified by the contents
|
||||
// of <code>request</code>, on the current device. <code>request</code> must
|
||||
// hold a user context to be used to verify the affiliation between the
|
||||
// user's organization and the organization managing the browser. If the
|
||||
// management or affiliation states are not suitable, no results will be
|
||||
// returned.
|
||||
[platforms = ("win", "mac", "linux")]
|
||||
static void getFileSystemInfo(
|
||||
GetFileSystemInfoRequest request,
|
||||
FileSystemInfoCallback callback);
|
||||
|
||||
// Gets information about system settings specified by the contents of
|
||||
// <code>request</code>. <code>request</code> must hold a user context to be
|
||||
// used to verify the affiliation between the user's organization and the
|
||||
// organization managing the browser. If the management or affiliation
|
||||
// states are not suitable, no results will be returned.
|
||||
[platforms = ("win", "mac")]
|
||||
static void getSettings(
|
||||
GetSettingsRequest request,
|
||||
SettingsCallback callback);
|
||||
|
||||
// Gets information about AntiVirus software installed on the current
|
||||
// device. <code>userContext</code> is used to verify the affiliation
|
||||
// between the user's organization and the organization managing the
|
||||
// browser. If the management, or affiliation, state is not suitable, no
|
||||
// results will be returned.
|
||||
[platforms = ("win")]
|
||||
static void getAvInfo(UserContext userContext, AvInfoCallback callback);
|
||||
|
||||
// Gets information about hotfix system updates installed on the current
|
||||
// device. <code>userContext</code> is used to verify the affiliation
|
||||
// between the user's organization and the organization managing the
|
||||
// browser. If the management, or affiliation, state is not suitable, no
|
||||
// results will be returned.
|
||||
[platforms = ("win")]
|
||||
static void getHotfixes(UserContext userContext, HotfixesCallback callback);
|
||||
|
||||
// Sends the passed `event` to the reporting service if the browser or
|
||||
// profile is managed and the "OnSecurityEventEnterpriseConnector" policy is
|
||||
// enabled.
|
||||
static void reportDataMaskingEvent(DataMaskingEvent event,
|
||||
DoneCallback callback);
|
||||
};
|
||||
|
||||
dictionary DataMaskingRules {
|
||||
// The URL being navigated to that triggered the rules.
|
||||
DOMString url;
|
||||
|
||||
TriggeredRuleInfo[] triggeredRuleInfo;
|
||||
};
|
||||
|
||||
interface Events {
|
||||
static void onDataMaskingRulesTriggered(DataMaskingRules rules);
|
||||
};
|
||||
|
||||
};
|
||||
@@ -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);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -123,11 +123,35 @@ namespace pdfViewerPrivate {
|
||||
boolean allowJavascript;
|
||||
};
|
||||
|
||||
// Represents SkTypeface.
|
||||
dictionary Typeface {
|
||||
// From SkTypeface::uniqueID()
|
||||
long uniqueId;
|
||||
// Serialized SkTypeface
|
||||
ArrayBuffer serializedTypeface;
|
||||
};
|
||||
|
||||
dictionary GetTextInfoResult {
|
||||
Typeface[] typefaces;
|
||||
// Serialized pdf::mojom::InkTextInfo
|
||||
ArrayBuffer mojoTextInfo;
|
||||
};
|
||||
|
||||
callback GetTextInfoCallback = void(GetTextInfoResult result);
|
||||
callback GetStreamInfoCallback = void(StreamInfo streamInfo);
|
||||
callback IsAllowedLocalFileAccessCallback = void(boolean result);
|
||||
callback VoidCallback = void();
|
||||
|
||||
interface Functions {
|
||||
// Calls blink::WebFormControlElement::GetTextInfo() on the `textarea` and
|
||||
// returns the results. Additionally, skip serializing typefaces if their ID
|
||||
// appears in `knownFontIds` in order to avoid the overhead of repeating the
|
||||
// same typeface data.
|
||||
[nocompile] static void getTextInfo(
|
||||
[instanceOf=HTMLTextAreaElement] object textarea,
|
||||
long[] knownFontIds,
|
||||
GetTextInfoCallback callback);
|
||||
|
||||
// Returns the StreamInfo for the stream for this context if there is one.
|
||||
static void getStreamInfo(
|
||||
GetStreamInfoCallback callback);
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace platformKeys {
|
||||
// <p>Currently, this method only supports the "RSASSA-PKCS1-v1_5" and
|
||||
// "ECDSA" algorithms.</p>
|
||||
[nocompile, doesNotSupportPromises=
|
||||
"Multi-parameter callback crbug.com/1313625"]
|
||||
"Multi-parameter callback crbug.com/40221043"]
|
||||
static void getKeyPair(ArrayBuffer certificate,
|
||||
object parameters,
|
||||
GetKeyPairCallback callback);
|
||||
@@ -158,7 +158,7 @@ namespace platformKeys {
|
||||
// hashing algorithms "none", "SHA-1", "SHA-256", "SHA-384", and
|
||||
// "SHA-512".</p>
|
||||
[nocompile, doesNotSupportPromises=
|
||||
"Multi-parameter callback crbug.com/1313625"]
|
||||
"Multi-parameter callback crbug.com/40221043"]
|
||||
static void getKeyPairBySpki(ArrayBuffer publicKeySpkiDer,
|
||||
object parameters,
|
||||
GetKeyPairCallback callback);
|
||||
|
||||
@@ -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);
|
||||
@@ -38,7 +37,7 @@ namespace platformKeysInternal {
|
||||
// If instead the algorithm name "none" is provided, no hashing will be
|
||||
// applied, the data is PKCS#1 v1.5 padded but not hashed.
|
||||
// TODO(pneubeck): use an enum once supported:
|
||||
// http://www.crbug.com/385539 .
|
||||
// http://www.crbug.com/41115161 .
|
||||
// |data| The data to sign.
|
||||
// |callback| Called back with the signature of |data|.
|
||||
// TODO: Instead of ArrayBuffer should be (ArrayBuffer or ArrayBufferView),
|
||||
@@ -56,7 +55,7 @@ namespace platformKeysInternal {
|
||||
// <code>KeyAlgorithm</code> dictionary describing the key's algorithm. The
|
||||
// <code>name</code> property will equal <code>algorithmName</code>.
|
||||
// Otherwise, calls back with an error.
|
||||
[doesNotSupportPromises="Multi-parameter callback crbug.com/1313625"]
|
||||
[doesNotSupportPromises="Multi-parameter callback crbug.com/40221043"]
|
||||
static void getPublicKey(ArrayBuffer certificate,
|
||||
DOMString algorithmName,
|
||||
GetPublicKeyCallback callback);
|
||||
@@ -68,7 +67,7 @@ namespace platformKeysInternal {
|
||||
// <code>KeyAlgorithm</code> dictionary describing the key's algorithm. The
|
||||
// <code>name</code> property will equal <code>algorithmName</code>.
|
||||
// Otherwise, calls back with an error.
|
||||
[doesNotSupportPromises="Multi-parameter callback crbug.com/1313625"]
|
||||
[doesNotSupportPromises="Multi-parameter callback crbug.com/40221043"]
|
||||
static void getPublicKeyBySpki(ArrayBuffer publicKeySpkiDer,
|
||||
DOMString algorithmName,
|
||||
GetPublicKeyCallback callback);
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace tabCapture {
|
||||
// <code>null</code>. <code>null</code> indicates an error has occurred
|
||||
// and the client may query $(ref:runtime.lastError) to access the error
|
||||
// details.
|
||||
[doesNotSupportPromises="Custom hook sets lastError crbug.com/1504349"]
|
||||
[doesNotSupportPromises="Custom hook sets lastError crbug.com/40944873"]
|
||||
static void capture(CaptureOptions options,
|
||||
GetTabMediaCallback callback);
|
||||
|
||||
|
||||
@@ -1,65 +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.
|
||||
|
||||
// The <code>chrome.webrtcAudioPrivate</code> API allows enumeration
|
||||
// of audio output (sink) devices.
|
||||
//
|
||||
// Note that device IDs as used in this API are opaque (i.e. they are
|
||||
// not the hardware identifier of the device) and while they are
|
||||
// unique and persistent across sessions, they are valid only to the
|
||||
// extension calling this API (i.e. they cannot be shared between
|
||||
// extensions).
|
||||
//
|
||||
// See this document for further details of this API:
|
||||
// https://docs.google.com/document/d/1un8aJoUvyt5jMUkK_hoeEJ4HRw-Nf8bA25hYUOpg_Oo/
|
||||
|
||||
namespace webrtcAudioPrivate {
|
||||
|
||||
dictionary SinkInfo {
|
||||
// The opaque identifier of the audio sink device, which is unique
|
||||
// and static for the extension calling the API but invalid for
|
||||
// others.
|
||||
DOMString sinkId;
|
||||
// The user-friendly name (e.g. "Bose Amplifier").
|
||||
DOMString sinkLabel;
|
||||
// Current sample rate of the device, in Hz. Useful e.g. to know
|
||||
// if the remote side should be asked to send a lower sampling
|
||||
// rate.
|
||||
long sampleRate;
|
||||
// True if the device is ready to play out audio. E.g. if it is a
|
||||
// device that takes an audio jack, whether a jack is plugged in.
|
||||
//
|
||||
// TODO(joi): Do unplugged devices even get included in enumeration?
|
||||
boolean isReady;
|
||||
// True if this device is the default audio sink device on the
|
||||
// machine.
|
||||
boolean isDefault;
|
||||
};
|
||||
|
||||
callback GetSinksCallback = void(SinkInfo[] sinkInfo);
|
||||
callback SinkIdCallback = void(DOMString sinkId);
|
||||
|
||||
interface Functions {
|
||||
// Retrieves a list of available audio sink devices.
|
||||
static void getSinks(GetSinksCallback callback);
|
||||
|
||||
// Given a security origin and an input device ID valid for that
|
||||
// security origin, retrieve an audio sink ID valid for the
|
||||
// extension, or the empty string if there is no associated audio
|
||||
// sink.
|
||||
//
|
||||
// The associated sink ID can be used as a sink ID for
|
||||
// setActiveSink. It is valid irrespective of which process you are
|
||||
// setting the active sink for.
|
||||
static void getAssociatedSink(
|
||||
DOMString securityOrigin,
|
||||
DOMString sourceIdInOrigin,
|
||||
SinkIdCallback callback);
|
||||
};
|
||||
|
||||
interface Events {
|
||||
// Fired when audio sink devices are added or removed.
|
||||
static void onSinksChanged();
|
||||
};
|
||||
};
|
||||
+1
-1
@@ -23,7 +23,7 @@ namespace webrtcDesktopCapturePrivate {
|
||||
|
||||
interface Functions {
|
||||
// Shows desktop media picker UI with the specified set of sources.
|
||||
[doesNotSupportPromises="Synchronous return and callback crbug.com/1143032"]
|
||||
[doesNotSupportPromises="Synchronous return and callback crbug.com/40154924"]
|
||||
static long chooseDesktopMedia(DesktopCaptureSourceType[] sources,
|
||||
RequestInfo request,
|
||||
chooseDesktopMediaCallback callback);
|
||||
|
||||
@@ -172,7 +172,7 @@ namespace webrtcLoggingPrivate {
|
||||
// Returns the directory entry for the "WebRTC Logs" directory. If the
|
||||
// directory doesn't exist yet, this will create it. If the directory
|
||||
// cannot be created, this call will fail with a runtime error.
|
||||
[doesNotSupportPromises="Custom hook sets lastError crbug.com/1504349"]
|
||||
[doesNotSupportPromises="Custom hook sets lastError crbug.com/40944873"]
|
||||
static void getLogsDirectory(GetLogsDirectoryCallback callback);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -69,7 +69,6 @@
|
||||
#include "chrome/renderer/trusted_vault_encryption_keys_extension.h"
|
||||
#include "chrome/renderer/url_loader_throttle_provider_impl.h"
|
||||
#include "chrome/renderer/v8_unwinder.h"
|
||||
#include "chrome/renderer/web_link_preview_triggerer_impl.h"
|
||||
#include "chrome/renderer/websocket_handshake_throttle_provider_impl.h"
|
||||
#include "chrome/renderer/webui_browser/webui_browser_renderer_extension.h"
|
||||
#include "chrome/renderer/worker_content_settings_client.h"
|
||||
@@ -119,7 +118,8 @@
|
||||
#include "components/subresource_filter/content/renderer/subresource_filter_agent.h"
|
||||
#include "components/subresource_filter/content/renderer/unverified_ruleset_dealer.h"
|
||||
#include "components/subresource_filter/core/common/common_features.h"
|
||||
#include "components/surface_embed/buildflags/buildflags.h"
|
||||
#include "components/surface_embed/common/features.h"
|
||||
#include "components/surface_embed/renderer/create_plugin.h"
|
||||
#include "components/variations/net/variations_http_headers.h"
|
||||
#include "components/variations/variations_switches.h"
|
||||
#include "components/version_info/version_info.h"
|
||||
@@ -137,6 +137,7 @@
|
||||
#include "content/public/common/webplugininfo.h"
|
||||
#include "content/public/renderer/render_frame.h"
|
||||
#include "content/public/renderer/render_frame_visitor.h"
|
||||
#include "content/public/renderer/worker_thread.h"
|
||||
#include "extensions/buildflags/buildflags.h"
|
||||
#include "extensions/renderer/extensions_renderer_api_provider.h"
|
||||
#include "media/base/media_switches.h"
|
||||
@@ -196,10 +197,12 @@
|
||||
#include "components/feed/content/renderer/rss_link_reader.h"
|
||||
#include "components/feed/feed_feature_list.h"
|
||||
#else
|
||||
#include "chrome/common/record_replay/record_replay_features.h"
|
||||
#include "chrome/renderer/record_replay/record_replay_agent.h"
|
||||
#include "chrome/renderer/indigo/indigo_agent.h"
|
||||
#include "chrome/renderer/indigo/onboarding_agent.h"
|
||||
#include "chrome/renderer/searchbox/searchbox.h"
|
||||
#include "chrome/renderer/searchbox/searchbox_extension.h"
|
||||
#include "components/record_replay/content/renderer/record_replay_agent.h"
|
||||
#include "components/record_replay/core/common/record_replay_features.h"
|
||||
#include "components/search/ntp_features.h" // nogncheck
|
||||
#endif
|
||||
|
||||
@@ -259,11 +262,6 @@
|
||||
#endif // BUILDFLAG(HAS_SPELLCHECK_PANEL)
|
||||
#endif // BUILDFLAG(ENABLE_SPELLCHECK)
|
||||
|
||||
#if BUILDFLAG(ENABLE_SURFACE_EMBED)
|
||||
#include "components/surface_embed/common/features.h"
|
||||
#include "components/surface_embed/renderer/create_plugin.h"
|
||||
#endif // BUILDFLAG(ENABLE_SURFACE_EMBED)
|
||||
|
||||
#if BUILDFLAG(ENABLE_LIBRARY_CDMS) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID)
|
||||
#include "chrome/renderer/media/chrome_key_systems.h"
|
||||
#endif
|
||||
@@ -327,9 +325,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 +424,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,10 +472,20 @@ 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);
|
||||
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
// TODO(crbug.com/483614998): Granting Lens side panel is a temporary
|
||||
// exception to use SameSite cookies while it migrates to a <webview>
|
||||
// approach. This should not be done for other untrusted WebUI.
|
||||
blink::WebURL chrome_lens_url =
|
||||
GURL(chrome::kChromeUILensUntrustedSidePanelURL);
|
||||
WebSecurityPolicy::RegisterURLAsFirstPartyWhenTopLevelEmbeddingSecure(
|
||||
chrome_lens_url);
|
||||
#endif
|
||||
|
||||
// chrome-native: is a scheme used for placeholder navigations that allow
|
||||
// UIs to be drawn with platform native widgets instead of HTML. These pages
|
||||
// should not be accessible. No code should be runnable in these pages,
|
||||
@@ -485,7 +493,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 +502,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 +514,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,13 +554,13 @@ 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);
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
WebSecurityPolicy::RegisterURLSchemeAsAllowedForReferrer(
|
||||
WebString::FromUTF8(content::kAndroidAppScheme));
|
||||
WebString::FromUtf8(content::kAndroidAppScheme));
|
||||
#endif
|
||||
|
||||
// chrome-search: pages should not be accessible by bookmarklets
|
||||
@@ -563,7 +571,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 +713,8 @@ void ChromeContentRendererClient::RenderFrameCreated(
|
||||
record_replay::features::kRecordReplayBase)) {
|
||||
new record_replay::RecordReplayAgent(render_frame, associated_interfaces);
|
||||
}
|
||||
indigo::IndigoAgent::MaybeCreate(render_frame, associated_interfaces);
|
||||
indigo::OnboardingAgent::MaybeCreate(render_frame, associated_interfaces);
|
||||
#endif
|
||||
|
||||
if (content_capture::features::IsContentCaptureEnabled()) {
|
||||
@@ -826,9 +836,7 @@ bool ChromeContentRendererClient::IsPluginHandledExternally(
|
||||
// not supported. Here it suffices to return false but there should perhaps be
|
||||
// a more unified approach to avoid sending the IPC twice.
|
||||
chrome::mojom::PluginInfoPtr plugin_info = chrome::mojom::PluginInfo::New();
|
||||
plugin_info_host->GetPluginInfo(
|
||||
original_url, render_frame->GetWebFrame()->Top()->GetSecurityOrigin(),
|
||||
mime_type, &plugin_info);
|
||||
plugin_info_host->GetPluginInfo(original_url, mime_type, &plugin_info);
|
||||
// TODO(ekaramad): Not continuing here due to a disallowed status should take
|
||||
// us to CreatePlugin. See if more in depths investigation of |status| is
|
||||
// necessary here (see https://crbug.com/41460326). For now, returning false
|
||||
@@ -894,7 +902,7 @@ bool ChromeContentRendererClient::OverrideCreatePlugin(
|
||||
WebPlugin** plugin) {
|
||||
std::string orig_mime_type = params.mime_type.Utf8();
|
||||
|
||||
#if BUILDFLAG(ENABLE_SURFACE_EMBED)
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
if (base::FeatureList::IsEnabled(surface_embed::features::kSurfaceEmbed)) {
|
||||
GURL url = render_frame->GetWebFrame()->GetDocument().Url();
|
||||
if (url.SchemeIs(content::kChromeUIScheme) &&
|
||||
@@ -904,7 +912,7 @@ bool ChromeContentRendererClient::OverrideCreatePlugin(
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // BUILDFLAG(ENABLE_SURFACE_EMBED)
|
||||
#endif // !BUILDFLAG(IS_ANDROID)
|
||||
|
||||
#if BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
// Used for plugins.
|
||||
@@ -921,9 +929,7 @@ bool ChromeContentRendererClient::OverrideCreatePlugin(
|
||||
&plugin_info_host);
|
||||
|
||||
chrome::mojom::PluginInfoPtr plugin_info = chrome::mojom::PluginInfo::New();
|
||||
plugin_info_host->GetPluginInfo(
|
||||
url, render_frame->GetWebFrame()->Top()->GetSecurityOrigin(),
|
||||
orig_mime_type, &plugin_info);
|
||||
plugin_info_host->GetPluginInfo(url, orig_mime_type, &plugin_info);
|
||||
*plugin = CreatePlugin(render_frame, params, *plugin_info);
|
||||
#else // !BUILDFLAG(ENABLE_PLUGINS)
|
||||
if (orig_mime_type == pdf::kPDFMimeType) {
|
||||
@@ -999,7 +1005,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
||||
// actual mime type via ChromeViewHostMsg_GetPluginInfo. In that case
|
||||
// we should use what we know since WebpluginDelegateProxy does some
|
||||
// specific initializations based on this information.
|
||||
params.mime_type = WebString::FromUTF8(actual_mime_type);
|
||||
params.mime_type = WebString::FromUtf8(actual_mime_type);
|
||||
}
|
||||
|
||||
auto* content_settings_agent =
|
||||
@@ -1453,13 +1459,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1624,18 +1630,15 @@ void ChromeContentRendererClient::AppendContentSecurityPolicy(
|
||||
|
||||
// Append a minimum CSP to ensure the extension can't relax the default
|
||||
// applied CSP through means like Service Worker.
|
||||
const std::string* default_csp =
|
||||
extensions::CSPInfo::GetMinimumCSPToAppend(*extension, gurl.GetPath());
|
||||
const std::string* default_csp = extensions::CSPInfo::GetMinimumCSPToAppend(
|
||||
*extension, gurl.GetPath(),
|
||||
/*is_service_worker=*/content::WorkerThread::GetCurrentId() != 0);
|
||||
if (!default_csp)
|
||||
return;
|
||||
|
||||
csp->push_back({blink::WebString::FromUTF8(*default_csp),
|
||||
csp->push_back({blink::WebString::FromUtf8(*default_csp),
|
||||
network::mojom::ContentSecurityPolicyType::kEnforce,
|
||||
network::mojom::ContentSecurityPolicySource::kHTTP});
|
||||
#endif
|
||||
}
|
||||
|
||||
std::unique_ptr<blink::WebLinkPreviewTriggerer>
|
||||
ChromeContentRendererClient::CreateLinkPreviewTriggerer() {
|
||||
return ::CreateWebLinkPreviewTriggerer();
|
||||
}
|
||||
|
||||
@@ -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,28 @@ policies:
|
||||
1432: WebRtcDiagnosticLogCollectionAllowedForOrigins
|
||||
1433: IsolatedWebAppUserInstallationEnabled
|
||||
1434: ExtensionDOMActivityLoggingEnabled
|
||||
1435: SharedWorkerExtendedLifetimeEnabled
|
||||
1436: MaxConnectionsPerProxyForWebSocket
|
||||
1437: KrispNoiseCancellationEnabled
|
||||
1438: AndroidEntraSsoEnabled
|
||||
1439: FindsSettings
|
||||
1440: MetricsReportingLevel
|
||||
1441: DeviceMetricsReportingLevel
|
||||
1442: CpuPerformanceTierOverride
|
||||
1443: ForceForegroundPriorityForUrls
|
||||
1444: DataUrlInWebWorkerOpaqueOriginEnabled
|
||||
1445: KioskPinchToZoomAllowed
|
||||
1446: SecuritySignalsClientCertificatesSelectors
|
||||
1447: AllowSocketPoolSizeRandomizationForProxies
|
||||
1448: DefaultSubAppsWithoutPromptsSetting
|
||||
1449: SubAppsWithoutPromptsAllowedForOrigins
|
||||
1450: SubAppsWithoutPromptsBlockedForOrigins
|
||||
1451: IsolatedModeSettings
|
||||
1452: GeminiSparkSettings
|
||||
1453: SmartTabSharingSettings
|
||||
1454: HttpHeaderInjection
|
||||
1455: ChromeSuggestionsSettings
|
||||
1456: RestrictBackgroundFetchFromServiceWorkerEnabled
|
||||
|
||||
atomic_groups:
|
||||
1: Homepage
|
||||
@@ -1497,3 +1519,4 @@ atomic_groups:
|
||||
60: ProtectedContent
|
||||
61: LegacyCookieScopeSettings
|
||||
62: GeolocationSettings
|
||||
63: SocketPoolSizeSettings
|
||||
|
||||
-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
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
caption: Automatically select client certificates matching filters for <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> security signal reports.
|
||||
desc: |-
|
||||
Configures filters to select which client certificates are included in <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> security signal reports. These reports send browser and device posture information to <ph name="GOOGLE_WORKSPACE_PRODUCT_NAME">Google Workspace</ph>, which administrators can use to configure <ph name="GOOGLE_CONTEXT_AWARE_ACCESS">Context-Aware Access (CAA)</ph> rules.
|
||||
|
||||
This policy allows you to define filters based on client certificate attributes, such as the ISSUER and/or SUBJECT distinguished names. <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> will only include certificates in the signal reports if they match at least one of the filters specified.
|
||||
|
||||
Examples for the usage of the <ph name="SELECTOR_PLACEHOLDER">$SELECTOR</ph> section:
|
||||
|
||||
* When <ph name="SELECTOR_PLACEHOLDER">$SELECTOR</ph> is set to <ph name="SECURITY_SIGNALS_CLIENT_CERTIFICATE_SELECTORS_FILTER_EXAMPLE">{ "ISSUER": { "CN": "$ISSUER_CN" } }</ph>, only client certificates issued by a certificate with the CommonName <ph name="ISSUER_CN_PLACEHOLDER">$ISSUER_CN</ph> are selected.
|
||||
|
||||
* When <ph name="SELECTOR_PLACEHOLDER">$SELECTOR</ph> contains both the <ph name="ISSUER_STRING_VALUE">"ISSUER"</ph> and the <ph name="SUBJECT_STRING_VALUE">"SUBJECT"</ph> sections, only client certificates that satisfy both conditions are selected.
|
||||
|
||||
* When <ph name="SELECTOR_PLACEHOLDER">$SELECTOR</ph> contains a <ph name="SUBJECT_STRING_VALUE">"SUBJECT"</ph> section with the <ph name="FILTER_STRING_ORGANIZATION">"O"</ph> value, a certificate needs at least one organization matching the specified value to be selected.
|
||||
|
||||
* When <ph name="SELECTOR_PLACEHOLDER">$SELECTOR</ph> contains a <ph name="SUBJECT_STRING_VALUE">"SUBJECT"</ph> section with a <ph name="FILTER_STRING_ORGANIZATIONAL_UNIT">"OU"</ph> value, a certificate needs at least one organizational unit matching the specified value to be selected.
|
||||
|
||||
* When <ph name="SELECTOR_PLACEHOLDER">$SELECTOR</ph> is set to <ph name="EMPTY_DICTIONARY">{}</ph>, empty details are ignored for this policy.
|
||||
|
||||
Leaving the policy unset means there's no selection of client certificates during signal reporting.
|
||||
|
||||
*Important:* This policy only takes effect if the <ph name="USER_SECURITY_SIGNALS_REPORTING_POLICY_NAME">UserSecuritySignalsReporting</ph> policy is enabled, which controls the overall feature for sending security signals from Chrome.
|
||||
example_value:
|
||||
- ISSUER:
|
||||
CN: "certificate issuer name"
|
||||
L: "certificate issuer location"
|
||||
O: "certificate issuer org"
|
||||
OU: "certificate issuer org unit"
|
||||
SUBJECT:
|
||||
CN: "certificate subject name"
|
||||
L: "certificate subject location"
|
||||
O: "certificate subject org"
|
||||
OU: "certificate subject org unit"
|
||||
- ISSUER:
|
||||
CN: "another issuer name"
|
||||
features:
|
||||
cloud_only: true
|
||||
dynamic_refresh: true
|
||||
per_profile: true
|
||||
user_only: true
|
||||
|
||||
future_on:
|
||||
- chrome.*
|
||||
owners:
|
||||
- hmare@google.com
|
||||
- file://components/enterprise/browser/reporting/OWNERS
|
||||
schema:
|
||||
items:
|
||||
properties:
|
||||
ISSUER:
|
||||
$ref: CertPrincipalFields
|
||||
SUBJECT:
|
||||
$ref: CertPrincipalFields
|
||||
type: object
|
||||
type: array
|
||||
tags:
|
||||
- admin-sharing
|
||||
- google-sharing
|
||||
type: dict
|
||||
+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
-1
@@ -15,7 +15,6 @@ owners:
|
||||
- file://components/policy/OWNERS
|
||||
example_value: 1
|
||||
future_on:
|
||||
- android
|
||||
- chrome.linux
|
||||
features:
|
||||
dynamic_refresh: true
|
||||
@@ -39,4 +38,5 @@ supported_on:
|
||||
- chrome.mac:137-
|
||||
- ios:139-
|
||||
- chrome_os:144-
|
||||
- android:149-
|
||||
tags: []
|
||||
|
||||
+2
-3
@@ -7,15 +7,13 @@ desc: |-
|
||||
|
||||
When the policy is set to Disabled (1), the model will not be downloaded, and the existing model (if already downloaded) will be deleted.
|
||||
|
||||
On desktop platforms, model downloading can also be disabled by <ph name="COMPONENT_UPDATES_ENABLED_POLICY_NAME">ComponentUpdatesEnabled</ph>.
|
||||
On desktop platforms, model downloading can also be disabled by setting <ph name="COMPONENT_UPDATES_ENABLED_POLICY_NAME">ComponentUpdatesEnabled</ph> to false.
|
||||
|
||||
default: 0
|
||||
example_value: 1
|
||||
features:
|
||||
dynamic_refresh: true
|
||||
per_profile: false
|
||||
future_on:
|
||||
- chrome_os
|
||||
items:
|
||||
- caption: Downloads model automatically
|
||||
name: Allowed
|
||||
@@ -34,4 +32,5 @@ tags: []
|
||||
supported_on:
|
||||
- android:142-
|
||||
- chrome.*:124-
|
||||
- chrome_os:149-
|
||||
type: int-enum
|
||||
|
||||
+5
-2
@@ -3,9 +3,12 @@ desc: |-
|
||||
Setting the policy specifies for which origins to allow all the HTTP authentication schemes <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> supports regardless of the <ph name="AUTH_SCHEMES_POLICY_NAME">AuthSchemes</ph> policy.
|
||||
|
||||
Format the origin pattern according to this format (<ph name="URL_SCHEME_FORMAT_LINK">https://support.google.com/chrome/a?p=url_blocklist_filter_format</ph>). Up to 1,000 exceptions can be defined in <ph name="ALL_HTTP_AUTH_ALLOWED_FOR_ORIGINS_POLICY_NAME">AllHttpAuthSchemesAllowedForOrigins</ph>.
|
||||
Wildcards are allowed for the whole origin or parts of the origin, either the scheme, host, port.
|
||||
Wildcards are allowed for the host component (e.g., '*:8000' matches all hosts on port 8000). To match all schemes or all ports, omit the component entirely (e.g., 'example.com' matches any scheme and any port). A hostname (e.g., 'example.com') also matches its subdomains. To match a host exactly and exclude its subdomains, prepend it with a dot (e.g., '.example.com'). To match all origins, use a single asterisk ('*').
|
||||
example_value:
|
||||
- '*.example.com'
|
||||
- 'https://example.com'
|
||||
- 'example.com'
|
||||
- '*:8000'
|
||||
- '*'
|
||||
features:
|
||||
dynamic_refresh: true
|
||||
per_profile: false
|
||||
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
caption: Allow pinch-to-zoom in Kiosk mode
|
||||
default: true
|
||||
desc: |-
|
||||
Setting the policy to Enabled or leaving it unset means pinch-to-zoom is allowed in a Kiosk session.
|
||||
|
||||
Setting the policy to Disabled means pinch-to-zoom is not allowed in a Kiosk session.
|
||||
example_value: false
|
||||
features:
|
||||
dynamic_refresh: true
|
||||
per_profile: true
|
||||
items:
|
||||
- caption: Allow pinch-to-zoom in Kiosk mode
|
||||
value: true
|
||||
- caption: Disable pinch-to-zoom in Kiosk mode
|
||||
value: false
|
||||
owners:
|
||||
- poromov@google.com
|
||||
- file://chromeos/components/kiosk/OWNERS
|
||||
schema:
|
||||
type: boolean
|
||||
supported_on:
|
||||
- chrome_os:149-
|
||||
tags: []
|
||||
type: main
|
||||
+1
@@ -28,5 +28,6 @@ schema:
|
||||
supported_on:
|
||||
- chrome.*:65-
|
||||
- chrome_os:65-
|
||||
- android:149-
|
||||
tags: []
|
||||
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
|
||||
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
caption: Override for the CPU performance tier
|
||||
desc: |-
|
||||
Setting this policy allows enterprises to override the value returned by the
|
||||
<ph name="CPU_PERFORMANCE_API_NAME">CPU Performance API</ph> (i.e.,
|
||||
<ph name="CPU_PERFORMANCE_GETTER_NAME">navigator.cpuPerformance</ph>,
|
||||
please see https://github.com/WICG/cpu-performance for details).
|
||||
|
||||
If this policy is set, the value of
|
||||
<ph name="CPU_PERFORMANCE_GETTER_NAME">navigator.cpuPerformance</ph>
|
||||
will be overridden to the specified value. If the policy is not set, then
|
||||
the default performance tier calculation is used.
|
||||
|
||||
The possible values for this policy are 0 to 4.
|
||||
|
||||
example_value: 4
|
||||
|
||||
features:
|
||||
dynamic_refresh: true
|
||||
per_profile: true
|
||||
|
||||
owners:
|
||||
- nikolaos@chromium.org
|
||||
- file://content/browser/cpu_performance/OWNERS
|
||||
|
||||
schema:
|
||||
maximum: 4
|
||||
minimum: 0
|
||||
type: integer
|
||||
|
||||
supported_on:
|
||||
- chrome.*:149-
|
||||
- chrome_os:149-
|
||||
- android:149-
|
||||
- webview_android:149-
|
||||
|
||||
tags: []
|
||||
type: int
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
caption: 'Enable opaque origins for data URLs in Web Workers'
|
||||
desc: |-
|
||||
Controls whether Web Workers created from data URLs are assigned a unique opaque origin.
|
||||
|
||||
Web Workers can be created using a data URL containing the worker's script. Previously, these workers inherited the origin of the page that created them, allowing them to access the same local storage, cookies, and other origin-bound data. To improve security and align with the HTML specification, Chrome is changing its default behavior in milestone 149 so that workers created from data URLs will now have a unique, opaque origin. This isolates them from the creator page's data.
|
||||
|
||||
If this policy is set to Enabled or left unset, the new default (more secure) behavior is used, and Web Workers created from data URLs will have a unique opaque origin.
|
||||
|
||||
If this policy is set to Disabled, Chrome reverts to the legacy behavior, and Web Workers created from data URLs will inherit the origin of their creator. This allows administrators to temporarily resolve compatibility issues if internal applications break due to the security change.
|
||||
|
||||
This policy is intended to be temporary and will be removed in milestone 157.
|
||||
default: true
|
||||
example_value: false
|
||||
features:
|
||||
dynamic_refresh: true
|
||||
per_profile: true
|
||||
items:
|
||||
- caption: 'Opaque origins for data URLs in Web Workers are enabled (new default behavior)'
|
||||
value: true
|
||||
- caption: 'Opaque origins for data URLs in Web Workers are disabled (deprecated legacy behavior)'
|
||||
value: false
|
||||
owners:
|
||||
- yyanagisawa@chromium.org
|
||||
- file://content/browser/worker_host/OWNERS
|
||||
schema:
|
||||
type: boolean
|
||||
supported_on:
|
||||
- android:149-
|
||||
- chrome.*:149-
|
||||
- chrome_os:149-
|
||||
- fuchsia:149-
|
||||
tags: []
|
||||
type: main
|
||||
+1
-1
@@ -29,7 +29,7 @@ items:
|
||||
launcher/search key to change the behavior of function keys".
|
||||
value: null
|
||||
owners:
|
||||
- cambickel@google.com
|
||||
- longbowei@google.com
|
||||
- cros-device-enablement@google.com
|
||||
schema:
|
||||
type: boolean
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
caption: Force foreground priority for specific URLs
|
||||
desc: |-
|
||||
This policy allows you to specify a list of URL patterns. Background web content matching these patterns will be forced to run at foreground priority.
|
||||
|
||||
If the <ph name="FORCE_FOREGROUND_PRIORITY_FOR_ALL_TABS_POLICY_NAME">ForceForegroundPriorityForAllTabs</ph> policy is enabled, this list is ignored as all tabs will be forced to foreground priority.
|
||||
|
||||
If <ph name="FORCE_FOREGROUND_PRIORITY_FOR_ALL_TABS_POLICY_NAME">ForceForegroundPriorityForAllTabs</ph> is disabled or unset, only content matching the patterns in this list will be forced.
|
||||
|
||||
For detailed information on valid <ph name="URL_LABEL">URL</ph> patterns, please see https://support.google.com/chrome/a?p=url_blocklist_filter_format.
|
||||
|
||||
If this list is empty or not set, no background content is forced to foreground priority.
|
||||
example_value:
|
||||
- https://www.example.com/path?query=val
|
||||
- 'example.edu'
|
||||
- https://example.com:8080
|
||||
- '*://example.org:*/'
|
||||
features:
|
||||
dynamic_refresh: true
|
||||
per_profile: true
|
||||
owners:
|
||||
- pmonette@chromium.org
|
||||
- zmin@chromium.org
|
||||
- file://components/performance_manager/OWNERS
|
||||
schema:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
supported_on:
|
||||
- chrome.*:149-
|
||||
- chrome_os:149-
|
||||
tags: []
|
||||
type: list
|
||||
-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
|
||||
+23
-8
@@ -1,22 +1,37 @@
|
||||
caption: Maximal number of concurrent connections to the proxy server
|
||||
default: 32
|
||||
caption: Maximal number of concurrent connections per proxy server for non-WebSocket requests
|
||||
default: 128
|
||||
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.
|
||||
example_value: 32
|
||||
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 128 is used.
|
||||
|
||||
Some web apps are known to consume many connections with hanging GETs, so setting a value below 128 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 (128) 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 (128) at your own risk.
|
||||
example_value: 128
|
||||
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: 128
|
||||
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 128 is used.
|
||||
|
||||
Some web apps are known to consume many connections with hanging GETs, so setting a value below 128 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 (128) 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 (128) at your own risk.
|
||||
example_value: 128
|
||||
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
|
||||
+2
@@ -8,6 +8,8 @@ desc: |-
|
||||
When this policy is not set, users can choose the anonymous reporting behavior at installation or first run, and can change this setting later.
|
||||
|
||||
(For <ph name="PRODUCT_OS_NAME">$2<ex>Google ChromeOS</ex></ph>, see <ph name="DEVICE_METRICS_REPORTING_ENABLED_POLICY_NAME">DeviceMetricsReportingEnabled</ph>.)
|
||||
|
||||
If the <ph name="RESTRUCTURE_METRICS_CONSENT_SETTINGS_EXPERIMENT_NAME">RestructureMetricsConsentSettings</ph> experiment is active on the device and both this policy and the <ph name="METRICS_REPORTING_LEVEL_POLICY_NAME">MetricsReportingLevel</ph> policy are set, the <ph name="METRICS_REPORTING_LEVEL_POLICY_NAME">MetricsReportingLevel</ph> policy takes precedence.
|
||||
example_value: true
|
||||
features:
|
||||
can_be_recommended: true
|
||||
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
caption: Metrics reporting level
|
||||
default: null
|
||||
desc: |-
|
||||
Specifies the level of metrics reporting for <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>.
|
||||
|
||||
When this policy is set, it determines how much usage and crash-related data is reported to Google:
|
||||
* 0 = Disable reporting: No usage or crash-related data is sent to Google.
|
||||
* 1 = Basic reporting: A limited set of usage and crash-related data is sent to Google.
|
||||
* 2 = Advanced reporting: A comprehensive set of usage and crash-related data is sent to Google.
|
||||
|
||||
If this policy is left not set, the user can choose the metrics reporting behavior at installation or first run, and can change this setting later.
|
||||
|
||||
This policy is only evaluated if the <ph name="RESTRUCTURE_METRICS_CONSENT_SETTINGS_EXPERIMENT_NAME">RestructureMetricsConsentSettings</ph> experiment is active on the device.
|
||||
|
||||
If the <ph name="RESTRUCTURE_METRICS_CONSENT_SETTINGS_EXPERIMENT_NAME">RestructureMetricsConsentSettings</ph> experiment is active on the device and both this policy and the <ph name="METRICS_REPORTING_ENABLED_POLICY_NAME">MetricsReportingEnabled</ph> policy are set, this policy takes precedence.
|
||||
example_value: 1
|
||||
features:
|
||||
can_be_recommended: true
|
||||
dynamic_refresh: true
|
||||
per_profile: false
|
||||
future_on:
|
||||
- chrome.*
|
||||
- android
|
||||
- ios
|
||||
items:
|
||||
- caption: Disable reporting
|
||||
name: None
|
||||
value: 0
|
||||
- caption: Basic reporting
|
||||
name: Basic
|
||||
value: 1
|
||||
- caption: Advanced reporting
|
||||
name: Advanced
|
||||
value: 2
|
||||
owners:
|
||||
- file://components/policy/OWNERS
|
||||
- heychirag@google.com
|
||||
schema:
|
||||
enum:
|
||||
- 0
|
||||
- 1
|
||||
- 2
|
||||
type: integer
|
||||
sensitive: false
|
||||
tags:
|
||||
- google-sharing
|
||||
type: int-enum
|
||||
+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: Restrict Background Fetch API when called from a Service Worker
|
||||
default: true
|
||||
desc: |-
|
||||
This policy controls whether background fetch requests from Service Workers are restricted. If a feature that downloads files in the background is affected, this policy may be relevant.
|
||||
|
||||
If this policy is set to Enabled, or left unset, the restriction is active, and background fetch requests from Service Worker contexts may be blocked.
|
||||
|
||||
If this policy is set to Disabled, the restriction is bypassed, allowing all Service Workers to make background fetch requests.
|
||||
|
||||
This enterprise policy is temporary, and will be removed after M152.
|
||||
example_value: true
|
||||
features:
|
||||
dynamic_refresh: true
|
||||
per_profile: true
|
||||
items:
|
||||
- caption: 'Enabled: Background Fetch from Service Workers is restricted.'
|
||||
value: true
|
||||
- caption: 'Disabled: Background Fetch from Service Workers is allowed without restrictions.'
|
||||
value: false
|
||||
owners:
|
||||
- yyanagisawa@chromium.org
|
||||
- sisidovski@chromium.org
|
||||
- file://content/browser/background_fetch/OWNERS
|
||||
schema:
|
||||
type: boolean
|
||||
supported_on:
|
||||
- chrome.*:149-
|
||||
- chrome_os:149-
|
||||
- android:149-
|
||||
tags: []
|
||||
type: main
|
||||
+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
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
SocketPoolSizeSettings:
|
||||
caption: Socket pool size settings
|
||||
policies:
|
||||
- MaxConnectionsPerProxy
|
||||
- MaxConnectionsPerProxyForWebSocket
|
||||
+1
@@ -32,5 +32,6 @@ supported_on:
|
||||
- android:119-136
|
||||
- chrome.*:119-136
|
||||
- chrome_os:119-136
|
||||
deprecated: true
|
||||
tags: []
|
||||
type: main
|
||||
|
||||
-2
@@ -7,8 +7,6 @@ desc: |-
|
||||
If you set this policy to Disabled, then the Ad measurement setting will be turned off for your users.
|
||||
If you set this policy to Enabled or keep it unset, your users will be able to turn on or off the <ph name="PRIVACY_SANDBOX_NAME">Privacy Sandbox</ph> Ad measurement setting on their device.
|
||||
|
||||
Setting this policy requires setting the <ph name="PRIVACY_SANDBOX_PROMPT_ENABLED_POLICY_NAME">PrivacySandboxPromptEnabled</ph> policy to Disabled.
|
||||
|
||||
This policy is deprecated as of <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> version 144 with the deprecation of the Attribution Reporting API.
|
||||
example_value: false
|
||||
features:
|
||||
|
||||
-2
@@ -7,8 +7,6 @@ desc: |-
|
||||
If you set this policy to Disabled, then the Ad topics setting will be turned off for your users.
|
||||
If you set this policy to Enabled or keep it unset, your users will be able to turn on or off the <ph name="PRIVACY_SANDBOX_NAME">Privacy Sandbox</ph> Ad topics setting on their device.
|
||||
|
||||
Setting this policy requires setting the <ph name="PRIVACY_SANDBOX_PROMPT_ENABLED_POLICY_NAME">PrivacySandboxPromptEnabled</ph> policy to Disabled.
|
||||
|
||||
This policy is deprecated as of <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> version 144 with the deprecation of Topics API.
|
||||
example_value: false
|
||||
features:
|
||||
|
||||
+4
@@ -1,6 +1,9 @@
|
||||
caption: Choose whether the <ph name="PRIVACY_SANDBOX_NAME">Privacy Sandbox</ph> prompt can be shown to your users
|
||||
default: true
|
||||
deprecated: true
|
||||
desc: |-
|
||||
This policy is deprecated because the <ph name="PRIVACY_SANDBOX_NAME">Privacy Sandbox</ph> prompt configuration is no longer supported.
|
||||
|
||||
A policy to control whether your users see the <ph name="PRIVACY_SANDBOX_NAME">Privacy Sandbox</ph> prompt.
|
||||
The prompt is a user-blocking flow which informs your users of the <ph name="PRIVACY_SANDBOX_NAME">Privacy Sandbox</ph> settings. See <ph name="PRIVACY_SANDBOX_URL">https://privacysandbox.com</ph> for details about Chrome’s effort to deprecate third-party cookies.
|
||||
|
||||
@@ -27,6 +30,7 @@ owners:
|
||||
- file://components/privacy_sandbox/OWNERS
|
||||
schema:
|
||||
type: boolean
|
||||
# TODO(crbug.com/474716334): Remove support after M149 branches.
|
||||
supported_on:
|
||||
- chrome.*:111-
|
||||
- chrome_os:111-
|
||||
|
||||
-2
@@ -7,8 +7,6 @@ desc: |-
|
||||
If you set this policy to Disabled, then the Site-suggested ads setting will be turned off for your users.
|
||||
If you set this policy to Enabled or keep it unset, your users will be able to turn on or off the <ph name="PRIVACY_SANDBOX_NAME">Privacy Sandbox</ph> Site-suggested ads setting on their device.
|
||||
|
||||
Setting this policy requires setting the <ph name="PRIVACY_SANDBOX_PROMPT_ENABLED_POLICY_NAME">PrivacySandboxPromptEnabled</ph> policy to Disabled.
|
||||
|
||||
This policy is deprecated as of <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> version 144 with the deprecation of the Protected Audience API.
|
||||
example_value: false
|
||||
features:
|
||||
|
||||
-1
@@ -1,7 +1,6 @@
|
||||
PrivacySandbox:
|
||||
caption: Privacy sandbox settings controls
|
||||
policies:
|
||||
- PrivacySandboxPromptEnabled
|
||||
- PrivacySandboxAdTopicsEnabled
|
||||
- PrivacySandboxSiteEnabledAdsEnabled
|
||||
- PrivacySandboxAdMeasurementEnabled
|
||||
|
||||
+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
|
||||
supported_on:
|
||||
- android:149-
|
||||
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
|
||||
+2
@@ -6,6 +6,8 @@ desc: |-
|
||||
For managed devices, this policy is enabled by default and sends metrics to Google.
|
||||
|
||||
For unmanaged devices, the user can make the decision to send the metrics when the policy is unset.
|
||||
|
||||
If the <ph name="RESTRUCTURE_METRICS_CONSENT_SETTINGS_EXPERIMENT_NAME">RestructureMetricsConsentSettings</ph> experiment is active on the device and both this policy and the <ph name="DEVICE_METRICS_REPORTING_LEVEL_POLICY_NAME">DeviceMetricsReportingLevel</ph> policy are set, the <ph name="DEVICE_METRICS_REPORTING_LEVEL_POLICY_NAME">DeviceMetricsReportingLevel</ph> policy takes precedence.
|
||||
default: null
|
||||
device_only: true
|
||||
example_value: true
|
||||
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
arc_support: This policy also controls Android usage and diagnostic data collection.
|
||||
caption: Device metrics reporting level
|
||||
default: null
|
||||
desc: |-
|
||||
Specifies the level of metrics reporting for <ph name="PRODUCT_OS_NAME">$2<ex>Google ChromeOS</ex></ph>.
|
||||
|
||||
When this policy is set, it determines how much usage and crash-related data is reported to Google:
|
||||
* 0 = Disable reporting: No usage or crash-related data is sent to Google.
|
||||
* 1 = Basic reporting: A limited set of usage and crash-related data is sent to Google.
|
||||
* 2 = Advanced reporting: A comprehensive set of usage and crash-related data is sent to Google.
|
||||
|
||||
If this policy is left not set, the user can choose the metrics reporting behavior at installation or first run, and can change this setting later.
|
||||
|
||||
This policy is only evaluated if the <ph name="RESTRUCTURE_METRICS_CONSENT_SETTINGS_EXPERIMENT_NAME">RestructureMetricsConsentSettings</ph> experiment is active on the device.
|
||||
|
||||
If the <ph name="RESTRUCTURE_METRICS_CONSENT_SETTINGS_EXPERIMENT_NAME">RestructureMetricsConsentSettings</ph> experiment is active on the device and both this policy and the <ph name="DEVICE_METRICS_REPORTING_ENABLED_POLICY_NAME">DeviceMetricsReportingEnabled</ph> policy are set, this policy takes precedence.
|
||||
device_only: true
|
||||
example_value: 1
|
||||
features:
|
||||
dynamic_refresh: true
|
||||
future_on:
|
||||
- chrome_os
|
||||
items:
|
||||
- caption: Disable reporting
|
||||
name: None
|
||||
value: 0
|
||||
- caption: Basic reporting
|
||||
name: Basic
|
||||
value: 1
|
||||
- caption: Advanced reporting
|
||||
name: Advanced
|
||||
value: 2
|
||||
owners:
|
||||
- file://components/policy/OWNERS
|
||||
- heychirag@google.com
|
||||
schema:
|
||||
enum:
|
||||
- 0
|
||||
- 1
|
||||
- 2
|
||||
type: integer
|
||||
tags:
|
||||
- admin-sharing
|
||||
- google-sharing
|
||||
type: int-enum
|
||||
generate_device_proto: true
|
||||
@@ -128,8 +128,7 @@
|
||||
#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/surface_embed/surface_embed_connector_impl.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"
|
||||
@@ -163,7 +162,6 @@
|
||||
#include "content/public/browser/permission_descriptor_util.h"
|
||||
#include "content/public/browser/picture_in_picture_window_controller.h"
|
||||
#include "content/public/browser/preload_pipeline_info.h"
|
||||
#include "content/public/browser/preview_cancel_reason.h"
|
||||
#include "content/public/browser/render_widget_host_iterator.h"
|
||||
#include "content/public/browser/render_widget_host_observer.h"
|
||||
#include "content/public/browser/restore_type.h"
|
||||
@@ -174,6 +172,8 @@
|
||||
#include "content/public/browser/web_contents_delegate.h"
|
||||
#include "content/public/browser/web_contents_view_delegate.h"
|
||||
#include "content/public/browser/web_ui_controller.h"
|
||||
#include "content/public/browser/webid/federated_embedder_login_request.h"
|
||||
#include "content/public/browser/webid/identity_credential_source.h"
|
||||
#include "content/public/browser/webui_config.h"
|
||||
#include "content/public/browser/webui_config_map.h"
|
||||
#include "content/public/common/content_client.h"
|
||||
@@ -199,6 +199,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"
|
||||
@@ -437,9 +438,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);
|
||||
@@ -466,27 +467,6 @@ base::flat_set<WebContentsImpl*> GetAllOpeningWebContents(
|
||||
return result;
|
||||
}
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
float GetDeviceScaleAdjustment(int min_width) {
|
||||
static const float kMinFSM = 1.05f;
|
||||
static const int kWidthForMinFSM = 320;
|
||||
static const float kMaxFSM = 1.3f;
|
||||
static const int kWidthForMaxFSM = 800;
|
||||
|
||||
if (min_width <= kWidthForMinFSM) {
|
||||
return kMinFSM;
|
||||
}
|
||||
if (min_width >= kWidthForMaxFSM) {
|
||||
return kMaxFSM;
|
||||
}
|
||||
|
||||
// The font scale multiplier varies linearly between kMinFSM and kMaxFSM.
|
||||
float ratio = static_cast<float>(min_width - kWidthForMinFSM) /
|
||||
(kWidthForMaxFSM - kWidthForMinFSM);
|
||||
return ratio * (kMaxFSM - kMinFSM) + kMinFSM;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Store a set of fullscreen WebContents and metadata for the browser context.
|
||||
// Storing this information on the browser context is done for two reasons. One,
|
||||
// related WebContentses must necessarily share a browser context, so this saves
|
||||
@@ -1140,6 +1120,14 @@ void WebContentsImpl::WebContentsTreeNode::OnFrameTreeNodeDestroyed(
|
||||
}
|
||||
}
|
||||
|
||||
void WebContentsImpl::NotifySwappedRWHVChildFrameFromRenderManager(
|
||||
RenderWidgetHostViewChildFrame* new_view,
|
||||
bool allow_paint_holding) {
|
||||
if (surface_embed_connector_) {
|
||||
surface_embed_connector_->SetView(new_view, allow_paint_holding);
|
||||
}
|
||||
}
|
||||
|
||||
FrameTree* WebContentsImpl::WebContentsTreeNode::focused_frame_tree() {
|
||||
CHECK(focused_frame_tree_);
|
||||
return focused_frame_tree_;
|
||||
@@ -1347,8 +1335,7 @@ WebContentsImpl::WebContentsImpl(BrowserContext* browser_context)
|
||||
showing_context_menu_(false),
|
||||
prerender_host_registry_(std::make_unique<PrerenderHostRegistry>(*this)),
|
||||
compositor_frame_sink_grouping_id_(base::UnguessableToken::Create()),
|
||||
fenced_frame_viewport_observer_(
|
||||
std::make_unique<FencedFrameViewportObserver>(this)) {
|
||||
tracing_track_(content::GetWebContentsTracingTrack(web_contents_token_)) {
|
||||
TRACE_EVENT0("content", "WebContentsImpl::WebContentsImpl");
|
||||
WebContentsOfBrowserContext::Attach(*this);
|
||||
node_.SetFocusedFrameTree(&primary_frame_tree_);
|
||||
@@ -1420,6 +1407,10 @@ WebContentsImpl::~WebContentsImpl() {
|
||||
GetOuterWebContents()->DetachUnownedInnerWebContents(this);
|
||||
}
|
||||
|
||||
if (surface_embed_connector_) {
|
||||
ClearSurfaceEmbedConnector();
|
||||
}
|
||||
|
||||
if (pointer_lock_widget_) {
|
||||
pointer_lock_widget_->RejectPointerLockOrUnlockIfNecessary(
|
||||
blink::mojom::PointerLockResult::kElementDestroyed);
|
||||
@@ -1585,10 +1576,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()) {
|
||||
@@ -1685,6 +1676,14 @@ base::WeakPtr<WebContents> WebContentsImpl::GetWeakPtr() {
|
||||
return weak_factory_.GetWeakPtr();
|
||||
}
|
||||
|
||||
const WebContents::UniqueToken& WebContentsImpl::GetUniqueToken() const {
|
||||
return web_contents_token_;
|
||||
}
|
||||
|
||||
const perfetto::NamedTrack& WebContentsImpl::GetTracingTrack() const {
|
||||
return *tracing_track_;
|
||||
}
|
||||
|
||||
const GURL& WebContentsImpl::GetURL() {
|
||||
return GetVisibleURL();
|
||||
}
|
||||
@@ -2193,6 +2192,24 @@ void WebContentsImpl::DidCapturedSurfaceControl() {
|
||||
observers_.NotifyObservers(&WebContentsObserver::OnCapturedSurfaceControl);
|
||||
}
|
||||
|
||||
void WebContentsImpl::OnFedCmFederatedLogin(
|
||||
webid::FederatedLoginResult result) {
|
||||
observers_.NotifyObservers(&WebContentsObserver::OnFedCmFederatedLogin,
|
||||
result == webid::FederatedLoginResult::kSuccess);
|
||||
|
||||
// OnFedCmFederatedLogin() may be invoked while the WebContents is being
|
||||
// destroyed, so be careful when trying to access the Page.
|
||||
if (IsBeingDestroyed()) {
|
||||
return;
|
||||
}
|
||||
|
||||
webid::FederatedEmbedderLoginRequest* embedder_login_request =
|
||||
webid::FederatedEmbedderLoginRequest::Get(this);
|
||||
if (embedder_login_request) {
|
||||
embedder_login_request->OnFederatedResultReceived(result);
|
||||
}
|
||||
}
|
||||
|
||||
void WebContentsImpl::ResetAccessibility() {
|
||||
// Reset accessibility for all frames in this tree and inner trees, including
|
||||
// speculative frame hosts and those in the back-forward cache. See comment in
|
||||
@@ -2692,12 +2709,6 @@ base::ScopedClosureRunner WebContentsImpl::IncrementCapturerCount(
|
||||
stay_hidden, stay_awake, is_activity));
|
||||
}
|
||||
|
||||
const blink::mojom::CaptureHandleConfig&
|
||||
WebContentsImpl::GetCaptureHandleConfig() {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
return capture_handle_config_;
|
||||
}
|
||||
|
||||
bool WebContentsImpl::IsBeingCaptured() {
|
||||
return visible_capturer_count_ + hidden_capturer_count_ > 0;
|
||||
}
|
||||
@@ -3020,8 +3031,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 +3054,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 +3085,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 +3097,6 @@ bool WebContentsImpl::ShouldIgnoreInputEventsForTesting() {
|
||||
return ShouldIgnoreInputEvents();
|
||||
}
|
||||
|
||||
bool WebContentsImpl::ShouldIgnoreA11yInputEventsForTesting() {
|
||||
return ShouldIgnoreA11yInputEvents();
|
||||
}
|
||||
|
||||
bool WebContentsImpl::HasActiveEffectivelyFullscreenVideo() {
|
||||
return IsFullscreen() &&
|
||||
media_web_contents_observer_->HasActiveEffectivelyFullscreenVideo();
|
||||
@@ -3317,7 +3317,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 +3465,116 @@ void WebContentsImpl::DetachUnownedInnerWebContents(
|
||||
inner_main_frame->UpdateAXTreeData();
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
surface_embed_connector_->UpdateViewForCurrentRenderFrameHost();
|
||||
}
|
||||
|
||||
void WebContentsImpl::ClearSurfaceEmbedConnector() {
|
||||
CHECK(surface_embed_connector_);
|
||||
|
||||
// Because there may be child frames, we need to unregister all RWHVs before
|
||||
// destroying main frames views which could prevent child frames from finding
|
||||
// the root view for unregistering observer from
|
||||
// TouchSelectionControllerClient, and before clearing the connector, which
|
||||
// will change the TextInputManager and InputEventRouter for this WebContents.
|
||||
RecursivelyUnregisterRenderWidgetHostViews();
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
void WebContentsImpl::AttachGuestPage(
|
||||
std::unique_ptr<GuestPageHolder> guest_page,
|
||||
RenderFrameHost* outer_render_frame_host) {
|
||||
@@ -3621,15 +3731,6 @@ void WebContentsImpl::ReattachToOuterWebContentsFrame() {
|
||||
GetPrimaryMainFrame()->UpdateAXTreeData();
|
||||
}
|
||||
|
||||
void WebContentsImpl::DidActivatePreviewedPage(
|
||||
base::TimeTicks activation_time) {
|
||||
TRACE_EVENT1("content", "WebContentsImpl::DidActivatePreviewedPage",
|
||||
"activation_time", activation_time);
|
||||
observers_.NotifyObservers(&WebContentsObserver::DidActivatePreviewedPage,
|
||||
activation_time);
|
||||
GetDelegate()->DidActivatePreviewedPage();
|
||||
}
|
||||
|
||||
void WebContentsImpl::DidChangeVisibleSecurityState() {
|
||||
OPTIONAL_TRACE_EVENT0("content",
|
||||
"WebContentsImpl::DidChangeVisibleSecurityState");
|
||||
@@ -3709,6 +3810,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)
|
||||
@@ -3831,10 +3937,6 @@ const blink::web_pref::WebPreferences WebContentsImpl::ComputeWebPreferences(
|
||||
prefs.media_controls_enabled = false;
|
||||
}
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
prefs.device_scale_adjustment = GetDeviceScaleAdjustment(min_width_in_dp);
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
|
||||
// GuestViews in the same StoragePartition need to find each other's frames.
|
||||
prefs.renderer_wide_named_frame_lookup =
|
||||
IsGuest() || main_frame->frame_tree()->is_guest();
|
||||
@@ -3897,8 +3999,6 @@ const blink::web_pref::WebPreferences WebContentsImpl::ComputeWebPreferences(
|
||||
|
||||
// Ensure no further viewport scaling
|
||||
prefs.shrinks_viewport_contents_to_fit = false;
|
||||
// Not needed for larger form factors
|
||||
prefs.text_autosizing_enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4141,7 +4241,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
params.initially_use_platform_autofill;
|
||||
|
||||
is_never_composited_ = params.is_never_composited;
|
||||
is_in_preview_mode_ = params.preview_mode;
|
||||
|
||||
creator_location_ = params.creator_location;
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
java_creator_location_ = params.java_creator_location;
|
||||
@@ -4232,8 +4332,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 +4677,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 +4687,10 @@ WebContentsImpl::GetInputEventRouter() {
|
||||
return GetOuterWebContents()->GetInputEventRouter();
|
||||
}
|
||||
|
||||
if (surface_embed_connector_) {
|
||||
return surface_embed_connector_->GetInputEventRouter();
|
||||
}
|
||||
|
||||
if (!rwh_input_event_router_.get()) {
|
||||
rwh_input_event_router_ =
|
||||
MakeRefCounted<input::RenderWidgetHostInputEventRouter>(
|
||||
@@ -4664,7 +4763,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 +4775,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 +4793,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 +4827,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;
|
||||
@@ -4851,8 +4960,7 @@ ui::mojom::WindowShowState WebContentsImpl::GetWindowShowState() {
|
||||
: ui::mojom::WindowShowState::kDefault;
|
||||
}
|
||||
|
||||
blink::mojom::DevicePostureProvider*
|
||||
WebContentsImpl::GetDevicePostureProvider() {
|
||||
DevicePostureProviderImpl* WebContentsImpl::GetDevicePostureProvider() {
|
||||
return DevicePostureProviderImpl::GetOrCreate(this);
|
||||
}
|
||||
|
||||
@@ -5168,6 +5276,24 @@ void WebContentsImpl::LostPointerLock(
|
||||
}
|
||||
}
|
||||
|
||||
bool WebContentsImpl::IsPointerLockSandboxedForWidget(
|
||||
RenderWidgetHostImpl* render_widget_host) {
|
||||
// Check the sandbox flags of the frame that owns the requesting widget.
|
||||
// It is ok to only check the top-most frame of the widget, because any
|
||||
// subframes within the widget will be at least as restrictive as it. Any
|
||||
// additional restrictions imposed on subframes of the widget cannot be
|
||||
// enforced by the browser process, because they share a renderer process
|
||||
// with the top-most frame of the widget.
|
||||
// Note: crbug.com/492211919
|
||||
for (FrameTreeNode* node : GetPrimaryFrameTree().Nodes()) {
|
||||
RenderFrameHostImpl* rfh = node->current_frame_host();
|
||||
if (rfh && rfh->GetRenderWidgetHost() == render_widget_host) {
|
||||
return rfh->IsSandboxed(network::mojom::WebSandboxFlags::kPointerLock);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool WebContentsImpl::HasPointerLock(RenderWidgetHostImpl* render_widget_host) {
|
||||
// To verify if the mouse is locked, the mouse_lock_widget_ needs to be
|
||||
// assigned to the widget that requested the mouse lock, and the top-level
|
||||
@@ -5284,6 +5410,15 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
"opener", opener, "params", params);
|
||||
DCHECK(opener);
|
||||
|
||||
// Block Document Picture-in-Picture window creation if the delegate reports
|
||||
// that the OS currently prevents it (e.g., Android in app fullscreen).
|
||||
// `NEW_PICTURE_IN_PICTURE` is specific to Document PiP and does not affect
|
||||
// traditional video PiP or regular popups.
|
||||
if (params.disposition == WindowOpenDisposition::NEW_PICTURE_IN_PICTURE &&
|
||||
delegate_ && delegate_->IsDocumentPictureInPictureBlockedBySystem()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (active_file_chooser_) {
|
||||
// Do not allow opening a new window or tab while a file select is active
|
||||
// file chooser to avoid user confusion over which tab triggered the file
|
||||
@@ -5527,7 +5662,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 +6020,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(
|
||||
@@ -5932,21 +6075,24 @@ bool WebContentsImpl::CheckMediaAccessPermission(
|
||||
render_frame_host, security_origin, type);
|
||||
}
|
||||
|
||||
void WebContentsImpl::SetCaptureHandleConfig(
|
||||
blink::mojom::CaptureHandleConfigPtr config) {
|
||||
void WebContentsImpl::OnCaptureHandleConfigUpdate(Page& page) {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
|
||||
if (capture_handle_config_ == *config) {
|
||||
return; // Avoid unnecessary notifications.
|
||||
// Only broadcast to tab-level observers if the update comes from the primary
|
||||
// page.
|
||||
if (!page.IsPrimary()) {
|
||||
return;
|
||||
}
|
||||
|
||||
capture_handle_config_ = std::move(*config);
|
||||
|
||||
// Propagates the capture-handle-config inside of the browser process.
|
||||
// Only render processes which are eligible based on |permittedOrigins|
|
||||
// will get this.
|
||||
observers_.NotifyObservers(&WebContentsObserver::OnCaptureHandleConfigUpdate,
|
||||
capture_handle_config_);
|
||||
const auto& config = page.GetCaptureHandleConfig();
|
||||
const url::Origin& origin = page.GetMainDocument().GetLastCommittedOrigin();
|
||||
if (config != last_notified_capture_handle_config_ ||
|
||||
(origin != last_notified_capture_handle_origin_ &&
|
||||
config.expose_origin)) {
|
||||
last_notified_capture_handle_config_ = config;
|
||||
last_notified_capture_handle_origin_ = origin;
|
||||
observers_.NotifyObservers(
|
||||
&WebContentsObserver::OnCaptureHandleConfigUpdate, config);
|
||||
}
|
||||
}
|
||||
|
||||
bool WebContentsImpl::IsJavaScriptDialogShowing() const {
|
||||
@@ -6195,6 +6341,10 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
|
||||
return GetOuterWebContents()->GetTextInputManager();
|
||||
}
|
||||
|
||||
if (surface_embed_connector_) {
|
||||
return surface_embed_connector_->GetTextInputManager();
|
||||
}
|
||||
|
||||
if (!text_input_manager_ && !browser_plugin_guest_) {
|
||||
text_input_manager_ = std::make_unique<TextInputManager>();
|
||||
}
|
||||
@@ -6282,7 +6432,9 @@ void WebContentsImpl::MoveCaret(const gfx::Point& extent) {
|
||||
|
||||
base::UnguessableToken WebContentsImpl::GetCompositorFrameSinkGroupingId()
|
||||
const {
|
||||
return compositor_frame_sink_grouping_id_;
|
||||
const WebContentsImpl* root =
|
||||
const_cast<WebContentsImpl*>(this)->GetOutermostWebContents();
|
||||
return root->compositor_frame_sink_grouping_id_;
|
||||
}
|
||||
|
||||
void WebContentsImpl::AdjustSelectionByCharacterOffset(
|
||||
@@ -6303,6 +6455,28 @@ 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 = region->bounding_box;
|
||||
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 +7425,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 +7452,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() {
|
||||
@@ -7401,13 +7597,6 @@ void WebContentsImpl::ReadyToCommitNavigation(
|
||||
"navigation_handle", navigation_handle);
|
||||
CHECK(!navigation_handle->IsSameDocument());
|
||||
|
||||
// Cross-document navigation of the top-level frame resets the capture
|
||||
// handle config. Using IsInPrimaryMainFrame is valid here since the browser
|
||||
// caches this state for the active main frame only.
|
||||
if (navigation_handle->IsInPrimaryMainFrame()) {
|
||||
SetCaptureHandleConfig(blink::mojom::CaptureHandleConfig::New());
|
||||
}
|
||||
|
||||
// Notify the OS that the workload is about to increase for main frame
|
||||
// navigations only. This a trade off between latency and power - we don't
|
||||
// want to do it for every navigation.
|
||||
@@ -7502,6 +7691,10 @@ void WebContentsImpl::DidFinishNavigation(NavigationHandle* navigation_handle) {
|
||||
was_ever_audible_ = false;
|
||||
}
|
||||
|
||||
if (navigation_handle->IsInPrimaryMainFrame()) {
|
||||
OnCaptureHandleConfigUpdate(GetPrimaryPage());
|
||||
}
|
||||
|
||||
if (!navigation_handle->IsSameDocument()) {
|
||||
last_screen_orientation_change_time_ = base::TimeTicks();
|
||||
}
|
||||
@@ -7709,6 +7902,14 @@ input::TouchEmulator* WebContentsImpl::GetTouchEmulator(
|
||||
return touch_emulator_.get();
|
||||
}
|
||||
|
||||
void WebContentsImpl::CancelAutoscroll(input::RenderWidgetHostViewInput* view) {
|
||||
auto* view_base = static_cast<RenderWidgetHostViewBase*>(view);
|
||||
auto* rwhi = RenderWidgetHostImpl::From(view_base->GetRenderWidgetHost());
|
||||
if (rwhi) {
|
||||
rwhi->AutoscrollEnd();
|
||||
}
|
||||
}
|
||||
|
||||
void WebContentsImpl::DidNavigateMainFramePreCommit(
|
||||
NavigationHandle* navigation_handle,
|
||||
bool navigation_is_within_page) {
|
||||
@@ -7784,7 +7985,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 +10579,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) {
|
||||
@@ -10659,19 +10856,6 @@ bool WebContentsImpl::CreateRenderViewForRenderManager(
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set the TextAutosizer state from the main frame's renderer on the new view,
|
||||
// but only if it's not for the main frame. Main frame renderers should create
|
||||
// this state themselves from up-to-date values, so we shouldn't override it
|
||||
// with the cached values.
|
||||
if (!rvh_impl->GetMainRenderFrameHost() && proxy_host) {
|
||||
proxy_host->GetAssociatedRemoteMainFrame()->UpdateTextAutosizerPageInfo(
|
||||
proxy_host->frame_tree_node()
|
||||
->current_frame_host()
|
||||
->GetPage()
|
||||
.text_autosizer_page_info()
|
||||
.Clone());
|
||||
}
|
||||
|
||||
// If `render_view_host` is for an inner WebContents, ensure that its
|
||||
// RenderWidgetHostView is properly reattached to the outer WebContents. Note
|
||||
// that this should only be done when `render_view_host` is already the
|
||||
@@ -11983,17 +12167,7 @@ void WebContentsImpl::NotifyPageBecamePrimary(PageImpl& page) {
|
||||
observers_.NotifyObservers(&WebContentsObserver::PrimaryPageChanged, page);
|
||||
}
|
||||
|
||||
bool WebContentsImpl::IsPageInPreviewMode() const {
|
||||
return IsInPreviewMode();
|
||||
}
|
||||
|
||||
void WebContentsImpl::CancelPreviewByMojoBinderPolicy(
|
||||
const std::string& interface_name) {
|
||||
if (delegate_) {
|
||||
delegate_->CancelPreview(
|
||||
PreviewCancelReason::BlockedByMojoBinderPolicy(interface_name));
|
||||
}
|
||||
}
|
||||
|
||||
FrameTreeNodeId WebContentsImpl::GetOuterDelegateFrameTreeNodeId() {
|
||||
return node_.outer_contents_frame_tree_node_id();
|
||||
@@ -12123,39 +12297,13 @@ 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);
|
||||
}
|
||||
|
||||
bool WebContentsImpl::IsInPreviewMode() const {
|
||||
return is_in_preview_mode_;
|
||||
}
|
||||
|
||||
void WebContentsImpl::WillActivatePreviewPage() {
|
||||
CHECK(is_in_preview_mode_);
|
||||
is_in_preview_mode_ = false;
|
||||
}
|
||||
|
||||
void WebContentsImpl::ActivatePreviewPage() {
|
||||
TRACE_EVENT0("content", "WebContentsImpl::ActivatePreviewPage");
|
||||
|
||||
// WillActivatePreviewPage() should be called to reset it beforehand.
|
||||
CHECK(!is_in_preview_mode_);
|
||||
|
||||
PageImpl& preview_page = GetPrimaryPage();
|
||||
preview_page.SetActivationStartTime(base::TimeTicks::Now());
|
||||
|
||||
// TODO(b:299240273): Gather all relevant RVHs.
|
||||
StoredPage::RenderViewHostImplSafeRefSet render_view_hosts;
|
||||
render_view_hosts.insert(GetRenderViewHost()->GetSafeRef());
|
||||
|
||||
preview_page.Activate(
|
||||
PageImpl::ActivationType::kPreview, render_view_hosts, std::nullopt,
|
||||
base::BindOnce(&WebContentsImpl::DidActivatePreviewedPage,
|
||||
weak_factory_.GetWeakPtr()));
|
||||
bool destination_is_loaded,
|
||||
bool had_saved_frame_at_start) {
|
||||
GetVisibleTimeRequestTrigger().UpdateRequest(blink::VisibleTimeEvent{
|
||||
.event_start_time = start_time,
|
||||
.reason = blink::VisibleTimeEvent::TabSwitchReason{
|
||||
.destination_is_loaded = destination_is_loaded,
|
||||
.had_saved_frame_at_start = had_saved_frame_at_start}});
|
||||
}
|
||||
|
||||
VisibleTimeRequestTrigger& WebContentsImpl::GetVisibleTimeRequestTrigger() {
|
||||
@@ -12172,9 +12320,8 @@ gfx::mojom::DelegatedInkPointRenderer* WebContentsImpl::GetDelegatedInkRenderer(
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
TRACE_EVENT_INSTANT0("delegated_ink_trails",
|
||||
"Binding mojo interface for delegated ink points.",
|
||||
TRACE_EVENT_SCOPE_THREAD);
|
||||
TRACE_EVENT_INSTANT("delegated_ink_trails",
|
||||
"Binding mojo interface for delegated ink points.");
|
||||
compositor->SetDelegatedInkPointRenderer(
|
||||
delegated_ink_point_renderer_.BindNewPipeAndPassReceiver());
|
||||
delegated_ink_point_renderer_.reset_on_disconnect();
|
||||
|
||||
@@ -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,
|
||||
@@ -254,7 +259,7 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
|
||||
{wf::EnableWebAuthenticationAmbient,
|
||||
raw_ref(device::kWebAuthnAmbientSignin)},
|
||||
{wf::EnableWebAuthenticationImmediateGet,
|
||||
raw_ref(device::kWebAuthnImmediateGet), kSetOnlyIfOverridden},
|
||||
raw_ref(device::kWebAuthnImmediateGet), kDefault},
|
||||
{wf::EnableWebBluetooth, raw_ref(features::kWebBluetooth),
|
||||
kSetOnlyIfOverridden},
|
||||
{wf::EnableWebBluetoothGetDevices,
|
||||
@@ -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(
|
||||
@@ -350,7 +353,10 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
|
||||
kSetOnlyIfOverridden},
|
||||
{"FledgeBiddingAndAuctionServerAPI",
|
||||
raw_ref(blink::features::kFledgeBiddingAndAuctionServer), kDefault},
|
||||
{"FontSrcLocalMatching", raw_ref(features::kFontSrcLocalMatching)},
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
{"FontDataService",
|
||||
raw_ref(features::kFontDataServiceAllWebContents)},
|
||||
#endif
|
||||
{"HstsTopLevelNavigationsOnly",
|
||||
raw_ref(net::features::kHstsTopLevelNavigationsOnly)},
|
||||
{"MachineLearningNeuralNetwork",
|
||||
@@ -362,6 +368,7 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
|
||||
{"RelatedWebsitePartitionAPI",
|
||||
raw_ref(net::features::kRelatedWebsitePartitionAPI)},
|
||||
{"SerialPortConnected", raw_ref(features::kSerialPortConnected)},
|
||||
{"SplitViewLinkOpen", raw_ref(features::kSplitViewLinkOpen)},
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
{"SystemDefaultAccentColors",
|
||||
raw_ref(features::kUseSystemDefaultAccentColors)},
|
||||
@@ -621,6 +628,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(
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#include "components/language_detection/content/common/language_detection.mojom.h"
|
||||
#include "components/language_detection/core/browser/language_detection_model_provider.h"
|
||||
#include "content/browser/ai/echo_ai_manager_impl.h"
|
||||
#include "content/browser/cpu_performance/cpu_performance.h"
|
||||
#include "content/browser/renderer_host/render_frame_host_impl.h"
|
||||
#include "content/browser/webauth/default_authenticator_request_client_delegate.h"
|
||||
#include "content/public/browser/anchor_element_preconnect_delegate.h"
|
||||
@@ -232,14 +231,14 @@ bool ContentBrowserClient::DoesWebUIUrlRequireProcessLock(const GURL& url) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ContentBrowserClient::ShouldTreatURLSchemeAsFirstPartyWhenTopLevel(
|
||||
std::string_view scheme,
|
||||
bool ContentBrowserClient::ShouldTreatAsFirstPartyWhenTopLevel(
|
||||
const url::Origin& top_frame_origin,
|
||||
bool is_embedded_origin_secure) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ContentBrowserClient::ShouldIgnoreSameSiteCookieRestrictionsWhenTopLevel(
|
||||
std::string_view scheme,
|
||||
const url::Origin& top_frame_origin,
|
||||
bool is_embedded_origin_secure) {
|
||||
return false;
|
||||
}
|
||||
@@ -424,12 +423,6 @@ bool ContentBrowserClient::IsTopChromeWebUIURL(const GURL& url) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ContentBrowserClient::IsIsolatedContextAllowedForUrl(
|
||||
BrowserContext* browser_context,
|
||||
const GURL& lock_url) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ContentBrowserClient::IsMultiCaptureAllowed(
|
||||
content::RenderFrameHost* render_frame_host) {
|
||||
return false;
|
||||
@@ -499,11 +492,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 +535,17 @@ bool ContentBrowserClient::AllowSharedWorkerBlobURLFix(
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ContentBrowserClient::IsDataUrlInWebWorkerOpaqueOriginEnabled(
|
||||
BrowserContext* context) {
|
||||
return base::FeatureList::IsEnabled(
|
||||
blink::features::kDataUrlWorkerOpaqueOrigin);
|
||||
}
|
||||
|
||||
bool ContentBrowserClient::AllowSharedWorkerExtendedLifetime(
|
||||
BrowserContext* context) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ContentBrowserClient::OverrideWebPreferencesAfterNavigation(
|
||||
WebContents* web_contents,
|
||||
SiteInstance& main_frame_site,
|
||||
@@ -565,6 +564,11 @@ bool ContentBrowserClient::IsDataSaverEnabled(BrowserContext* context) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ContentBrowserClient::IsPinchToZoomAllowed(BrowserContext* context) {
|
||||
DCHECK(context);
|
||||
return true;
|
||||
}
|
||||
|
||||
void ContentBrowserClient::UpdateRendererPreferencesForWorker(
|
||||
BrowserContext* browser_context,
|
||||
blink::RendererPreferences* out_prefs) {
|
||||
@@ -613,19 +617,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 +697,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,
|
||||
@@ -735,7 +718,7 @@ bool ContentBrowserClient::IsFullCookieAccessAllowed(
|
||||
const GURL& url,
|
||||
const blink::StorageKey& storage_key,
|
||||
net::CookieSettingOverrides overrides) {
|
||||
return true;
|
||||
return !storage_key.ForbidsUnpartitionedStorageAccess();
|
||||
}
|
||||
|
||||
bool ContentBrowserClient::IsPrefetchWithServiceWorkerAllowed(
|
||||
@@ -749,13 +732,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 +842,11 @@ FeatureObserverClient* ContentBrowserClient::GetFeatureObserverClient() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool ContentBrowserClient::IsPopupBypassAllowed(
|
||||
RenderFrameHost* render_frame_host) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ContentBrowserClient::CanCreateWindow(
|
||||
RenderFrameHost* opener,
|
||||
const GURL& opener_url,
|
||||
@@ -897,7 +878,8 @@ ContentBrowserClient::CreateModelBrokerClient(BrowserContext* browser_context) {
|
||||
media::mojom::AvailabilityStatus
|
||||
ContentBrowserClient::GetOnDeviceSpeechRecognitionAvailabilityStatus(
|
||||
BrowserContext* context,
|
||||
const std::string& language) {
|
||||
const std::string& language,
|
||||
media::mojom::SpeechRecognitionQuality quality) {
|
||||
return media::mojom::AvailabilityStatus::kUnavailable;
|
||||
}
|
||||
|
||||
@@ -1124,6 +1106,8 @@ ContentBrowserClient::CreateNonNetworkNavigationURLLoaderFactory(
|
||||
void ContentBrowserClient::
|
||||
RegisterNonNetworkWorkerMainResourceURLLoaderFactories(
|
||||
BrowserContext* browser_context,
|
||||
const std::optional<url::Origin>& request_initiator,
|
||||
network::mojom::RequestDestination request_destination,
|
||||
NonNetworkURLLoaderFactoryMap* factories) {}
|
||||
|
||||
void ContentBrowserClient::
|
||||
@@ -1466,13 +1450,14 @@ bool ContentBrowserClient::IsBuiltinComponent(BrowserContext* browser_context,
|
||||
void ContentBrowserClient::StartRtcDiagnosticLogging(
|
||||
RenderFrameHost& frame_host,
|
||||
bool should_upload_on_stop,
|
||||
base::flat_map<std::string, std::string> metadata,
|
||||
const base::flat_map<std::string, std::string>& metadata,
|
||||
base::OnceCallback<void(const std::string&)> callback) {
|
||||
std::move(callback).Run(base::Uuid::GenerateRandomV4().AsLowercaseString());
|
||||
}
|
||||
|
||||
void ContentBrowserClient::FinishRtcDiagnosticLogging(
|
||||
RenderFrameHost& frame_host,
|
||||
const base::flat_map<std::string, std::string>& metadata,
|
||||
base::OnceClosure callback) {
|
||||
std::move(callback).Run();
|
||||
}
|
||||
@@ -1538,18 +1523,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,
|
||||
@@ -2032,8 +2005,9 @@ bool ContentBrowserClient::ShouldAnimateBackForwardTransitions() {
|
||||
#endif
|
||||
}
|
||||
|
||||
blink::mojom::PerformanceTier ContentBrowserClient::GetCpuPerformanceTier() {
|
||||
return content::cpu_performance::GetTier();
|
||||
std::optional<int> ContentBrowserClient::GetCpuPerformanceTierOverride(
|
||||
BrowserContext* browser_context) {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
void ContentBrowserClient::RecordAssistedLogin(AssistedLoginType login_type) {}
|
||||
@@ -2067,4 +2041,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
+1
-1
@@ -59,7 +59,7 @@ namespace scripting {
|
||||
|
||||
// We used to call the injected function `function`, but this is
|
||||
// incompatible with JavaScript's object declaration shorthand (see
|
||||
// https://crbug.com/1166438). We leave this silently in for backwards
|
||||
// https://crbug.com/40742098). We leave this silently in for backwards
|
||||
// compatibility.
|
||||
// TODO(devlin): Remove this in M95.
|
||||
[nodoc, serializableFunction]InjectedFunction? function;
|
||||
@@ -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"
|
||||
@@ -230,7 +229,7 @@ class V8FeatureVisitor : public base::FeatureVisitor {
|
||||
public:
|
||||
void Visit(const std::string& feature_name,
|
||||
base::FeatureList::OverrideState override_state,
|
||||
const std::map<std::string, std::string>& params,
|
||||
const base::FieldTrialParams& params,
|
||||
const std::string& trial_name,
|
||||
const std::string& group_name) override {
|
||||
std::string_view feature_name_view(feature_name);
|
||||
@@ -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",
|
||||
|
||||
@@ -60,6 +60,7 @@
|
||||
#include "components/url_matcher/url_matcher.h"
|
||||
#include "components/url_matcher/url_util.h"
|
||||
#include "components/url_pattern/simple_url_pattern_matcher.h"
|
||||
#include "components/variations/net/variations_http_headers.h"
|
||||
#include "mojo/public/cpp/bindings/pending_receiver.h"
|
||||
#include "net/base/features.h"
|
||||
#include "net/base/isolation_info.h"
|
||||
@@ -80,6 +81,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 +137,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 +184,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)
|
||||
|
||||
@@ -627,6 +631,14 @@ void RecordHSTSPreconnectUpgradeReason(HSTSRedirectUpgradeReason reason) {
|
||||
}
|
||||
}
|
||||
|
||||
bool IsIncognitoFromParams(const mojom::NetworkContextParams& params) {
|
||||
// Checking both to see if there are any file paths at all, and if there is
|
||||
// specifically an http_cache_directory filepath in order to avoid a
|
||||
// potential nullptr dereference if we just checked that
|
||||
// `params_->file_paths->http_cache_directory' existed.
|
||||
return !params.file_paths || !params.file_paths->http_cache_directory;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
constexpr uint32_t NetworkContext::kMaxOutstandingRequestsPerProcess;
|
||||
@@ -648,6 +660,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 +699,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),
|
||||
@@ -693,7 +713,17 @@ NetworkContext::NetworkContext(
|
||||
cors_non_wildcard_request_headers_support_(base::FeatureList::IsEnabled(
|
||||
features::kCorsNonWildcardRequestHeadersSupport)),
|
||||
prefetch_cache_(prefetch_enabled_ ? std::make_unique<PrefetchCache>()
|
||||
: nullptr) {
|
||||
: nullptr),
|
||||
variations_headers_(std::move(params_->initial_variations_headers)) {
|
||||
|
||||
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)
|
||||
@@ -765,8 +795,7 @@ NetworkContext::NetworkContext(
|
||||
cookie_manager_ = std::make_unique<CookieManager>(
|
||||
url_request_context_, &first_party_sets_access_delegate_,
|
||||
std::move(session_cleanup_cookie_store),
|
||||
std::move(params_->cookie_manager_params),
|
||||
network_service_->tpcd_metadata_manager());
|
||||
std::move(params_->cookie_manager_params));
|
||||
|
||||
cookie_manager_->AddSettingsWillChangeCallback(
|
||||
base::BindRepeating(&NetworkContext::OnCookieManagerSettingsChanged,
|
||||
@@ -781,8 +810,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 +861,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 +888,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,
|
||||
@@ -862,8 +897,7 @@ NetworkContext::NetworkContext(
|
||||
url_request_context,
|
||||
nullptr,
|
||||
/*first_party_sets_access_delegate=*/nullptr,
|
||||
/*params=*/nullptr,
|
||||
/*tpcd_metadata_manager=*/nullptr)),
|
||||
/*params=*/nullptr)),
|
||||
socket_factory_(
|
||||
std::make_unique<SocketFactory>(url_request_context_->net_log(),
|
||||
url_request_context)),
|
||||
@@ -877,6 +911,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 +938,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 +1287,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);
|
||||
@@ -1618,13 +1678,6 @@ void NetworkContext::QueueReportInternal(
|
||||
return;
|
||||
}
|
||||
|
||||
// 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)) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::string reported_user_agent = "";
|
||||
if (request_context->http_user_agent_settings() != nullptr) {
|
||||
reported_user_agent =
|
||||
@@ -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) {
|
||||
@@ -1651,13 +1720,6 @@ void NetworkContext::QueueSignedExchangeReport(
|
||||
return;
|
||||
}
|
||||
|
||||
// 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)) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::string user_agent;
|
||||
if (url_request_context_->http_user_agent_settings() != nullptr) {
|
||||
user_agent =
|
||||
@@ -1741,6 +1803,16 @@ void NetworkContext::OnReportingObserverDisconnect(
|
||||
is_observing_reporting_service_ = false;
|
||||
}
|
||||
}
|
||||
|
||||
void NetworkContext::AddVariationsHeadersToReportingRequest(
|
||||
net::URLRequest* request) {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
variations::AppendVariationsHeaderWithCustomValue(
|
||||
request->url(),
|
||||
IsIncognitoFromParams(*params_) ? variations::InIncognito::kYes
|
||||
: variations::InIncognito::kNo,
|
||||
variations_headers_.get(), request);
|
||||
}
|
||||
#endif // BUILDFLAG(ENABLE_REPORTING)
|
||||
|
||||
void NetworkContext::ClearDomainReliability(
|
||||
@@ -1788,6 +1860,7 @@ void NetworkContext::CloseIdleConnections(
|
||||
|
||||
void NetworkContext::SetNetworkConditions(
|
||||
const base::UnguessableToken& throttling_profile_id,
|
||||
const base::UnguessableToken& throttling_client_id,
|
||||
std::vector<mojom::MatchedNetworkConditionsPtr> conditions) {
|
||||
std::vector<MatchedNetworkConditions> network_conditions;
|
||||
for (auto& condition : conditions) {
|
||||
@@ -1803,6 +1876,7 @@ void NetworkContext::SetNetworkConditions(
|
||||
condition->conditions->rule_id});
|
||||
}
|
||||
ThrottlingController::SetConditions(throttling_profile_id,
|
||||
throttling_client_id,
|
||||
std::move(network_conditions));
|
||||
}
|
||||
|
||||
@@ -1876,12 +1950,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 +2055,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 +2070,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)
|
||||
}
|
||||
|
||||
@@ -2004,22 +2081,15 @@ void NetworkContext::CreateWebTransport(
|
||||
const net::NetworkAnonymizationKey& key,
|
||||
std::vector<mojom::WebTransportCertificateFingerprintPtr> fingerprints,
|
||||
const std::vector<std::string>& application_protocols,
|
||||
mojom::WebTransportCongestionControl congestion_control,
|
||||
mojo::PendingRemote<mojom::WebTransportHandshakeClient>
|
||||
pending_handshake_client,
|
||||
mojo::PendingRemote<mojom::URLLoaderNetworkServiceObserver>
|
||||
url_loader_network_observer,
|
||||
mojom::ClientSecurityStatePtr client_security_state) {
|
||||
if (!IsNetworkForNonceAndUrlAllowed(
|
||||
key.GetNonce().value_or(base::UnguessableToken::Null()), url)) {
|
||||
mojo::Remote<mojom::WebTransportHandshakeClient> remote_handshake_client(
|
||||
std::move(pending_handshake_client));
|
||||
remote_handshake_client->OnHandshakeFailed(
|
||||
net::WebTransportError(net::ERR_NETWORK_ACCESS_REVOKED));
|
||||
return;
|
||||
}
|
||||
web_transports_.insert(std::make_unique<WebTransport>(
|
||||
url, origin, key, fingerprints, application_protocols, this,
|
||||
std::move(pending_handshake_client),
|
||||
url, origin, key, fingerprints, application_protocols, congestion_control,
|
||||
this, std::move(pending_handshake_client),
|
||||
std::move(url_loader_network_observer),
|
||||
std::move(client_security_state)));
|
||||
}
|
||||
@@ -2045,17 +2115,13 @@ void NetworkContext::ResolveHost(
|
||||
host->get_host_port_pair().port())
|
||||
.GetURL()
|
||||
: host->get_scheme_host_port().GetURL();
|
||||
bool is_network_disallowed_for_nonce =
|
||||
network_anonymization_key.GetNonce().has_value() &&
|
||||
!IsNetworkForNonceAndUrlAllowed(
|
||||
network_anonymization_key.GetNonce().value(), url);
|
||||
bool is_network_disallowed_for_restrictions_id =
|
||||
(optional_parameters &&
|
||||
optional_parameters->network_restrictions_id.has_value() &&
|
||||
!IsHostResolutionForNonceAndHostAllowed(
|
||||
optional_parameters->network_restrictions_id.value(), *host));
|
||||
if (is_network_disallowed_for_nonce ||
|
||||
is_network_disallowed_for_restrictions_id) {
|
||||
optional_parameters->network_restrictions_id.value(), *host,
|
||||
network_anonymization_key));
|
||||
if (is_network_disallowed_for_restrictions_id) {
|
||||
mojo::Remote<mojom::ResolveHostClient> remote_response_client(
|
||||
std::move(response_client));
|
||||
remote_response_client->OnComplete(
|
||||
@@ -2116,7 +2182,7 @@ void NetworkContext::CreateHostResolver(
|
||||
void NetworkContext::VerifyCertInternal(
|
||||
const scoped_refptr<net::X509Certificate>& certificate,
|
||||
const net::HostPortPair& host_port,
|
||||
const std::string& ocsp_result,
|
||||
const std::string& ocsp_response,
|
||||
const std::string& sct_list,
|
||||
CTVerificationMode ct_verification_mode,
|
||||
VerifyCertCallback callback) {
|
||||
@@ -2140,7 +2206,7 @@ void NetworkContext::VerifyCertInternal(
|
||||
}
|
||||
int result = cert_verifier->Verify(
|
||||
net::CertVerifier::RequestParams(certificate, host_port.host(), flags,
|
||||
ocsp_result, sct_list),
|
||||
ocsp_response, sct_list),
|
||||
pending_cert_verify->result.get(),
|
||||
base::BindOnce(&NetworkContext::OnVerifyCertComplete,
|
||||
base::Unretained(this), cert_verify_id),
|
||||
@@ -2157,20 +2223,20 @@ void NetworkContext::VerifyCertInternal(
|
||||
void NetworkContext::VerifyCert(
|
||||
const scoped_refptr<net::X509Certificate>& certificate,
|
||||
const net::HostPortPair& host_port,
|
||||
const std::string& ocsp_result,
|
||||
const std::string& ocsp_response,
|
||||
const std::string& sct_list,
|
||||
VerifyCertCallback callback) {
|
||||
VerifyCertInternal(certificate, host_port, ocsp_result, sct_list,
|
||||
VerifyCertInternal(certificate, host_port, ocsp_response, sct_list,
|
||||
CTVerificationMode::kTlsCertificate, std::move(callback));
|
||||
}
|
||||
|
||||
void NetworkContext::VerifyCertForSignedExchange(
|
||||
const scoped_refptr<net::X509Certificate>& certificate,
|
||||
const net::HostPortPair& host_port,
|
||||
const std::string& ocsp_result,
|
||||
const std::string& ocsp_response,
|
||||
const std::string& sct_list,
|
||||
VerifyCertCallback callback) {
|
||||
VerifyCertInternal(certificate, host_port, ocsp_result, sct_list,
|
||||
VerifyCertInternal(certificate, host_port, ocsp_response, sct_list,
|
||||
CTVerificationMode::kSignedExchange, std::move(callback));
|
||||
}
|
||||
|
||||
@@ -2392,14 +2458,11 @@ void NetworkContext::PreconnectSockets(
|
||||
return;
|
||||
}
|
||||
|
||||
// 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)) {
|
||||
return;
|
||||
}
|
||||
// Preconnect is disallowed if network access is disabled for the
|
||||
// network_restrictions_id.
|
||||
if (network_restrictions_id.has_value() &&
|
||||
!IsNetworkForNonceAndUrlAllowed(*network_restrictions_id, url)) {
|
||||
!IsNetworkForNonceAndUrlAllowed(*network_restrictions_id, url,
|
||||
network_anonymization_key)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2820,11 +2883,7 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
|
||||
} else {
|
||||
net::URLRequestContextBuilder::HttpCacheParams cache_params;
|
||||
cache_params.max_size = params_->http_cache_max_size;
|
||||
// Checking both to see if there are any file paths at all, and if there is
|
||||
// specifically an http_cache_directory filepath in order to avoid a
|
||||
// potential nullptr dereference if we just checked that
|
||||
// `params_->file_paths->http_cache_directory' existed.
|
||||
if (!params_->file_paths || !params_->file_paths->http_cache_directory) {
|
||||
if (IsIncognitoFromParams(*params_)) {
|
||||
cache_params.type =
|
||||
net::URLRequestContextBuilder::HttpCacheParams::IN_MEMORY;
|
||||
} else {
|
||||
@@ -3035,6 +3094,17 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
|
||||
builder.set_enable_shared_zstd(true);
|
||||
}
|
||||
|
||||
#if BUILDFLAG(ENABLE_REPORTING)
|
||||
if (base::FeatureList::IsEnabled(
|
||||
features::kReportingApiEnableVariationsHeaders)) {
|
||||
builder.set_prepare_upload_request_callback(base::BindRepeating(
|
||||
&NetworkContext::AddVariationsHeadersToReportingRequest,
|
||||
// `this` outlives the URLRequestContext that owns the ReportingService,
|
||||
// which owns the ReportingUploader that calls this callback.
|
||||
base::Unretained(this)));
|
||||
}
|
||||
#endif
|
||||
|
||||
builder.SetWrapHttpNetworkLayerCallback(
|
||||
base::BindOnce([](std::unique_ptr<net::HttpNetworkLayer> network_layer)
|
||||
-> std::unique_ptr<net::HttpTransactionFactory> {
|
||||
@@ -3193,12 +3263,12 @@ NetworkContext::MakeSessionCleanupCookieStore() const {
|
||||
crypto_delegate = std::make_unique<CookieOSCryptAsyncDelegate>(
|
||||
std::move(params_->cookie_encryption_provider));
|
||||
} else {
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
// A cookie crypto delegate should not be created on Android to
|
||||
// match the behavior of cookie_config::GetCookieCryptoDelegate().
|
||||
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
|
||||
// A cookie crypto delegate should not be created on Android or iOS
|
||||
// to match the behavior of cookie_config::GetCookieCryptoDelegate().
|
||||
// See https://crbug.com/449652881
|
||||
NOTREACHED();
|
||||
#endif
|
||||
#endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3524,41 +3594,52 @@ 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;
|
||||
|
||||
// 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_) {
|
||||
factory->CancelRequestsIfNonceMatchesAndUrlNotExempted(nonce, exemptions);
|
||||
}
|
||||
#if BUILDFLAG(ENABLE_WEBSOCKETS)
|
||||
if (websocket_factory_) {
|
||||
websocket_factory_->RemoveIfNonceMatches(nonce);
|
||||
}
|
||||
#endif // BUILDFLAG(ENABLE_WEBSOCKETS)
|
||||
for (const auto& transport : web_transports_) {
|
||||
transport->CloseIfNonceMatches(nonce);
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
if (callback) {
|
||||
@@ -3570,23 +3651,9 @@ void NetworkContext::ClearNonces(
|
||||
const std::vector<base::UnguessableToken>& nonces) {
|
||||
for (const auto& nonce : nonces) {
|
||||
network_revocation_nonces_.erase(nonce);
|
||||
network_revocation_exemptions_.erase(nonce);
|
||||
}
|
||||
}
|
||||
|
||||
void NetworkContext::ExemptUrlFromNetworkRevocationForNonce(
|
||||
const GURL& exempted_url,
|
||||
const base::UnguessableToken& nonce,
|
||||
ExemptUrlFromNetworkRevocationForNonceCallback callback) {
|
||||
GURL url_without_filename = exempted_url.GetWithoutFilename();
|
||||
|
||||
if (url_without_filename.is_valid()) {
|
||||
network_revocation_exemptions_[nonce].insert(url_without_filename);
|
||||
}
|
||||
|
||||
std::move(callback).Run();
|
||||
}
|
||||
|
||||
void NetworkContext::Prefetch(
|
||||
int32_t request_id,
|
||||
uint32_t options,
|
||||
@@ -3653,44 +3720,74 @@ void NetworkContext::AddQuicHints(
|
||||
bool NetworkContext::IsNetworkForNonceAndUrlAllowed(
|
||||
const base::UnguessableToken& nonce,
|
||||
const GURL& url,
|
||||
bool is_redirect) const {
|
||||
// If network hasn't been revoked for the nonce, it's allowed.
|
||||
if (!network_revocation_nonces_.contains(nonce)) {
|
||||
const net::NetworkAnonymizationKey& network_anonymization_key,
|
||||
bool is_redirect) {
|
||||
// If network hasn't been revoked for the nonce, it's allowed. Likewise, local
|
||||
// schemes that reach this point should be excluded as they don't generate
|
||||
// network requests.
|
||||
auto it = network_revocation_nonces_.find(nonce);
|
||||
if (it == network_revocation_nonces_.end() || url.SchemeIsLocal()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const NetworkRestriction& restriction = it->second;
|
||||
|
||||
// For connection allowlist feature, network_revocation_nonces_ map contains
|
||||
// the allowed URL Patterns.
|
||||
// Note that the network_revocation_exemptions_ check below 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).
|
||||
// are restricted.
|
||||
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.
|
||||
} /* kConnectionAllowlists */
|
||||
|
||||
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 +3810,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 +3860,19 @@ 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;
|
||||
}
|
||||
|
||||
void NetworkContext::SetVariationsHeaders(
|
||||
variations::mojom::VariationsHeadersPtr variations_headers) {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
variations_headers_ = std::move(variations_headers);
|
||||
}
|
||||
|
||||
} // namespace network
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user