Skip to content

Commit

Permalink
Remove productivity launcher related feature flags
Browse files Browse the repository at this point in the history
Bug: None
Change-Id: I7479b017dd73c71523ba49da55bc36f3803371ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4193556
Commit-Queue: Toni Barzic <tbarzic@chromium.org>
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1097595}
  • Loading branch information
Toni Barzic authored and Chromium LUCI CQ committed Jan 26, 2023
1 parent 48441fc commit afc995d
Show file tree
Hide file tree
Showing 28 changed files with 143 additions and 378 deletions.
5 changes: 0 additions & 5 deletions ash/app_list/app_list_controller_impl.cc
Expand Up @@ -431,9 +431,6 @@ void AppListControllerImpl::OnSessionStateChanged(
}

void AppListControllerImpl::OnUserSessionAdded(const AccountId& account_id) {
if (!features::IsLauncherAppSortEnabled())
return;

if (!client_)
return;

Expand Down Expand Up @@ -481,8 +478,6 @@ void AppListControllerImpl::UpdateAppListWithNewTemporarySortOrder(
const absl::optional<AppListSortOrder>& new_order,
bool animate,
base::OnceClosure update_position_closure) {
DCHECK(features::IsLauncherAppSortEnabled());

if (new_order) {
RecordAppListSortAction(*new_order, IsInTabletMode());

Expand Down
6 changes: 0 additions & 6 deletions ash/app_list/app_list_test_api.cc
Expand Up @@ -34,7 +34,6 @@
#include "ash/app_list/views/recent_apps_view.h"
#include "ash/app_list/views/scrollable_apps_grid_view.h"
#include "ash/app_list/views/search_box_view.h"
#include "ash/constants/ash_features.h"
#include "ash/public/cpp/accelerators.h"
#include "ash/shell.h"
#include "base/functional/callback.h"
Expand Down Expand Up @@ -195,14 +194,12 @@ AppListFolderView* GetAppListFolderView() {
}

AppListToastContainerView* GetToastContainerViewFromBubble() {
DCHECK(features::IsLauncherAppSortEnabled());
return GetAppListBubbleView()
->apps_page_for_test()
->toast_container_for_test();
}

AppListToastContainerView* GetToastContainerViewFromFullscreenAppList() {
DCHECK(features::IsLauncherAppSortEnabled());
return GetAppsContainerView()->toast_container();
}

Expand Down Expand Up @@ -543,19 +540,16 @@ views::View* AppListTestApi::GetToastContainerView() {

void AppListTestApi::AddReorderAnimationCallback(
AppsGridView::TestReorderDoneCallbackType callback) {
DCHECK(features::IsLauncherAppSortEnabled());
GetTopLevelAppsGridView()->AddReorderCallbackForTest(std::move(callback));
}

void AppListTestApi::AddFadeOutAnimationStartClosure(
base::OnceClosure closure) {
DCHECK(features::IsLauncherAppSortEnabled());
GetTopLevelAppsGridView()->AddFadeOutAnimationStartClosureForTest(
std::move(closure));
}

bool AppListTestApi::HasAnyWaitingReorderDoneCallback() const {
DCHECK(features::IsLauncherAppSortEnabled());
return GetTopLevelAppsGridView()->HasAnyWaitingReorderDoneCallbackForTest();
}

Expand Down
10 changes: 0 additions & 10 deletions ash/app_list/model/app_list_item.cc
Expand Up @@ -148,16 +148,6 @@ void AppListItem::SetName(const std::string& name) {
observer.ItemNameChanged();
}

void AppListItem::SetNameAndShortName(const std::string& name,
const std::string& short_name) {
if (metadata_->name == name && short_name_ == short_name)
return;
metadata_->name = name;
short_name_ = short_name;
for (auto& observer : observers_)
observer.ItemNameChanged();
}

void AppListItem::UpdateNotificationBadge(bool has_badge) {
if (has_notification_badge_ == has_badge)
return;
Expand Down
5 changes: 0 additions & 5 deletions ash/app_list/model/app_list_item.h
Expand Up @@ -145,11 +145,6 @@ class APP_LIST_MODEL_EXPORT AppListItem {
// Sets the full name of the item. Clears any shortened name.
void SetName(const std::string& name);

// Sets the full name and an optional shortened name of the item (e.g. to use
// if the full name is too long to fit in a view).
void SetNameAndShortName(const std::string& name,
const std::string& short_name);

// Updates whether the notification badge is shown on the view.
void UpdateNotificationBadge(bool has_badge);

Expand Down
37 changes: 16 additions & 21 deletions ash/app_list/views/app_list_bubble_apps_page.cc
Expand Up @@ -24,7 +24,6 @@
#include "ash/app_list/views/scrollable_apps_grid_view.h"
#include "ash/app_list/views/search_box_view.h"
#include "ash/bubble/bubble_utils.h"
#include "ash/constants/ash_features.h"
#include "ash/controls/rounded_scroll_bar.h"
#include "ash/controls/scroll_view_gradient_helper.h"
#include "ash/public/cpp/metrics_util.h"
Expand Down Expand Up @@ -230,14 +229,12 @@ AppListBubbleAppsPage::AppListBubbleAppsPage(

// Add a empty container view. A toast view should be added to
// `toast_container_` when the app list starts temporary sorting.
if (features::IsLauncherAppSortEnabled()) {
toast_container_ = scroll_contents->AddChildView(
std::make_unique<AppListToastContainerView>(
app_list_nudge_controller_.get(),
app_list_keyboard_controller_.get(), a11y_announcer, view_delegate,
/*delegate=*/this,
/*tablet_mode=*/false));
}
toast_container_ =
scroll_contents->AddChildView(std::make_unique<AppListToastContainerView>(
app_list_nudge_controller_.get(), app_list_keyboard_controller_.get(),
a11y_announcer, view_delegate,
/*delegate=*/this,
/*tablet_mode=*/false));

// All apps section.
scrollable_apps_grid_view_ =
Expand Down Expand Up @@ -510,7 +507,6 @@ void AppListBubbleAppsPage::UpdateForNewSortingOrder(
bool animate,
base::OnceClosure update_position_closure,
base::OnceClosure animation_done_closure) {
DCHECK(features::IsLauncherAppSortEnabled());
DCHECK_EQ(animate, !update_position_closure.is_null());
DCHECK(!animation_done_closure || animate);

Expand Down Expand Up @@ -595,17 +591,16 @@ void AppListBubbleAppsPage::VisibilityChanged(views::View* starting_from,
scrollable_apps_grid_view_->CancelDragWithNoDropAnimation();
}

if (features::IsLauncherAppSortEnabled()) {
// Updates the visibility state in toast container.
AppListToastContainerView::VisibilityState state =
is_visible ? AppListToastContainerView::VisibilityState::kShown
: AppListToastContainerView::VisibilityState::kHidden;
toast_container_->UpdateVisibilityState(state);

// Check if the reorder nudge view needs update if the bubble apps page is
// showing.
if (is_visible)
toast_container_->MaybeUpdateReorderNudgeView();
// Updates the visibility state in toast container.
AppListToastContainerView::VisibilityState state =
is_visible ? AppListToastContainerView::VisibilityState::kShown
: AppListToastContainerView::VisibilityState::kHidden;
toast_container_->UpdateVisibilityState(state);

// Check if the reorder nudge view needs update if the bubble apps page is
// showing.
if (is_visible) {
toast_container_->MaybeUpdateReorderNudgeView();
}
}

Expand Down
7 changes: 1 addition & 6 deletions ash/app_list/views/app_list_bubble_search_page_unittest.cc
Expand Up @@ -6,9 +6,7 @@

#include "ash/app_list/test/app_list_test_helper.h"
#include "ash/app_list/views/app_list_bubble_apps_page.h"
#include "ash/constants/ash_features.h"
#include "ash/test/ash_test_base.h"
#include "base/test/scoped_feature_list.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/layer_animation_element.h"
#include "ui/compositor/layer_animator.h"
Expand All @@ -20,10 +18,7 @@
namespace ash {
namespace {

class AppListBubbleSearchPageTest : public AshTestBase {
private:
base::test::ScopedFeatureList features_{features::kProductivityLauncher};
};
using AppListBubbleSearchPageTest = AshTestBase;

TEST_F(AppListBubbleSearchPageTest, AnimateShowPage) {
// Open the app list without animation.
Expand Down
21 changes: 8 additions & 13 deletions ash/app_list/views/app_list_toast_container_view.cc
Expand Up @@ -14,7 +14,6 @@
#include "ash/app_list/views/app_list_nudge_controller.h"
#include "ash/app_list/views/app_list_toast_view.h"
#include "ash/app_list/views/apps_grid_context_menu.h"
#include "ash/constants/ash_features.h"
#include "ash/public/cpp/app_list/app_list_model_delegate.h"
#include "ash/public/cpp/app_list/app_list_types.h"
#include "ash/public/cpp/feature_discovery_duration_reporter.h"
Expand Down Expand Up @@ -157,13 +156,11 @@ void AppListToastContainerView::CreateReorderNudgeView() {
AppListToastView::Builder toast_view_builder(
l10n_util::GetStringUTF16(IDS_ASH_LAUNCHER_APP_LIST_REORDER_NUDGE_TITLE));

if (features::IsLauncherDismissButtonsOnSortNudgeAndToastEnabled()) {
toast_view_builder.SetButton(
l10n_util::GetStringUTF16(
IDS_ASH_LAUNCHER_APP_LIST_REORDER_NUDGE_DISMISS_BUTTON),
base::BindRepeating(&AppListToastContainerView::FadeOutToastView,
base::Unretained(this)));
}
toast_view_builder.SetButton(
l10n_util::GetStringUTF16(
IDS_ASH_LAUNCHER_APP_LIST_REORDER_NUDGE_DISMISS_BUTTON),
base::BindRepeating(&AppListToastContainerView::FadeOutToastView,
base::Unretained(this)));

FeatureDiscoveryDurationReporter* reporter =
FeatureDiscoveryDurationReporter::GetInstance();
Expand Down Expand Up @@ -274,11 +271,9 @@ void AppListToastContainerView::OnTemporarySortOrderChanged(

AppListToastView::Builder toast_view_builder(toast_text);

if (features::IsLauncherDismissButtonsOnSortNudgeAndToastEnabled()) {
toast_view_builder.SetCloseButton(base::BindRepeating(
&AppListToastContainerView::OnReorderCloseButtonClicked,
base::Unretained(this)));
}
toast_view_builder.SetCloseButton(base::BindRepeating(
&AppListToastContainerView::OnReorderCloseButtonClicked,
base::Unretained(this)));

toast_view_ = AddChildView(
toast_view_builder.SetStyleForTabletMode(tablet_mode_)
Expand Down
15 changes: 6 additions & 9 deletions ash/app_list/views/apps_container_view.cc
Expand Up @@ -266,14 +266,12 @@ AppsContainerView::AppsContainerView(ContentsView* contents_view)

// Add a empty container view. A toast view should be added to
// `toast_container_` when the app list starts temporary sorting.
if (features::IsLauncherAppSortEnabled()) {
toast_container_ = scrollable_container_->AddChildView(
std::make_unique<AppListToastContainerView>(
app_list_nudge_controller_.get(),
app_list_keyboard_controller_.get(), a11y_announcer, view_delegate,
/*delegate=*/this, /*tablet_mode=*/true));
toast_container_->SetPaintToLayer(ui::LAYER_NOT_DRAWN);
}
toast_container_ = scrollable_container_->AddChildView(
std::make_unique<AppListToastContainerView>(
app_list_nudge_controller_.get(), app_list_keyboard_controller_.get(),
a11y_announcer, view_delegate,
/*delegate=*/this, /*tablet_mode=*/true));
toast_container_->SetPaintToLayer(ui::LAYER_NOT_DRAWN);

apps_grid_view_ =
scrollable_container_->AddChildView(std::make_unique<PagedAppsGridView>(
Expand Down Expand Up @@ -671,7 +669,6 @@ void AppsContainerView::UpdateForNewSortingOrder(
bool animate,
base::OnceClosure update_position_closure,
base::OnceClosure animation_done_closure) {
DCHECK(features::IsLauncherAppSortEnabled());
DCHECK_EQ(animate, !update_position_closure.is_null());
DCHECK(!animation_done_closure || animate);

Expand Down
4 changes: 0 additions & 4 deletions ash/app_list/views/apps_grid_context_menu.cc
Expand Up @@ -6,7 +6,6 @@

#include "ash/app_list/app_list_model_provider.h"
#include "ash/app_list/model/app_list_model.h"
#include "ash/constants/ash_features.h"
#include "ash/public/cpp/app_list/app_list_model_delegate.h"
#include "ash/public/cpp/app_menu_constants.h"
#include "ash/resources/vector_icons/vector_icons.h"
Expand Down Expand Up @@ -50,9 +49,6 @@ void AppsGridContextMenu::ShowContextMenuForViewImpl(
views::View* source,
const gfx::Point& point,
ui::MenuSourceType source_type) {
if (!features::IsLauncherAppSortEnabled())
return;

// Build the menu model and save it to `context_menu_model_`.
BuildMenuModel();
menu_model_adapter_ = std::make_unique<views::MenuModelAdapter>(
Expand Down
14 changes: 3 additions & 11 deletions ash/app_list/views/search_box_view_unittest.cc
Expand Up @@ -867,13 +867,10 @@ TEST_P(SearchBoxViewAutocompleteTest, SearchBoxAutocompletesNotHandledForIME) {
EXPECT_EQ("", view()->GetSearchBoxGhostTextForTest());
}

// TODO(crbug.com/1216082): Refactor the above tests to use AshTestBase, then
// parameterize them based on the ProductivityLauncher flag.
// TODO(crbug.com/1216082): Refactor the above tests to use AshTestBase.
class SearchBoxViewAppListBubbleTest : public AshTestBase {
public:
SearchBoxViewAppListBubbleTest() {
scoped_features_.InitAndEnableFeature(features::kProductivityLauncher);
}
SearchBoxViewAppListBubbleTest() = default;
~SearchBoxViewAppListBubbleTest() override = default;

static void AddSearchResult(const std::string& id,
Expand All @@ -896,8 +893,6 @@ class SearchBoxViewAppListBubbleTest : public AshTestBase {
search_result->SetTitle(title);
search_results->Add(std::move(search_result));
}

base::test::ScopedFeatureList scoped_features_;
};

TEST_F(SearchBoxViewAppListBubbleTest, AutocompleteCategoricalResult) {
Expand Down Expand Up @@ -1013,9 +1008,7 @@ TEST_F(SearchBoxViewTabletTest, SearchBoxInactiveByDefault) {

class SearchBoxViewAnimationTest : public AshTestBase {
public:
SearchBoxViewAnimationTest() {
scoped_features_.InitAndEnableFeature(features::kProductivityLauncher);
}
SearchBoxViewAnimationTest() = default;
~SearchBoxViewAnimationTest() override = default;

void SetUp() override {
Expand All @@ -1028,7 +1021,6 @@ class SearchBoxViewAnimationTest : public AshTestBase {
}

std::unique_ptr<ui::ScopedAnimationDurationScaleMode> non_zero_duration_mode_;
base::test::ScopedFeatureList scoped_features_;
};

// Test that the search box image buttons fade in and out correctly when the
Expand Down
43 changes: 0 additions & 43 deletions ash/constants/ash_features.cc
Expand Up @@ -1109,12 +1109,6 @@ BASE_FEATURE(kProductivityLauncherImageSearch,
"ProductivityLauncherImageSearch",
base::FEATURE_DISABLED_BY_DEFAULT);

// Enables or disables the flag to synchronize launcher item colors. It is
// in effect only when kLauncherAppSort is enabled.
BASE_FEATURE(kLauncherItemColorSync,
"LauncherItemColorSync",
base::FEATURE_ENABLED_BY_DEFAULT);

// Enables a privacy improvement that removes wrongly configured hidden
// networks and mitigates the creation of these networks. crbug/1327803.
BASE_FEATURE(kHiddenNetworkMigration,
Expand Down Expand Up @@ -1322,23 +1316,6 @@ BASE_FEATURE(kLacrosProfileBackwardMigration,
"LacrosProfileBackwardMigration",
base::FEATURE_DISABLED_BY_DEFAULT);

// Enables or disables sorting app icons shown on the launcher.
BASE_FEATURE(kLauncherAppSort,
"LauncherAppSort",
base::FEATURE_ENABLED_BY_DEFAULT);

// When enabled, app list folders will be moved so app list remains sorted when
// they get renamed, or created.
BASE_FEATURE(kLauncherFolderRenameKeepsSortOrder,
"LauncherFolderRenameKeepsSortOrder",
base::FEATURE_ENABLED_BY_DEFAULT);

// When enabled, the app list sort nudge and toast will have additional
// buttons for dismissal.
BASE_FEATURE(kLauncherDismissButtonsOnSortNudgeAndToast,
"LauncherDismissButtonsOnSortNudgeAndToast",
base::FEATURE_ENABLED_BY_DEFAULT);

// Uses short intervals for launcher nudge for testing if enabled.
BASE_FEATURE(kLauncherNudgeShortInterval,
"LauncherNudgeShortInterval",
Expand Down Expand Up @@ -2458,11 +2435,6 @@ bool IsDnsOverHttpsWithIdentifiersEnabled() {
return base::FeatureList::IsEnabled(kDnsOverHttpsWithIdentifiers);
}

bool IsLauncherItemColorSyncEnabled() {
return IsLauncherAppSortEnabled() &&
base::FeatureList::IsEnabled(kLauncherItemColorSync);
}

bool IsConsumerAutoUpdateToggleAllowed() {
return base::FeatureList::IsEnabled(kConsumerAutoUpdateToggleAllowed);
}
Expand Down Expand Up @@ -2771,21 +2743,6 @@ bool IsLanguagePacksEnabled() {
base::FeatureList::IsEnabled(kHandwritingLegacyRecognitionAllLang);
}

bool IsLauncherAppSortEnabled() {
return base::FeatureList::IsEnabled(kLauncherAppSort);
}

bool IsLauncherFolderRenameKeepsSortOrderEnabled() {
return IsLauncherAppSortEnabled() &&
base::FeatureList::IsEnabled(kLauncherFolderRenameKeepsSortOrder);
}

bool IsLauncherDismissButtonsOnSortNudgeAndToastEnabled() {
return IsLauncherAppSortEnabled() &&
base::FeatureList::IsEnabled(
kLauncherDismissButtonsOnSortNudgeAndToast);
}

bool IsLauncherNudgeShortIntervalEnabled() {
return base::FeatureList::IsEnabled(kLauncherNudgeShortInterval);
}
Expand Down

0 comments on commit afc995d

Please sign in to comment.