Commit fc45ada5 authored by Alex Newcomer's avatar Alex Newcomer Committed by Commit Bot

cros: Fix suggested chips dissapearing when returning from search

IgnoreUpdateAndLayout does not have a clear purpose, and is causing
a bug. So remove this code.

I have manually tested this extensively and it appears to have no
adverse side effects.

Bug: 995877
Change-Id: I8ae1ce8ee680eda3771f045834daaeeded7b23ce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1764776
Commit-Queue: Alex Newcomer <newcomer@chromium.org>
Commit-Queue: Xiyuan Xia <xiyuan@chromium.org>
Auto-Submit: Alex Newcomer <newcomer@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#689631}
parent 59bd7f50
...@@ -89,9 +89,6 @@ SearchResultSuggestionChipView* SuggestionChipContainerView::GetResultViewAt( ...@@ -89,9 +89,6 @@ SearchResultSuggestionChipView* SuggestionChipContainerView::GetResultViewAt(
} }
int SuggestionChipContainerView::DoUpdate() { int SuggestionChipContainerView::DoUpdate() {
if (IgnoreUpdateAndLayout())
return num_results();
// Filter out priority suggestion chips with a non-default value // Filter out priority suggestion chips with a non-default value
// for |display_index|. // for |display_index|.
auto filter_requested_index_chips = [](const SearchResult& r) -> bool { auto filter_requested_index_chips = [](const SearchResult& r) -> bool {
...@@ -166,9 +163,6 @@ const char* SuggestionChipContainerView::GetClassName() const { ...@@ -166,9 +163,6 @@ const char* SuggestionChipContainerView::GetClassName() const {
} }
void SuggestionChipContainerView::Layout() { void SuggestionChipContainerView::Layout() {
if (IgnoreUpdateAndLayout())
return;
// Only show the chips that fit in this view's contents bounds. // Only show the chips that fit in this view's contents bounds.
int total_width = 0; int total_width = 0;
const int max_width = GetContentsBounds().width(); const int max_width = GetContentsBounds().width();
...@@ -228,10 +222,4 @@ void SuggestionChipContainerView::OnTabletModeChanged(bool started) { ...@@ -228,10 +222,4 @@ void SuggestionChipContainerView::OnTabletModeChanged(bool started) {
chip->SetBackgroundBlurEnabled(started); chip->SetBackgroundBlurEnabled(started);
} }
bool SuggestionChipContainerView::IgnoreUpdateAndLayout() const {
// Ignore update and layout when this view is not shown.
const ash::AppListState state = contents_view_->GetActiveState();
return state != ash::AppListState::kStateApps;
}
} // namespace app_list } // namespace app_list
...@@ -38,8 +38,6 @@ class SuggestionChipContainerView : public SearchResultContainerView { ...@@ -38,8 +38,6 @@ class SuggestionChipContainerView : public SearchResultContainerView {
void OnTabletModeChanged(bool started); void OnTabletModeChanged(bool started);
private: private:
// Returns true if update and layout should be ignored.
bool IgnoreUpdateAndLayout() const;
ContentsView* contents_view_ = nullptr; // Not owned ContentsView* contents_view_ = nullptr; // Not owned
......
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