Commit a979b5db authored by Orin Jaworski's avatar Orin Jaworski Committed by Commit Bot

[omnibox] Update translation icon for answers in suggest

This CL adds the answer_translation.icon vector file and removes the
raster translate_round_32.png because it is no longer used.

Bug: 950075
Change-Id: If4ddff3b66c40628696edaa5743ad5693ba6742b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1559239
Commit-Queue: Orin Jaworski <orinj@chromium.org>
Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Reviewed-by: default avatarTommy Li <tommycli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#649333}
parent c93fff96
...@@ -155,9 +155,6 @@ ...@@ -155,9 +155,6 @@
<structure type="chrome_scaled_image" name="IDR_ARC_PLAY_STORE_OPTIN_IN_PROGRESS_NOTIFICATION" file="cros/notification_play_store_optin_in_progress.png" /> <structure type="chrome_scaled_image" name="IDR_ARC_PLAY_STORE_OPTIN_IN_PROGRESS_NOTIFICATION" file="cros/notification_play_store_optin_in_progress.png" />
<structure type="chrome_scaled_image" name="IDR_NOTIFICATION_EASYUNLOCK_ENABLED" file="cros/notification_easyunlock_enabled.png" /> <structure type="chrome_scaled_image" name="IDR_NOTIFICATION_EASYUNLOCK_ENABLED" file="cros/notification_easyunlock_enabled.png" />
</if> </if>
<if expr="not is_android">
<structure type="chrome_scaled_image" name="IDR_OMNIBOX_TRANSLATION_ROUND" file="common/translate_round_32.png" />
</if>
<structure type="chrome_scaled_image" name="IDR_PLUGINS_FAVICON" file="common/favicon_extensions.png" /> <structure type="chrome_scaled_image" name="IDR_PLUGINS_FAVICON" file="common/favicon_extensions.png" />
<structure type="chrome_scaled_image" name="IDR_PRERENDER" file="common/prerender_succeed_icon.png" /> <structure type="chrome_scaled_image" name="IDR_PRERENDER" file="common/prerender_succeed_icon.png" />
<if expr="chromeos"> <if expr="chromeos">
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include "extensions/common/image_util.h" #include "extensions/common/image_util.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/base/material_design/material_design_controller.h" #include "ui/base/material_design/material_design_controller.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h" #include "ui/gfx/canvas.h"
#include "ui/gfx/color_palette.h" #include "ui/gfx/color_palette.h"
#include "ui/gfx/image/canvas_image_source.h" #include "ui/gfx/image/canvas_image_source.h"
...@@ -294,42 +293,33 @@ void OmniboxMatchCellView::OnMatchUpdate(const OmniboxResultView* result_view, ...@@ -294,42 +293,33 @@ void OmniboxMatchCellView::OnMatchUpdate(const OmniboxResultView* result_view,
answer_image_view_->SetSize(gfx::Size()); answer_image_view_->SetSize(gfx::Size());
} else { } else {
// Determine if we have a local icon (or else it will be downloaded). // Determine if we have a local icon (or else it will be downloaded).
const gfx::VectorIcon* vector_icon = nullptr;
int idr_image = 0;
if (match.answer) { if (match.answer) {
switch (match.answer->type()) { switch (match.answer->type()) {
case SuggestionAnswer::ANSWER_TYPE_CURRENCY: case SuggestionAnswer::ANSWER_TYPE_CURRENCY:
vector_icon = &omnibox::kAnswerCurrencyIcon; apply_vector_icon(omnibox::kAnswerCurrencyIcon);
break; break;
case SuggestionAnswer::ANSWER_TYPE_DICTIONARY: case SuggestionAnswer::ANSWER_TYPE_DICTIONARY:
vector_icon = &omnibox::kAnswerDictionaryIcon; apply_vector_icon(omnibox::kAnswerDictionaryIcon);
break; break;
case SuggestionAnswer::ANSWER_TYPE_FINANCE: case SuggestionAnswer::ANSWER_TYPE_FINANCE:
vector_icon = &omnibox::kAnswerFinanceIcon; apply_vector_icon(omnibox::kAnswerFinanceIcon);
break; break;
case SuggestionAnswer::ANSWER_TYPE_SUNRISE: case SuggestionAnswer::ANSWER_TYPE_SUNRISE:
vector_icon = &omnibox::kAnswerSunriseIcon; apply_vector_icon(omnibox::kAnswerSunriseIcon);
break; break;
case SuggestionAnswer::ANSWER_TYPE_TRANSLATION: case SuggestionAnswer::ANSWER_TYPE_TRANSLATION:
idr_image = IDR_OMNIBOX_TRANSLATION_ROUND; apply_vector_icon(omnibox::kAnswerTranslationIcon);
break; break;
case SuggestionAnswer::ANSWER_TYPE_WEATHER: case SuggestionAnswer::ANSWER_TYPE_WEATHER:
// Weather icons are downloaded. Do nothing. // Weather icons are downloaded. Do nothing.
break; break;
case SuggestionAnswer::ANSWER_TYPE_WHEN_IS: case SuggestionAnswer::ANSWER_TYPE_WHEN_IS:
vector_icon = &omnibox::kAnswerWhenIsIcon; apply_vector_icon(omnibox::kAnswerWhenIsIcon);
break; break;
default: default:
vector_icon = &omnibox::kAnswerDefaultIcon; apply_vector_icon(omnibox::kAnswerDefaultIcon);
break; break;
} }
if (vector_icon) {
apply_vector_icon(*vector_icon);
} else if (idr_image) {
answer_image_view_->SetImage(
ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
idr_image));
}
// Always set the image size so that downloaded images get the correct // Always set the image size so that downloaded images get the correct
// size (such as Weather answers). // size (such as Weather answers).
answer_image_view_->SetImageSize( answer_image_view_->SetImageSize(
......
...@@ -28,6 +28,7 @@ aggregate_vector_icons("omnibox_vector_icons") { ...@@ -28,6 +28,7 @@ aggregate_vector_icons("omnibox_vector_icons") {
"answer_dictionary.icon", "answer_dictionary.icon",
"answer_finance.icon", "answer_finance.icon",
"answer_sunrise.icon", "answer_sunrise.icon",
"answer_translation.icon",
"answer_when_is.icon", "answer_when_is.icon",
"blank.icon", "blank.icon",
"bookmark.icon", "bookmark.icon",
......
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Source: translation_16px.svg --> SVGOMG --> Skiafy
// Appearance Description: Two glyphs from different languages.
CANVAS_DIMENSIONS, 16,
MOVE_TO, 8.6f, 10.3f,
LINE_TO, 6.9f, 8.7f,
R_CUBIC_TO, 1.2f, -1.2f, 2, -2.7f, 2.4f, -4.2f,
R_H_LINE_TO, 1.9f,
V_LINE_TO, 3.3f,
H_LINE_TO, 6.7f,
V_LINE_TO, 2,
H_LINE_TO, 5.5f,
R_V_LINE_TO, 1.3f,
H_LINE_TO, 1,
R_V_LINE_TO, 1.3f,
R_H_LINE_TO, 7.1f,
R_CUBIC_TO, -0.4f, 1.2f, -1.1f, 2.3f, -2, 3.3f,
R_CUBIC_TO, -0.6f, -0.6f, -1.1f, -1.3f, -1.5f, -2.1f,
H_LINE_TO, 3.3f,
R_CUBIC_TO, 0.5f, 1, 1.1f, 2, 1.9f, 2.9f,
LINE_TO, 2, 11.9f,
R_LINE_TO, 0.9f, 0.9f,
R_LINE_TO, 3.2f, -3.2f,
R_LINE_TO, 2, 2,
R_LINE_TO, 0.5f, -1.3f,
CLOSE,
R_MOVE_TO, 3.5f, -3.2f,
R_H_LINE_TO, -1.2f,
LINE_TO, 8, 14.7f,
R_H_LINE_TO, 1.3f,
R_LINE_TO, 0.7f, -1.9f,
R_H_LINE_TO, 3,
R_LINE_TO, 0.7f, 1.9f,
H_LINE_TO, 15,
R_LINE_TO, -2.9f, -7.6f,
CLOSE,
R_MOVE_TO, -1.6f, 4.4f,
R_LINE_TO, 1, -2.8f,
R_LINE_TO, 1, 2.8f,
R_H_LINE_TO, -2,
CLOSE
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