Commit 017a832f authored by David Black's avatar David Black Committed by Commit Bot

Remove IsAssistantLauncherUIEnabled.

Bug: b:148080975
Change-Id: Iaaca31713f62f0b0ea50e77dfdc2c0e2863273f3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2037815
Commit-Queue: David Black <dmblack@google.com>
Reviewed-by: default avatarTao Wu <wutao@chromium.org>
Reviewed-by: default avatarXiaohui Chen <xiaohuic@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738695}
parent a25a688e
......@@ -18,7 +18,6 @@
#include "ash/app_list/views/search_box_view.h"
#include "ash/assistant/assistant_controller.h"
#include "ash/assistant/assistant_ui_controller.h"
#include "ash/assistant/model/assistant_ui_model.h"
#include "ash/assistant/ui/assistant_ui_constants.h"
#include "ash/assistant/ui/assistant_view_delegate.h"
#include "ash/assistant/util/assistant_util.h"
......@@ -74,10 +73,8 @@ bool IsTabletMode() {
return Shell::Get()->tablet_mode_controller()->InTabletMode();
}
// Close current Assistant UI.
void CloseAssistantUi(AssistantExitPoint exit_point) {
if (app_list_features::IsAssistantLauncherUIEnabled())
Shell::Get()->assistant_controller()->ui_controller()->CloseUi(exit_point);
Shell::Get()->assistant_controller()->ui_controller()->CloseUi(exit_point);
}
TabletModeAnimationTransition CalculateAnimationTransitionForMetrics(
......@@ -179,10 +176,8 @@ AppListControllerImpl::AppListControllerImpl()
AssistantState::Get()->AddObserver(this);
shell->window_tree_host_manager()->AddObserver(this);
shell->mru_window_tracker()->AddObserver(this);
if (app_list_features::IsAssistantLauncherUIEnabled()) {
shell->assistant_controller()->AddObserver(this);
shell->assistant_controller()->ui_controller()->AddModelObserver(this);
}
shell->assistant_controller()->AddObserver(this);
shell->assistant_controller()->ui_controller()->AddModelObserver(this);
}
AppListControllerImpl::~AppListControllerImpl() {
......@@ -554,9 +549,6 @@ void AppListControllerImpl::OnAppListItemUpdated(AppListItem* item) {
void AppListControllerImpl::OnAppListStateChanged(AppListState new_state,
AppListState old_state) {
if (!app_list_features::IsAssistantLauncherUIEnabled())
return;
UpdateLauncherContainer();
if (new_state == AppListState::kStateEmbeddedAssistant) {
......@@ -1065,17 +1057,8 @@ void AppListControllerImpl::RecordShelfAppLaunched(
// Methods of |client_|:
void AppListControllerImpl::StartAssistant() {
if (app_list_features::IsAssistantLauncherUIEnabled()) {
Shell::Get()->assistant_controller()->ui_controller()->ShowUi(
AssistantEntryPoint::kLauncherSearchBoxMic);
return;
}
if (!IsTabletMode())
DismissAppList();
Shell::Get()->assistant_controller()->ui_controller()->ShowUi(
AssistantEntryPoint::kLauncherSearchBox);
AssistantEntryPoint::kLauncherSearchBoxMic);
}
void AppListControllerImpl::StartSearch(const base::string16& raw_query) {
......@@ -1188,12 +1171,8 @@ void AppListControllerImpl::GetSearchResultContextMenuModel(
}
void AppListControllerImpl::ViewShown(int64_t display_id) {
if (app_list_features::IsAssistantLauncherUIEnabled() &&
GetAssistantViewDelegate()->GetUiModel()->ui_mode() !=
AssistantUiMode::kLauncherEmbeddedUi) {
CloseAssistantUi(AssistantExitPoint::kLauncherOpen);
}
UpdateAssistantVisibility();
if (client_)
client_->ViewShown(display_id);
......@@ -1719,10 +1698,8 @@ void AppListControllerImpl::Shutdown() {
is_shutdown_ = true;
Shell* shell = Shell::Get();
if (app_list_features::IsAssistantLauncherUIEnabled()) {
shell->assistant_controller()->RemoveObserver(this);
shell->assistant_controller()->ui_controller()->RemoveModelObserver(this);
}
shell->assistant_controller()->RemoveObserver(this);
shell->assistant_controller()->ui_controller()->RemoveModelObserver(this);
shell->mru_window_tracker()->RemoveObserver(this);
shell->window_tree_host_manager()->RemoveObserver(this);
AssistantState::Get()->RemoveObserver(this);
......
......@@ -48,7 +48,7 @@ void AppListTestViewDelegate::OpenSearchResult(
for (size_t i = 0; i < results->item_count(); ++i) {
if (results->GetItemAt(i)->id() == result_id) {
open_search_result_counts_[i]++;
if (app_list_features::IsAssistantLauncherUIEnabled() &&
if (app_list_features::IsAssistantSearchEnabled() &&
results->GetItemAt(i)->is_omnibox_search()) {
++open_assistant_ui_count_;
}
......
......@@ -2655,6 +2655,11 @@ TEST_F(AppListViewTest, BackAction) {
// Tests selecting search result to show embedded Assistant UI.
TEST_F(AppListViewFocusTest, ShowEmbeddedAssistantUI) {
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitWithFeatures(
{app_list_features::kEnableAssistantSearch}, {});
ASSERT_TRUE(app_list_features::IsAssistantSearchEnabled());
Show();
// Initially the search box is inactive, hitting Enter to activate it.
......@@ -2708,7 +2713,6 @@ TEST_F(AppListViewTest, NoAnswerCardWhenEmbeddedAssistantUIEnabled) {
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitWithFeatures(
{app_list_features::kEnableAssistantSearch}, {});
ASSERT_TRUE(app_list_features::IsAssistantLauncherUIEnabled());
ASSERT_TRUE(app_list_features::IsAssistantSearchEnabled());
Initialize(false /*is_tablet_mode*/);
......@@ -2720,8 +2724,6 @@ TEST_F(AppListViewTest, NoAnswerCardWhenEmbeddedAssistantUIEnabled) {
// Tests that pressing escape when in embedded Assistant UI results in showing
// the search page view.
TEST_F(AppListViewTest, EscapeKeyEmbeddedAssistantUIToSearch) {
ASSERT_TRUE(app_list_features::IsAssistantLauncherUIEnabled());
Initialize(false /*is_tablet_mode*/);
Show();
......@@ -2739,8 +2741,6 @@ TEST_F(AppListViewTest, EscapeKeyEmbeddedAssistantUIToSearch) {
// Tests that clicking empty region in AppListview when showing Assistant UI
// should go back to peeking state.
TEST_F(AppListViewTest, ClickOutsideEmbeddedAssistantUIToPeeking) {
ASSERT_TRUE(app_list_features::IsAssistantLauncherUIEnabled());
Initialize(false /*is_tablet_mode*/);
Show();
......@@ -2771,8 +2771,6 @@ TEST_F(AppListViewTest, ClickOutsideEmbeddedAssistantUIToPeeking) {
// Tests that expand arrow is not visible when showing embedded Assistant UI.
TEST_F(AppListViewTest, ExpandArrowNotVisibleInEmbeddedAssistantUI) {
ASSERT_TRUE(app_list_features::IsAssistantLauncherUIEnabled());
Initialize(false /*is_tablet_mode*/);
Show();
......@@ -2787,8 +2785,6 @@ TEST_F(AppListViewTest, ExpandArrowNotVisibleInEmbeddedAssistantUI) {
// Tests that search box is not visible when showing embedded Assistant UI.
TEST_F(AppListViewTest, SearchBoxViewNotVisibleInEmbeddedAssistantUI) {
ASSERT_TRUE(app_list_features::IsAssistantLauncherUIEnabled());
Initialize(false /*is_tablet_mode*/);
Show();
......
......@@ -127,13 +127,10 @@ void ContentsView::Init(AppListModel* model) {
AddLauncherPage(search_results_page_view_, AppListState::kStateSearchResults);
if (app_list_features::IsAssistantLauncherUIEnabled()) {
assistant_page_view_ =
new AssistantPageView(view_delegate->GetAssistantViewDelegate(), this);
assistant_page_view_->SetVisible(false);
AddLauncherPage(assistant_page_view_,
AppListState::kStateEmbeddedAssistant);
}
assistant_page_view_ =
new AssistantPageView(view_delegate->GetAssistantViewDelegate(), this);
assistant_page_view_->SetVisible(false);
AddLauncherPage(assistant_page_view_, AppListState::kStateEmbeddedAssistant);
int initial_page_index = GetPageIndexForState(AppListState::kStateApps);
DCHECK_GE(initial_page_index, 0);
......
......@@ -10,7 +10,6 @@
#include "ash/assistant/ui/assistant_ui_constants.h"
#include "ash/assistant/ui/assistant_view_delegate.h"
#include "ash/assistant/ui/assistant_view_ids.h"
#include "ash/public/cpp/app_list/app_list_features.h"
#include "ash/strings/grit/ash_strings.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/canvas.h"
......@@ -126,9 +125,7 @@ void AssistantOptInView::InitLayout() {
views::BoxLayout::Orientation::kHorizontal));
layout_manager->set_cross_axis_alignment(
app_list_features::IsAssistantLauncherUIEnabled()
? views::BoxLayout::CrossAxisAlignment::kCenter
: views::BoxLayout::CrossAxisAlignment::kEnd);
views::BoxLayout::CrossAxisAlignment::kCenter);
layout_manager->set_main_axis_alignment(
views::BoxLayout::MainAxisAlignment::kCenter);
......
......@@ -16,7 +16,6 @@
#include "ash/assistant/ui/main_stage/element_animator.h"
#include "ash/assistant/util/animation_util.h"
#include "ash/assistant/util/assistant_util.h"
#include "ash/public/cpp/app_list/app_list_features.h"
#include "base/bind.h"
#include "base/strings/utf_string_conversions.h"
#include "ui/compositor/callback_layer_animation_observer.h"
......@@ -167,9 +166,7 @@ void SuggestionContainerView::InitLayout() {
gfx::Insets(0, kPaddingDip), kSpacingDip));
layout_manager_->set_cross_axis_alignment(
app_list_features::IsAssistantLauncherUIEnabled()
? views::BoxLayout::CrossAxisAlignment::kCenter
: views::BoxLayout::CrossAxisAlignment::kEnd);
views::BoxLayout::CrossAxisAlignment::kCenter);
// We center align when showing conversation starters.
layout_manager_->set_main_axis_alignment(
......
......@@ -59,7 +59,7 @@ const base::Feature kEnableAggregatedMlSearchRanking{
bool IsAnswerCardEnabled() {
// Not using local static variable to allow tests to change this value.
// Do not show answer card if the embedded Assistant UI is enabled.
// Do not show answer card if Assistant search is enabled.
return base::FeatureList::IsEnabled(kEnableAnswerCard) &&
!IsAssistantSearchEnabled();
}
......@@ -113,11 +113,6 @@ bool IsAssistantSearchEnabled() {
return base::FeatureList::IsEnabled(kEnableAssistantSearch);
}
// TODO(b/148080975): Remove.
bool IsAssistantLauncherUIEnabled() {
return true;
}
bool IsAppGridGhostEnabled() {
return base::FeatureList::IsEnabled(kEnableAppGridGhost);
}
......
......@@ -97,7 +97,6 @@ bool ASH_PUBLIC_EXPORT IsZeroStateMixedTypesRankerEnabled();
bool ASH_PUBLIC_EXPORT IsAppReinstallZeroStateEnabled();
bool ASH_PUBLIC_EXPORT IsSuggestedFilesEnabled();
bool ASH_PUBLIC_EXPORT IsAssistantSearchEnabled();
bool ASH_PUBLIC_EXPORT IsAssistantLauncherUIEnabled();
bool ASH_PUBLIC_EXPORT IsAppGridGhostEnabled();
bool ASH_PUBLIC_EXPORT IsAppListLaunchRecordingEnabled();
bool ASH_PUBLIC_EXPORT IsSearchBoxSelectionEnabled();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment