Commit c8ac1017 authored by Rachel Wong's avatar Rachel Wong Committed by Commit Bot

Set the privacy container score based on app list config.

The privacy container score was previously set to INT_MAX to ensure that
it was the first container, because other container scores could
fluctuate. The app list config now consolidates the scores for all
search result containers, see
https://chromium-review.googlesource.com/c/chromium/src/+/2345924.

Bug: 1079169
Change-Id: I1caf9a3bd94f2c71aed68fe79f2ec88fa4f39645
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2377185Reviewed-by: default avatarTony Yeoman <tby@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Rachel Wong <wrong@chromium.org>
Cr-Commit-Position: refs/heads/master@{#802083}
parent cd0b6353
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "ash/app_list/model/search/search_result.h" #include "ash/app_list/model/search/search_result.h"
#include "ash/app_list/views/assistant/assistant_privacy_info_view.h" #include "ash/app_list/views/assistant/assistant_privacy_info_view.h"
#include "ash/app_list/views/suggested_content_info_view.h" #include "ash/app_list/views/suggested_content_info_view.h"
#include "ash/public/cpp/app_list/app_list_config.h"
#include "ash/public/cpp/app_list/app_list_types.h" #include "ash/public/cpp/app_list/app_list_types.h"
#include "ui/views/layout/box_layout.h" #include "ui/views/layout/box_layout.h"
...@@ -87,7 +88,9 @@ int PrivacyContainerView::DoUpdate() { ...@@ -87,7 +88,9 @@ int PrivacyContainerView::DoUpdate() {
// the top of the results list. // the top of the results list.
const bool should_show_container = const bool should_show_container =
should_show_assistant || should_show_suggested_content; should_show_assistant || should_show_suggested_content;
set_container_score(should_show_container ? INT_MAX : -1); set_container_score(should_show_container
? AppListConfig::instance().privacy_container_score()
: -1);
return should_show_container ? 1 : 0; return should_show_container ? 1 : 0;
} }
......
...@@ -176,6 +176,7 @@ class ASH_PUBLIC_EXPORT AppListConfig { ...@@ -176,6 +176,7 @@ class ASH_PUBLIC_EXPORT AppListConfig {
return max_search_result_list_items_; return max_search_result_list_items_;
} }
double privacy_container_score() const { return privacy_container_score_; }
double app_tiles_container_score() const { double app_tiles_container_score() const {
return app_tiles_container_score_; return app_tiles_container_score_;
} }
...@@ -472,8 +473,11 @@ class ASH_PUBLIC_EXPORT AppListConfig { ...@@ -472,8 +473,11 @@ class ASH_PUBLIC_EXPORT AppListConfig {
// Max number of search result list items in the launcher suggestion window. // Max number of search result list items in the launcher suggestion window.
const size_t max_search_result_list_items_ = 5; const size_t max_search_result_list_items_ = 5;
// Scores for the three containers within the search box view. These are // Scores for the containers within the search box view. These are displayed
// displayed in high-to-low order. // in high-to-low order.
// The privacy container is not always visible, but when available it should
// always be the first item underneath the search box.
const double privacy_container_score_ = 4.0;
const double app_tiles_container_score_ = 3.0; const double app_tiles_container_score_ = 3.0;
const double answer_card_container_score_ = 2.0; const double answer_card_container_score_ = 2.0;
const double results_list_container_score_ = 1.0; const double results_list_container_score_ = 1.0;
......
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