Skip to content

Commit

Permalink
Remove ENABLE_SPEEDREADER build flag
Browse files Browse the repository at this point in the history
  • Loading branch information
emerick committed Dec 10, 2024
1 parent 9d3cf80 commit 20a41f7
Show file tree
Hide file tree
Showing 50 changed files with 217 additions and 481 deletions.
6 changes: 1 addition & 5 deletions .storybook/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# you can obtain one at http://mozilla.org/MPL/2.0/.

import("//brave/components/brave_vpn/common/buildflags/buildflags.gni")
import("//brave/components/speedreader/common/buildflags/buildflags.gni")

group("storybook") {
# Depend on any generated JS output that will
Expand All @@ -21,11 +20,8 @@ group("storybook") {
"//brave/components/brave_shields/core/common:mojom_js",
"//brave/components/brave_vpn/common/mojom:mojom_js",
"//brave/components/brave_wallet/common:mojom_js",
"//brave/components/speedreader/common:mojom_js",
"//mojo/public/js:bindings",
"//mojo/public/js:resources",
]

if (enable_speedreader) {
deps += [ "//brave/components/speedreader/common:mojom_js" ]
}
}
2 changes: 0 additions & 2 deletions app/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import("//brave/browser/shell_integrations/buildflags/buildflags.gni")
import("//brave/components/brave_vpn/common/buildflags/buildflags.gni")
import("//brave/components/playlist/common/buildflags/buildflags.gni")
import("//brave/components/request_otr/common/buildflags/buildflags.gni")
import("//brave/components/speedreader/common/buildflags/buildflags.gni")
import("//brave/components/text_recognition/common/buildflags/buildflags.gni")
import("//brave/resources/brave_grit.gni")
import("//build/config/features.gni")
Expand Down Expand Up @@ -59,7 +58,6 @@ brave_grit("brave_generated_resources_grit") {
"enable_pin_shortcut=$enable_pin_shortcut",
"enable_playlist_webui=$enable_playlist_webui",
"enable_request_otr=$enable_request_otr",
"enable_speedreader=$enable_speedreader",
"enable_text_recognition=$enable_text_recognition",
]
source = "brave_generated_resources.grd"
Expand Down
1 change: 0 additions & 1 deletion app/brave_main_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "brave/components/brave_component_updater/browser/features.h"
#include "brave/components/brave_component_updater/browser/switches.h"
#include "brave/components/brave_sync/buildflags.h"
#include "brave/components/speedreader/common/buildflags/buildflags.h"
#include "brave/components/update_client/buildflags.h"
#include "brave/components/variations/command_line_utils.h"
#include "brave/renderer/brave_content_renderer_client.h"
Expand Down
14 changes: 4 additions & 10 deletions app/vector_icons/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import("//brave/components/brave_vpn/common/buildflags/buildflags.gni")
import("//brave/components/playlist/common/buildflags/buildflags.gni")
import("//brave/components/speedreader/common/buildflags/buildflags.gni")
import("//build/config/ui.gni")
import("//components/vector_icons/vector_icons.gni")

Expand All @@ -20,6 +19,10 @@ aggregate_vector_icons("brave_vector_icons") {
"brave_ads_dark_mode_info_button.icon",
"brave_ads_light_mode_info_button.icon",
"brave_sad.icon",
"brave_speedreader_graphic_book1.icon",
"brave_speedreader_graphic_book2.icon",
"brave_speedreader_graphic_book3.icon",
"brave_speedreader_graphic_lines.icon",
"brave_tooltips_stopwatch.icon",
"brave_translate.icon",
"download_unlock.icon",
Expand Down Expand Up @@ -47,15 +50,6 @@ aggregate_vector_icons("brave_vector_icons") {
"vpn_indicator_on.icon",
]
}

if (enable_speedreader) {
sources += [
"brave_speedreader_graphic_book1.icon",
"brave_speedreader_graphic_book2.icon",
"brave_speedreader_graphic_book3.icon",
"brave_speedreader_graphic_lines.icon",
]
}
}

source_set("vector_icons") {
Expand Down
1 change: 0 additions & 1 deletion browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ source_set("browser_process") {
"//brave/browser/ethereum_remote_client/buildflags",
"//brave/components/brave_vpn/common/buildflags",
"//brave/components/request_otr/common/buildflags",
"//brave/components/speedreader/common/buildflags",
"//brave/components/tor/buildflags",
"//chrome/browser:browser_process",
"//extensions/buildflags",
Expand Down
24 changes: 9 additions & 15 deletions browser/about_flags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "brave/components/psst/common/features.h"
#include "brave/components/request_otr/common/buildflags/buildflags.h"
#include "brave/components/skus/common/features.h"
#include "brave/components/speedreader/common/buildflags/buildflags.h"
#include "brave/components/speedreader/common/features.h"
#include "brave/components/webcompat/core/common/features.h"
#include "build/build_config.h"
#include "chrome/browser/ui/ui_features.h"
Expand All @@ -56,10 +56,6 @@
#include "brave/components/brave_vpn/common/features.h"
#endif

#if BUILDFLAG(ENABLE_SPEEDREADER)
#include "brave/components/speedreader/common/features.h"
#endif

#if BUILDFLAG(ENABLE_PLAYLIST)
#include "brave/components/playlist/common/features.h"
#endif
Expand All @@ -86,16 +82,14 @@

#define EXPAND_FEATURE_ENTRIES(...) __VA_ARGS__,

#define SPEEDREADER_FEATURE_ENTRIES \
IF_BUILDFLAG( \
ENABLE_SPEEDREADER, \
EXPAND_FEATURE_ENTRIES({ \
"brave-speedreader", \
"Enable SpeedReader", \
"Enables faster loading of simplified article-style web pages.", \
kOsDesktop | kOsAndroid, \
FEATURE_VALUE_TYPE(speedreader::kSpeedreaderFeature), \
}))
#define SPEEDREADER_FEATURE_ENTRIES \
EXPAND_FEATURE_ENTRIES({ \
"brave-speedreader", \
"Enable SpeedReader", \
"Enables faster loading of simplified article-style web pages.", \
kOsDesktop | kOsAndroid, \
FEATURE_VALUE_TYPE(speedreader::kSpeedreaderFeature), \
})

#define REQUEST_OTR_FEATURE_ENTRIES \
IF_BUILDFLAG( \
Expand Down
10 changes: 2 additions & 8 deletions browser/brave_browser_main_parts.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "brave/components/constants/brave_constants.h"
#include "brave/components/constants/pref_names.h"
#include "brave/components/ipfs/buildflags/buildflags.h"
#include "brave/components/speedreader/common/buildflags/buildflags.h"
#include "brave/components/speedreader/speedreader_extended_info_handler.h"
#include "brave/components/tor/buildflags/buildflags.h"
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
Expand All @@ -28,6 +28,7 @@
#include "chrome/common/chrome_paths.h"
#include "components/component_updater/component_updater_service.h"
#include "components/prefs/pref_service.h"
#include "components/sessions/content/content_serialized_navigation_driver.h"
#include "components/sync/base/command_line_switches.h"
#include "components/sync/service/sync_service.h"
#include "components/sync/service/sync_user_settings.h"
Expand All @@ -36,11 +37,6 @@
#include "extensions/buildflags/buildflags.h"
#include "media/base/media_switches.h"

#if BUILDFLAG(ENABLE_SPEEDREADER)
#include "brave/components/speedreader/speedreader_extended_info_handler.h"
#include "components/sessions/content/content_serialized_navigation_driver.h"
#endif

#if BUILDFLAG(ENABLE_TOR)
#include <string>
#include "base/files/file_util.h"
Expand Down Expand Up @@ -89,15 +85,13 @@ int ChromeBrowserMainParts::PreMainMessageLoopRun() {
}

void ChromeBrowserMainParts::PreBrowserStart() {
#if BUILDFLAG(ENABLE_SPEEDREADER)
// Register() must be called after the SerializedNavigationDriver is
// initialized, but before any calls to
// ContentSerializedNavigationBuilder::ToNavigationEntries()
//
// TODO(keur): Can we DCHECK the latter condition?
DCHECK(sessions::ContentSerializedNavigationDriver::GetInstance());
speedreader::SpeedreaderExtendedInfoHandler::Register();
#endif

ChromeBrowserMainParts_ChromiumImpl::PreBrowserStart();
}
Expand Down
3 changes: 0 additions & 3 deletions browser/brave_browser_process.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

#include "brave/components/brave_vpn/common/buildflags/buildflags.h"
#include "brave/components/request_otr/common/buildflags/buildflags.h"
#include "brave/components/speedreader/common/buildflags/buildflags.h"
#include "brave/components/tor/buildflags/buildflags.h"
#include "build/build_config.h"
#include "extensions/buildflags/buildflags.h"
Expand Down Expand Up @@ -116,10 +115,8 @@ class BraveBrowserProcess {
virtual brave_ads::BraveStatsHelper* ads_brave_stats_helper() = 0;
virtual ntp_background_images::NTPBackgroundImagesService*
ntp_background_images_service() = 0;
#if BUILDFLAG(ENABLE_SPEEDREADER)
virtual speedreader::SpeedreaderRewriterService*
speedreader_rewriter_service() = 0;
#endif
#if BUILDFLAG(ENABLE_BRAVE_VPN)
virtual brave_vpn::BraveVPNConnectionManager*
brave_vpn_connection_manager() = 0;
Expand Down
9 changes: 1 addition & 8 deletions browser/brave_browser_process_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include "brave/components/p3a/histograms_braveizer.h"
#include "brave/components/p3a/p3a_config.h"
#include "brave/components/p3a/p3a_service.h"
#include "brave/components/speedreader/speedreader_rewriter_service.h"
#include "brave/components/webcompat/content/browser/webcompat_exceptions_service.h"
#include "brave/components/webcompat/core/common/features.h"
#include "brave/services/network/public/cpp/system_request_handler.h"
Expand All @@ -67,10 +68,6 @@
#include "brave/components/tor/pref_names.h"
#endif

#if BUILDFLAG(ENABLE_SPEEDREADER)
#include "brave/components/speedreader/speedreader_rewriter_service.h"
#endif

#if BUILDFLAG(IS_ANDROID)
#include "chrome/browser/flags/android/chrome_feature_list.h"
#else
Expand Down Expand Up @@ -237,9 +234,7 @@ void BraveBrowserProcessImpl::StartBraveServices() {
#if BUILDFLAG(ENABLE_REQUEST_OTR)
request_otr_component_installer();
#endif
#if BUILDFLAG(ENABLE_SPEEDREADER)
speedreader_rewriter_service();
#endif
URLSanitizerComponentInstaller();
// Now start the local data files service, which calls all observers.
local_data_files_service()->Start();
Expand Down Expand Up @@ -466,7 +461,6 @@ BraveBrowserProcessImpl::notification_platform_bridge() {
return BrowserProcessImpl::notification_platform_bridge();
}

#if BUILDFLAG(ENABLE_SPEEDREADER)
speedreader::SpeedreaderRewriterService*
BraveBrowserProcessImpl::speedreader_rewriter_service() {
if (!speedreader_rewriter_service_) {
Expand All @@ -475,7 +469,6 @@ BraveBrowserProcessImpl::speedreader_rewriter_service() {
}
return speedreader_rewriter_service_.get();
}
#endif // BUILDFLAG(ENABLE_SPEEDREADER)

#if BUILDFLAG(ENABLE_BRAVE_VPN)
brave_vpn::BraveVPNConnectionManager*
Expand Down
5 changes: 0 additions & 5 deletions browser/brave_browser_process_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "brave/browser/brave_browser_process.h"
#include "brave/components/brave_component_updater/browser/brave_component.h"
#include "brave/components/brave_vpn/common/buildflags/buildflags.h"
#include "brave/components/speedreader/common/buildflags/buildflags.h"
#include "brave/components/tor/brave_tor_pluggable_transport_updater.h"
#include "brave/components/tor/buildflags/buildflags.h"
#include "brave/components/url_sanitizer/browser/url_sanitizer_component_installer.h"
Expand Down Expand Up @@ -127,10 +126,8 @@ class BraveBrowserProcessImpl : public BraveBrowserProcess,
ntp_background_images::NTPBackgroundImagesService*
ntp_background_images_service() override;
brave_ads::ResourceComponent* resource_component() override;
#if BUILDFLAG(ENABLE_SPEEDREADER)
speedreader::SpeedreaderRewriterService* speedreader_rewriter_service()
override;
#endif
#if BUILDFLAG(ENABLE_BRAVE_VPN)
brave_vpn::BraveVPNConnectionManager* brave_vpn_connection_manager() override;
#endif
Expand Down Expand Up @@ -194,10 +191,8 @@ class BraveBrowserProcessImpl : public BraveBrowserProcess,
ntp_background_images_service_;
std::unique_ptr<brave_ads::ResourceComponent> resource_component_;

#if BUILDFLAG(ENABLE_SPEEDREADER)
std::unique_ptr<speedreader::SpeedreaderRewriterService>
speedreader_rewriter_service_;
#endif

#if BUILDFLAG(ENABLE_BRAVE_VPN)
std::unique_ptr<brave_vpn::BraveVPNConnectionManager>
Expand Down
Loading

0 comments on commit 20a41f7

Please sign in to comment.