0

[Extensions] Remove NewWebstoreURL extension feature

This feature has been default for over a year now and was just
introduced to be able to roll out the change carefully.

Bug: 40073814, 396456407
Change-Id: I9143baf93c2cfd9d52772ec4d06de94180d56ae1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6334708
Reviewed-by: Justin Lulejian <jlulejian@chromium.org>
Commit-Queue: Tim <tjudkins@chromium.org>
Reviewed-by: Dana Fried <dfried@chromium.org>
Reviewed-by: David Bertoni <dbertoni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1431696}
This commit is contained in:
Tim Judkins
2025-03-12 12:35:00 -07:00
committed by Chromium LUCI CQ
parent 094f5e526c
commit 5ac44d0b41
6 changed files with 5 additions and 41 deletions

@ -61,7 +61,6 @@
#include "content/public/browser/web_contents.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/common/constants.h"
#include "extensions/common/extension_features.h"
#include "extensions/common/extension_urls.h"
#include "net/base/url_util.h"
#include "ui/base/l10n/l10n_util.h"
@ -584,12 +583,7 @@ void ShowSearchEngineSettings(Browser* browser) {
}
void ShowWebStore(Browser* browser, std::string_view utm_source_value) {
GURL webstore_url = extension_urls::GetWebstoreLaunchURL();
// TODO(crbug.com/40073814): Refactor this check into
// extension_urls::GetWebstoreLaunchURL() and fix tests relying on it.
if (base::FeatureList::IsEnabled(extensions_features::kNewWebstoreURL)) {
webstore_url = extension_urls::GetNewWebstoreLaunchURL();
}
GURL webstore_url = extension_urls::GetNewWebstoreLaunchURL();
ShowSingletonTabIgnorePathOverwriteNTP(
browser, extension_urls::AppendUtmSource(webstore_url, utm_source_value));
}

@ -48,7 +48,6 @@
#include "components/webapps/browser/banners/web_app_banner_data.h"
#include "components/webapps/browser/installable/installable_metrics.h"
#include "content/public/test/browser_test.h"
#include "extensions/common/extension_features.h"
#include "extensions/common/extension_urls.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkColor.h"
@ -203,19 +202,12 @@ IN_PROC_BROWSER_TEST_F(AppMenuModelInteractiveTest,
// TODO(crbug.com/40073814): Remove this test in favor of a unit test
// extension_urls::GetWebstoreLaunchURL().
class ExtensionsMenuVisitChromeWebstoreModelInteractiveTest
: public AppMenuModelInteractiveTest,
public testing::WithParamInterface<bool> {
: public AppMenuModelInteractiveTest {
public:
ExtensionsMenuVisitChromeWebstoreModelInteractiveTest() {
std::vector<base::test::FeatureRef> enabled_features = {
features::kExtensionsMenuInAppMenu};
std::vector<base::test::FeatureRef> disabled_features{};
if (GetParam()) {
enabled_features.push_back(extensions_features::kNewWebstoreURL);
} else {
LOG(ERROR) << "disabling new webstore URL";
disabled_features.push_back(extensions_features::kNewWebstoreURL);
}
scoped_feature_list_.InitWithFeatures(enabled_features, disabled_features);
}
@ -229,23 +221,12 @@ class ExtensionsMenuVisitChromeWebstoreModelInteractiveTest
base::HistogramTester histograms;
};
INSTANTIATE_TEST_SUITE_P(All,
ExtensionsMenuVisitChromeWebstoreModelInteractiveTest,
// extensions_features::kNewWebstoreURL enabled status.
testing::Bool(),
[](const testing::TestParamInfo<bool>& info) {
return info.param ? "NewVisitChromeWebstoreUrl"
: "OldVisitChromeWebstoreUrl";
});
// Test to confirm that the visit Chrome Web Store menu item navigates to the
// correct chrome webstore URL when selected and emits histograms that it did
// so.
IN_PROC_BROWSER_TEST_P(ExtensionsMenuVisitChromeWebstoreModelInteractiveTest,
IN_PROC_BROWSER_TEST_F(ExtensionsMenuVisitChromeWebstoreModelInteractiveTest,
VisitChromeWebStore) {
GURL expected_webstore_launch_url =
GetParam() ? extension_urls::GetNewWebstoreLaunchURL()
: extension_urls::GetWebstoreLaunchURL();
GURL expected_webstore_launch_url = extension_urls::GetNewWebstoreLaunchURL();
RunTestSequence(
InstrumentTab(kPrimaryTabPageElementId),
PressButton(kToolbarAppMenuButtonElementId),

@ -163,10 +163,6 @@ BASE_FEATURE(kWinRejectDotSpaceSuffixFilePaths,
base::FEATURE_ENABLED_BY_DEFAULT);
#endif
BASE_FEATURE(kNewWebstoreURL,
"NewWebstoreURL",
base::FEATURE_ENABLED_BY_DEFAULT);
BASE_FEATURE(kDeclarativeNetRequestSafeRuleLimits,
"DeclarativeNetRequestSafeDynamicRules",
base::FEATURE_ENABLED_BY_DEFAULT);

@ -217,11 +217,6 @@ BASE_DECLARE_FEATURE(kDeclarativeNetRequestSafeRuleLimits);
// only.
BASE_DECLARE_FEATURE(kIncludeJSCallStackInExtensionApiRequest);
// If enabled, the button for visiting the chrome webstore in both the
// extensions menu in the app menu and the chrome://extensions sidebar will send
// the user to the new chrome webstore URL.
BASE_DECLARE_FEATURE(kNewWebstoreURL);
// If enabled, use the new CWS itemSnippets API to fetch extension info.
BASE_DECLARE_FEATURE(kUseItemSnippetsAPI);

@ -14,7 +14,6 @@
#include "components/safe_browsing/core/common/features.h"
#include "components/safe_browsing/core/common/hashprefix_realtime/hash_realtime_utils.h"
#include "extensions/common/constants.h"
#include "extensions/common/extension_features.h"
#include "extensions/common/extension_id.h"
#include "extensions/common/extensions_client.h"
#include "net/base/url_util.h"

@ -54,8 +54,7 @@ GURL GetNewWebstoreLaunchURL();
// appended.
GURL AppendUtmSource(const GURL& url, std::string_view utm_source_value);
// Returns the URL to the extensions category on the old and new Web Store
// depending on extensions_features::kNewWebstoreURL feature flag.
// Returns the URL to the extensions category on the Web Store.
GURL GetWebstoreExtensionsCategoryURL();
// Returns the URL prefix for an item in the extension/app gallery. This URL