build: remove enable_picture_in_picture build flag (#38620)

Co-authored-by: Milan Burda <miburda@microsoft.com>
This commit is contained in:
Milan Burda 2023-06-08 08:56:31 +02:00 коммит произвёл GitHub
Родитель 933544d449
Коммит 0294debc31
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
10 изменённых файлов: 30 добавлений и 68 удалений

Просмотреть файл

@ -15,7 +15,6 @@ buildflag_header("buildflags") {
"ENABLE_PDF_VIEWER=$enable_pdf_viewer", "ENABLE_PDF_VIEWER=$enable_pdf_viewer",
"ENABLE_ELECTRON_EXTENSIONS=$enable_electron_extensions", "ENABLE_ELECTRON_EXTENSIONS=$enable_electron_extensions",
"ENABLE_BUILTIN_SPELLCHECKER=$enable_builtin_spellchecker", "ENABLE_BUILTIN_SPELLCHECKER=$enable_builtin_spellchecker",
"ENABLE_PICTURE_IN_PICTURE=$enable_picture_in_picture",
"OVERRIDE_LOCATION_PROVIDER=$enable_fake_location_provider", "OVERRIDE_LOCATION_PROVIDER=$enable_fake_location_provider",
] ]
} }

Просмотреть файл

@ -12,8 +12,6 @@ declare_args() {
enable_pdf_viewer = true enable_pdf_viewer = true
enable_picture_in_picture = true
# Provide a fake location provider for mocking # Provide a fake location provider for mocking
# the geolocation responses. Disable it if you # the geolocation responses. Disable it if you
# need to test with chromium's location provider. # need to test with chromium's location provider.

Просмотреть файл

@ -51,6 +51,8 @@ static_library("chrome") {
"//chrome/browser/net/proxy_config_monitor.h", "//chrome/browser/net/proxy_config_monitor.h",
"//chrome/browser/net/proxy_service_factory.cc", "//chrome/browser/net/proxy_service_factory.cc",
"//chrome/browser/net/proxy_service_factory.h", "//chrome/browser/net/proxy_service_factory.h",
"//chrome/browser/picture_in_picture/picture_in_picture_window_manager.cc",
"//chrome/browser/picture_in_picture/picture_in_picture_window_manager.h",
"//chrome/browser/platform_util.cc", "//chrome/browser/platform_util.cc",
"//chrome/browser/platform_util.h", "//chrome/browser/platform_util.h",
"//chrome/browser/predictors/preconnect_manager.cc", "//chrome/browser/predictors/preconnect_manager.cc",
@ -94,6 +96,28 @@ static_library("chrome") {
"//chrome/browser/ui/views/eye_dropper/eye_dropper.h", "//chrome/browser/ui/views/eye_dropper/eye_dropper.h",
"//chrome/browser/ui/views/eye_dropper/eye_dropper_view.cc", "//chrome/browser/ui/views/eye_dropper/eye_dropper_view.cc",
"//chrome/browser/ui/views/eye_dropper/eye_dropper_view.h", "//chrome/browser/ui/views/eye_dropper/eye_dropper_view.h",
"//chrome/browser/ui/views/overlay/back_to_tab_label_button.cc",
"//chrome/browser/ui/views/overlay/close_image_button.cc",
"//chrome/browser/ui/views/overlay/close_image_button.h",
"//chrome/browser/ui/views/overlay/constants.h",
"//chrome/browser/ui/views/overlay/hang_up_button.cc",
"//chrome/browser/ui/views/overlay/hang_up_button.h",
"//chrome/browser/ui/views/overlay/overlay_window_image_button.cc",
"//chrome/browser/ui/views/overlay/overlay_window_image_button.h",
"//chrome/browser/ui/views/overlay/playback_image_button.cc",
"//chrome/browser/ui/views/overlay/playback_image_button.h",
"//chrome/browser/ui/views/overlay/resize_handle_button.cc",
"//chrome/browser/ui/views/overlay/resize_handle_button.h",
"//chrome/browser/ui/views/overlay/simple_overlay_window_image_button.cc",
"//chrome/browser/ui/views/overlay/simple_overlay_window_image_button.h",
"//chrome/browser/ui/views/overlay/skip_ad_label_button.cc",
"//chrome/browser/ui/views/overlay/skip_ad_label_button.h",
"//chrome/browser/ui/views/overlay/toggle_camera_button.cc",
"//chrome/browser/ui/views/overlay/toggle_camera_button.h",
"//chrome/browser/ui/views/overlay/toggle_microphone_button.cc",
"//chrome/browser/ui/views/overlay/toggle_microphone_button.h",
"//chrome/browser/ui/views/overlay/video_overlay_window_views.cc",
"//chrome/browser/ui/views/overlay/video_overlay_window_views.h",
"//extensions/browser/app_window/size_constraints.cc", "//extensions/browser/app_window/size_constraints.cc",
"//extensions/browser/app_window/size_constraints.h", "//extensions/browser/app_window/size_constraints.h",
"//ui/views/native_window_tracker.h", "//ui/views/native_window_tracker.h",
@ -166,9 +190,12 @@ static_library("chrome") {
] ]
deps = [ deps = [
"//chrome/app/vector_icons",
"//chrome/browser:resource_prefetch_predictor_proto", "//chrome/browser:resource_prefetch_predictor_proto",
"//chrome/browser/resource_coordinator:mojo_bindings", "//chrome/browser/resource_coordinator:mojo_bindings",
"//components/vector_icons:vector_icons",
"//ui/snapshot", "//ui/snapshot",
"//ui/views/controls/webview",
] ]
if (is_linux) { if (is_linux) {
@ -271,41 +298,6 @@ static_library("chrome") {
} }
} }
if (enable_picture_in_picture) {
sources += [
"//chrome/browser/picture_in_picture/picture_in_picture_window_manager.cc",
"//chrome/browser/picture_in_picture/picture_in_picture_window_manager.h",
"//chrome/browser/ui/views/overlay/back_to_tab_label_button.cc",
"//chrome/browser/ui/views/overlay/close_image_button.cc",
"//chrome/browser/ui/views/overlay/close_image_button.h",
"//chrome/browser/ui/views/overlay/constants.h",
"//chrome/browser/ui/views/overlay/hang_up_button.cc",
"//chrome/browser/ui/views/overlay/hang_up_button.h",
"//chrome/browser/ui/views/overlay/overlay_window_image_button.cc",
"//chrome/browser/ui/views/overlay/overlay_window_image_button.h",
"//chrome/browser/ui/views/overlay/playback_image_button.cc",
"//chrome/browser/ui/views/overlay/playback_image_button.h",
"//chrome/browser/ui/views/overlay/resize_handle_button.cc",
"//chrome/browser/ui/views/overlay/resize_handle_button.h",
"//chrome/browser/ui/views/overlay/simple_overlay_window_image_button.cc",
"//chrome/browser/ui/views/overlay/simple_overlay_window_image_button.h",
"//chrome/browser/ui/views/overlay/skip_ad_label_button.cc",
"//chrome/browser/ui/views/overlay/skip_ad_label_button.h",
"//chrome/browser/ui/views/overlay/toggle_camera_button.cc",
"//chrome/browser/ui/views/overlay/toggle_camera_button.h",
"//chrome/browser/ui/views/overlay/toggle_microphone_button.cc",
"//chrome/browser/ui/views/overlay/toggle_microphone_button.h",
"//chrome/browser/ui/views/overlay/video_overlay_window_views.cc",
"//chrome/browser/ui/views/overlay/video_overlay_window_views.h",
]
deps += [
"//chrome/app/vector_icons",
"//components/vector_icons:vector_icons",
"//ui/views/controls/webview",
]
}
if (enable_electron_extensions) { if (enable_electron_extensions) {
sources += [ sources += [
"//chrome/browser/extensions/chrome_url_request_util.cc", "//chrome/browser/extensions/chrome_url_request_util.cc",

Просмотреть файл

@ -23,6 +23,7 @@
#include "base/threading/scoped_blocking_call.h" #include "base/threading/scoped_blocking_call.h"
#include "base/values.h" #include "base/values.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
#include "chrome/browser/picture_in_picture/picture_in_picture_window_manager.h"
#include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h" #include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h"
#include "chrome/browser/ui/views/eye_dropper/eye_dropper.h" #include "chrome/browser/ui/views/eye_dropper/eye_dropper.h"
#include "chrome/common/pref_names.h" #include "chrome/common/pref_names.h"
@ -184,10 +185,6 @@
#endif #endif
#endif // BUILDFLAG(ENABLE_PRINTING) #endif // BUILDFLAG(ENABLE_PRINTING)
#if BUILDFLAG(ENABLE_PICTURE_IN_PICTURE)
#include "chrome/browser/picture_in_picture/picture_in_picture_window_manager.h"
#endif
#if BUILDFLAG(ENABLE_PDF_VIEWER) #if BUILDFLAG(ENABLE_PDF_VIEWER)
#include "components/pdf/browser/pdf_web_contents_helper.h" // nogncheck #include "components/pdf/browser/pdf_web_contents_helper.h" // nogncheck
#include "shell/browser/electron_pdf_web_contents_helper_client.h" #include "shell/browser/electron_pdf_web_contents_helper_client.h"
@ -3896,18 +3893,12 @@ bool WebContents::TakeFocus(content::WebContents* source, bool reverse) {
content::PictureInPictureResult WebContents::EnterPictureInPicture( content::PictureInPictureResult WebContents::EnterPictureInPicture(
content::WebContents* web_contents) { content::WebContents* web_contents) {
#if BUILDFLAG(ENABLE_PICTURE_IN_PICTURE)
return PictureInPictureWindowManager::GetInstance() return PictureInPictureWindowManager::GetInstance()
->EnterVideoPictureInPicture(web_contents); ->EnterVideoPictureInPicture(web_contents);
#else
return content::PictureInPictureResult::kNotSupported;
#endif
} }
void WebContents::ExitPictureInPicture() { void WebContents::ExitPictureInPicture() {
#if BUILDFLAG(ENABLE_PICTURE_IN_PICTURE)
PictureInPictureWindowManager::GetInstance()->ExitPictureInPicture(); PictureInPictureWindowManager::GetInstance()->ExitPictureInPicture();
#endif
} }
void WebContents::DevToolsSaveToFile(const std::string& url, void WebContents::DevToolsSaveToFile(const std::string& url,

Просмотреть файл

@ -186,7 +186,7 @@
#include "components/crash/core/app/crashpad.h" // nogncheck #include "components/crash/core/app/crashpad.h" // nogncheck
#endif #endif
#if BUILDFLAG(ENABLE_PICTURE_IN_PICTURE) && BUILDFLAG(IS_WIN) #if BUILDFLAG(IS_WIN)
#include "chrome/browser/ui/views/overlay/video_overlay_window_views.h" #include "chrome/browser/ui/views/overlay/video_overlay_window_views.h"
#include "shell/browser/browser.h" #include "shell/browser/browser.h"
#include "ui/aura/window.h" #include "ui/aura/window.h"
@ -422,9 +422,6 @@ void ElectronBrowserClient::OverrideWebkitPrefs(
prefs->default_minimum_page_scale_factor = 1.f; prefs->default_minimum_page_scale_factor = 1.f;
prefs->default_maximum_page_scale_factor = 1.f; prefs->default_maximum_page_scale_factor = 1.f;
prefs->navigate_on_drag_drop = false; prefs->navigate_on_drag_drop = false;
#if !BUILDFLAG(ENABLE_PICTURE_IN_PICTURE)
prefs->picture_in_picture_enabled = false;
#endif
ui::NativeTheme* native_theme = ui::NativeTheme::GetInstanceForNativeUi(); ui::NativeTheme* native_theme = ui::NativeTheme::GetInstanceForNativeUi();
prefs->preferred_color_scheme = prefs->preferred_color_scheme =
@ -674,7 +671,6 @@ bool ElectronBrowserClient::CanCreateWindow(
return false; return false;
} }
#if BUILDFLAG(ENABLE_PICTURE_IN_PICTURE)
std::unique_ptr<content::VideoOverlayWindow> std::unique_ptr<content::VideoOverlayWindow>
ElectronBrowserClient::CreateWindowForVideoPictureInPicture( ElectronBrowserClient::CreateWindowForVideoPictureInPicture(
content::VideoPictureInPictureWindowController* controller) { content::VideoPictureInPictureWindowController* controller) {
@ -692,7 +688,6 @@ ElectronBrowserClient::CreateWindowForVideoPictureInPicture(
#endif #endif
return overlay_window; return overlay_window;
} }
#endif
void ElectronBrowserClient::GetAdditionalAllowedSchemesForFileSystem( void ElectronBrowserClient::GetAdditionalAllowedSchemesForFileSystem(
std::vector<std::string>* additional_schemes) { std::vector<std::string>* additional_schemes) {

Просмотреть файл

@ -160,11 +160,9 @@ class ElectronBrowserClient : public content::ContentBrowserClient,
bool user_gesture, bool user_gesture,
bool opener_suppressed, bool opener_suppressed,
bool* no_javascript_access) override; bool* no_javascript_access) override;
#if BUILDFLAG(ENABLE_PICTURE_IN_PICTURE)
std::unique_ptr<content::VideoOverlayWindow> std::unique_ptr<content::VideoOverlayWindow>
CreateWindowForVideoPictureInPicture( CreateWindowForVideoPictureInPicture(
content::VideoPictureInPictureWindowController* controller) override; content::VideoPictureInPictureWindowController* controller) override;
#endif
void GetAdditionalAllowedSchemesForFileSystem( void GetAdditionalAllowedSchemesForFileSystem(
std::vector<std::string>* additional_schemes) override; std::vector<std::string>* additional_schemes) override;
void GetAdditionalWebUISchemes( void GetAdditionalWebUISchemes(

Просмотреть файл

@ -36,10 +36,6 @@ void InitializeFeatureList() {
disable_features += disable_features +=
std::string(",") + features::kSpareRendererForSitePerProcess.name; std::string(",") + features::kSpareRendererForSitePerProcess.name;
#if !BUILDFLAG(ENABLE_PICTURE_IN_PICTURE)
disable_features += std::string(",") + media::kPictureInPicture.name;
#endif
#if BUILDFLAG(IS_WIN) #if BUILDFLAG(IS_WIN)
disable_features += disable_features +=
// Disable async spellchecker suggestions for Windows, which causes // Disable async spellchecker suggestions for Windows, which causes

Просмотреть файл

@ -42,10 +42,6 @@ bool IsExtensionsEnabled() {
return BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS); return BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS);
} }
bool IsPictureInPictureEnabled() {
return BUILDFLAG(ENABLE_PICTURE_IN_PICTURE);
}
bool IsComponentBuild() { bool IsComponentBuild() {
#if defined(COMPONENT_BUILD) #if defined(COMPONENT_BUILD)
return true; return true;
@ -67,7 +63,6 @@ void Initialize(v8::Local<v8::Object> exports,
&IsFakeLocationProviderEnabled); &IsFakeLocationProviderEnabled);
dict.SetMethod("isViewApiEnabled", &IsViewApiEnabled); dict.SetMethod("isViewApiEnabled", &IsViewApiEnabled);
dict.SetMethod("isPrintingEnabled", &IsPrintingEnabled); dict.SetMethod("isPrintingEnabled", &IsPrintingEnabled);
dict.SetMethod("isPictureInPictureEnabled", &IsPictureInPictureEnabled);
dict.SetMethod("isComponentBuild", &IsComponentBuild); dict.SetMethod("isComponentBuild", &IsComponentBuild);
dict.SetMethod("isExtensionsEnabled", &IsExtensionsEnabled); dict.SetMethod("isExtensionsEnabled", &IsExtensionsEnabled);
} }

Просмотреть файл

@ -2065,8 +2065,7 @@ describe('webContents module', () => {
await w.webContents.executeJavaScript('document.createElement(\'video\').canPlayType(\'video/webm; codecs="vp8.0"\')', true); await w.webContents.executeJavaScript('document.createElement(\'video\').canPlayType(\'video/webm; codecs="vp8.0"\')', true);
const result = await w.webContents.executeJavaScript( const result = await w.webContents.executeJavaScript('runTest(true)', true);
`runTest(${features.isPictureInPictureEnabled()})`, true);
expect(result).to.be.true(); expect(result).to.be.true();
}); });
}); });

1
typings/internal-ambient.d.ts поставляемый
Просмотреть файл

@ -11,7 +11,6 @@ declare namespace NodeJS {
isFakeLocationProviderEnabled(): boolean; isFakeLocationProviderEnabled(): boolean;
isViewApiEnabled(): boolean; isViewApiEnabled(): boolean;
isPrintingEnabled(): boolean; isPrintingEnabled(): boolean;
isPictureInPictureEnabled(): boolean;
isExtensionsEnabled(): boolean; isExtensionsEnabled(): boolean;
isComponentBuild(): boolean; isComponentBuild(): boolean;
} }