Skip to content

Commit

Permalink
Merge pull request #21628 from brave/maxk-disable-reading-mode
Browse files Browse the repository at this point in the history
Hides `Open in Reading Mode` context menu item.
  • Loading branch information
mkarolin committed Jan 19, 2024
1 parent 532ef8e commit 2bd1244
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ source_set("browser_tests") {
"//extensions/common",
"//services/device/public/cpp:device_features",
"//testing/gtest",
"//ui/accessibility:ax_base",
]

if (is_linux || is_win || is_mac) {
Expand Down
1 change: 1 addition & 0 deletions app/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ include_rules = [
"+third_party/blink/public/common",
"+third_party/blink/public/mojom",
"+third_party/blink/public/public_buildflags.h",
"+ui/accessibility/accessibility_features.h",
"+ui/base",
]
4 changes: 4 additions & 0 deletions app/brave_main_delegate_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
#include "chrome/test/base/in_process_browser_test.h"
#include "components/translate/core/common/translate_util.h"
#include "extensions/common/extension_features.h"
#include "ui/accessibility/accessibility_features.h"
#endif

#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
Expand Down Expand Up @@ -212,6 +213,9 @@ IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest, DisabledFeatures) {
&features::kPrivacyGuidePreloadAndroid,
#endif
&features::kPrivacySandboxAdsAPIsOverride,
#if !BUILDFLAG(IS_ANDROID)
&features::kReadAnything,
#endif
&features::kResourceTimingForCancelledNavigationInFrame,
&features::kSCTAuditing,
&features::kServiceWorkerAutoPreload,
Expand Down
18 changes: 18 additions & 0 deletions chromium_src/ui/accessibility/accessibility_features.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* Copyright (c) 2024 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at https://mozilla.org/MPL/2.0/. */

#include "src/ui/accessibility/accessibility_features.cc"

#include "base/feature_override.h"

namespace features {

OVERRIDE_FEATURE_DEFAULT_STATES({{
#if !BUILDFLAG(IS_ANDROID)
{kReadAnything, base::FEATURE_DISABLED_BY_DEFAULT},
#endif
}});

} // namespace features

0 comments on commit 2bd1244

Please sign in to comment.