Commit 611cd7ed authored by Vladislav Kaznacheev's avatar Vladislav Kaznacheev Committed by Commit Bot

Badge app shortcut search results

Avoid resizing the badge icon, request it at the required size instead.

Bug: 887646
Test: search for "New", see badged "New alarm" action
Change-Id: I658356b863dd1334fc9da6187fc7cd86cac7a0d4
Reviewed-on: https://chromium-review.googlesource.com/1239236
Commit-Queue: Vladislav Kaznacheev <kaznacheev@chromium.org>
Reviewed-by: default avatarYury Khmel <khmel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593322}
parent ec068ad5
...@@ -113,7 +113,8 @@ SearchResultTileItemView::SearchResultTileItemView( ...@@ -113,7 +113,8 @@ SearchResultTileItemView::SearchResultTileItemView(
icon_->SetVerticalAlignment(views::ImageView::LEADING); icon_->SetVerticalAlignment(views::ImageView::LEADING);
AddChildView(icon_); AddChildView(icon_);
if (is_play_store_app_search_enabled_) { if (is_play_store_app_search_enabled_ ||
features::IsAppShortcutSearchEnabled()) {
badge_ = new views::ImageView; badge_ = new views::ImageView;
badge_->set_can_process_events_within_subtree(false); badge_->set_can_process_events_within_subtree(false);
badge_->SetVerticalAlignment(views::ImageView::LEADING); badge_->SetVerticalAlignment(views::ImageView::LEADING);
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include "chrome/browser/ui/app_list/app_list_controller_delegate.h" #include "chrome/browser/ui/app_list/app_list_controller_delegate.h"
#include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h"
#include "chrome/browser/ui/app_list/arc/arc_app_utils.h" #include "chrome/browser/ui/app_list/arc/arc_app_utils.h"
#include "ui/gfx/image/image_skia_operations.h"
namespace app_list { namespace app_list {
...@@ -42,8 +41,10 @@ ArcAppShortcutSearchResult::ArcAppShortcutSearchResult( ...@@ -42,8 +41,10 @@ ArcAppShortcutSearchResult::ArcAppShortcutSearchResult(
icon_dimension); icon_dimension);
icon_decode_request_->StartWithOptions(data_->icon_png); icon_decode_request_->StartWithOptions(data_->icon_png);
badge_icon_loader_ = badge_icon_loader_ = std::make_unique<ArcAppIconLoader>(
std::make_unique<ArcAppIconLoader>(profile_, icon_dimension, this); profile_,
app_list::AppListConfig::instance().search_tile_badge_icon_dimension(),
this);
badge_icon_loader_->FetchImage(GetAppId()); badge_icon_loader_->FetchImage(GetAppId());
} }
...@@ -57,9 +58,7 @@ void ArcAppShortcutSearchResult::Open(int event_flags) { ...@@ -57,9 +58,7 @@ void ArcAppShortcutSearchResult::Open(int event_flags) {
void ArcAppShortcutSearchResult::OnAppImageUpdated( void ArcAppShortcutSearchResult::OnAppImageUpdated(
const std::string& app_id, const std::string& app_id,
const gfx::ImageSkia& image) { const gfx::ImageSkia& image) {
SetBadgeIcon(gfx::ImageSkiaOperations::CreateResizedImage( SetBadgeIcon(image);
image, skia::ImageOperations::RESIZE_BEST,
app_list::AppListConfig::instance().search_tile_badge_icon_size()));
} }
std::string ArcAppShortcutSearchResult::GetAppId() const { std::string ArcAppShortcutSearchResult::GetAppId() const {
......
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