Commit 18cbc958 authored by Vasilii Sukhanov's avatar Vasilii Sukhanov Committed by Commit Bot

Replace the header image in the leak detection and safe browsing dialogs.

Mocks: https://docs.google.com/presentation/d/1yWuZO-fjXhdRp64nWRbnHEyzpFd1KOMS3u1_1XMdGuA/edit#slide=id.g76725620de_2_26

Bug: 1049200
Change-Id: I6383aca4cf0e7abc8552d0f83072440f7384e43b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2106054Reviewed-by: default avatarFriedrich [CET] <fhorschig@chromium.org>
Reviewed-by: default avatarVarun Khaneja <vakh@chromium.org>
Reviewed-by: default avatarBettina Dea <bdea@chromium.org>
Commit-Queue: Varun Khaneja <vakh@chromium.org>
Auto-Submit: Vasilii Sukhanov <vasilii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#751151}
parent 324bb1f7
......@@ -158,6 +158,10 @@
<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" />
</if>
<if expr="not is_android">
<structure type="chrome_scaled_image" name="IDR_PASSWORD_CHECK" file="common/password_check.png" />
<structure type="chrome_scaled_image" name="IDR_PASSWORD_CHECK_DARK" file="common/password_check_dark.png" />
</if>
<structure type="chrome_scaled_image" name="IDR_PLUGINS_FAVICON" file="common/favicon_extensions.png" />
<if expr="not is_android">
<structure type="chrome_scaled_image" name="IDR_PRERENDER" file="common/prerender_succeed_icon.png" />
......
......@@ -75,8 +75,6 @@ aggregate_vector_icons("chrome_vector_icons") {
"overflow_chevron.icon",
"page_info_content_paste.icon",
"paintbrush.icon",
"password_check_warning.icon",
"password_check_warning_dark.icon",
"photo.icon",
"photo_camera.icon",
"picture_in_picture_control_background.icon",
......
This diff is collapsed.
CANVAS_DIMENSIONS, 448,
NEW_PATH,
MOVE_TO, 0, 0,
R_H_LINE_TO, 448,
R_V_LINE_TO, 148,
H_LINE_TO, 0,
CLOSE,
NEW_PATH,
PATH_COLOR_ARGB, 0xFF, 0x38, 0x38, 0x38,
ROUND_RECT, 139, 25, 58, 82, 5,
NEW_PATH,
PATH_COLOR_ARGB, 0xFF, 0x4E, 0x51, 0x54,
MOVE_TO, 192, 26,
R_ARC_TO, 4, 4, 0, 0, 1, 4, 4,
R_V_LINE_TO, 72,
R_ARC_TO, 4.01f, 4.01f, 0, 0, 1, -4, 4,
R_H_LINE_TO, -48,
R_ARC_TO, 4.01f, 4.01f, 0, 0, 1, -4, -4,
V_LINE_TO, 30,
R_ARC_TO, 4, 4, 0, 0, 1, 4, -4,
R_H_LINE_TO, 48,
CLOSE,
R_MOVE_TO, 0, -2,
R_H_LINE_TO, -48,
R_ARC_TO, 6, 6, 0, 0, 0, -6, 6,
R_V_LINE_TO, 72,
R_ARC_TO, 6, 6, 0, 0, 0, 6, 6,
R_H_LINE_TO, 48,
R_ARC_TO, 6, 6, 0, 0, 0, 6, -6,
V_LINE_TO, 30,
R_ARC_TO, 6, 6, 0, 0, 0, -6, -6,
CLOSE,
NEW_PATH,
PATH_COLOR_ARGB, 0xFF, 0x38, 0x38, 0x38,
MOVE_TO, 145, 31,
R_H_LINE_TO, 46,
R_V_LINE_TO, 70,
R_H_LINE_TO, -46,
CLOSE,
MOVE_TO, 190, 32,
R_V_LINE_TO, 68,
R_H_LINE_TO, -44,
V_LINE_TO, 32,
R_H_LINE_TO, 44,
CLOSE,
R_MOVE_TO, 2, -2,
R_H_LINE_TO, -48,
R_V_LINE_TO, 72,
R_H_LINE_TO, 48,
V_LINE_TO, 30,
CLOSE,
ROUND_RECT, 115, 45, 34, 62, 5,
NEW_PATH,
PATH_COLOR_ARGB, 0xFF, 0x4E, 0x51, 0x54,
MOVE_TO, 144, 46,
R_ARC_TO, 4, 4, 0, 0, 1, 4, 4,
R_V_LINE_TO, 52,
R_ARC_TO, 4.01f, 4.01f, 0, 0, 1, -4, 4,
R_H_LINE_TO, -24,
R_ARC_TO, 4.01f, 4.01f, 0, 0, 1, -4, -4,
V_LINE_TO, 50,
R_ARC_TO, 4, 4, 0, 0, 1, 4, -4,
R_H_LINE_TO, 24,
CLOSE,
R_MOVE_TO, 0, -2,
R_H_LINE_TO, -24,
R_ARC_TO, 6, 6, 0, 0, 0, -6, 6,
R_V_LINE_TO, 52,
R_ARC_TO, 6, 6, 0, 0, 0, 6, 6,
R_H_LINE_TO, 24,
R_ARC_TO, 6, 6, 0, 0, 0, 6, -6,
V_LINE_TO, 50,
R_ARC_TO, 6, 6, 0, 0, 0, -6, -6,
CLOSE,
MOVE_TO, 114, 54,
R_H_LINE_TO, 36,
R_V_LINE_TO, 2,
R_H_LINE_TO, -36,
CLOSE,
MOVE_TO, 114, 98,
R_H_LINE_TO, 36,
R_V_LINE_TO, 2,
R_H_LINE_TO, -36,
CLOSE,
NEW_PATH,
PATH_COLOR_ARGB, 0xFF, 0x38, 0x38, 0x38,
MOVE_TO, 116, 56,
R_H_LINE_TO, 32,
R_V_LINE_TO, 42,
R_H_LINE_TO, -32,
CLOSE,
NEW_PATH,
PATH_COLOR_ARGB, 0xFF, 0x4E, 0x51, 0x54,
ROUND_RECT, 124, 49, 16, 2, 1,
MOVE_TO, 131.99f, 87,
R_ARC_TO, 13.75f, 13.75f, 0, 0, 0, 7.84f, -10.63f,
R_CUBIC_TO, 0.1f, -0.76f, 0.16f, -1.52f, 0.17f, -2.29f,
V_LINE_TO, 69,
R_LINE_TO, -8, -3,
R_LINE_TO, -8, 3,
R_V_LINE_TO, 5.07f,
R_CUBIC_TO, 0.02f, 0.77f, 0.07f, 1.53f, 0.17f, 2.29f,
ARC_TO, 13.72f, 13.72f, 0, 0, 0, 131.99f, 87,
CLOSE,
MOVE_TO, 168, 71,
R_ARC_TO, 2, 2, 0, 1, 0, 0, -4,
R_ARC_TO, 2, 2, 0, 0, 0, 0, 4,
CLOSE,
R_MOVE_TO, 6, 3,
R_H_LINE_TO, -12,
V_LINE_TO, 64,
R_H_LINE_TO, 12,
R_V_LINE_TO, 10,
CLOSE,
R_MOVE_TO, -9, -14,
R_ARC_TO, 3, 3, 0, 0, 1, 6, 0,
R_V_LINE_TO, 2,
R_H_LINE_TO, -6,
R_V_LINE_TO, -2,
CLOSE,
R_MOVE_TO, 9, 2,
R_H_LINE_TO, -1,
R_V_LINE_TO, -2,
R_ARC_TO, 5, 5, 0, 1, 0, -10, 0,
R_V_LINE_TO, 2,
R_H_LINE_TO, -1,
R_ARC_TO, 2.01f, 2.01f, 0, 0, 0, -2, 2,
R_V_LINE_TO, 10,
R_ARC_TO, 2.01f, 2.01f, 0, 0, 0, 2, 2,
R_H_LINE_TO, 12,
R_ARC_TO, 2.01f, 2.01f, 0, 0, 0, 2, -2,
V_LINE_TO, 64,
R_ARC_TO, 2.01f, 2.01f, 0, 0, 0, -2, -2,
CLOSE,
NEW_PATH,
PATH_COLOR_ARGB, 0xFF, 0xF8, 0xF9, 0xFA,
MOVE_TO, 247, 101,
V_LINE_TO, 48,
R_ARC_TO, 5.01f, 5.01f, 0, 0, 1, 5, -5,
R_H_LINE_TO, 5,
R_V_LINE_TO, 58,
R_H_LINE_TO, -10,
CLOSE,
NEW_PATH,
PATH_COLOR_ARGB, 0xFF, 0xE8, 0xEA, 0xED,
MOVE_TO, 256, 44,
R_V_LINE_TO, 56,
R_H_LINE_TO, -8,
V_LINE_TO, 48,
R_ARC_TO, 4, 4, 0, 0, 1, 4, -4,
R_H_LINE_TO, 4,
CLOSE,
R_MOVE_TO, 2, -2,
R_H_LINE_TO, -6,
R_ARC_TO, 6, 6, 0, 0, 0, -6, 6,
R_V_LINE_TO, 54,
R_H_LINE_TO, 12,
V_LINE_TO, 42,
CLOSE,
NEW_PATH,
PATH_COLOR_ARGB, 0xFF, 0x38, 0x38, 0x38,
MOVE_TO, 251, 101,
V_LINE_TO, 48,
R_ARC_TO, 5.01f, 5.01f, 0, 0, 1, 5, -5,
R_H_LINE_TO, 64,
R_ARC_TO, 5.01f, 5.01f, 0, 0, 1, 5, 5,
R_V_LINE_TO, 53,
R_H_LINE_TO, -74,
CLOSE,
NEW_PATH,
PATH_COLOR_ARGB, 0xFF, 0x4E, 0x51, 0x54,
MOVE_TO, 320, 44,
R_ARC_TO, 4, 4, 0, 0, 1, 4, 4,
R_V_LINE_TO, 52,
R_H_LINE_TO, -72,
V_LINE_TO, 48,
R_ARC_TO, 4, 4, 0, 0, 1, 4, -4,
R_H_LINE_TO, 64,
CLOSE,
R_MOVE_TO, 0, -2,
R_H_LINE_TO, -64,
R_ARC_TO, 6, 6, 0, 0, 0, -6, 6,
R_V_LINE_TO, 54,
R_H_LINE_TO, 76,
V_LINE_TO, 48,
R_ARC_TO, 6, 6, 0, 0, 0, -6, -6,
CLOSE,
NEW_PATH,
PATH_COLOR_ARGB, 0xFF, 0x38, 0x38, 0x38,
MOVE_TO, 252, 107,
R_ARC_TO, 5.01f, 5.01f, 0, 0, 1, -5, -5,
R_V_LINE_TO, -1,
R_H_LINE_TO, 52,
R_V_LINE_TO, 6,
R_H_LINE_TO, -47,
CLOSE,
NEW_PATH,
PATH_COLOR_ARGB, 0xFF, 0x4E, 0x51, 0x54,
MOVE_TO, 298, 102,
R_V_LINE_TO, 4,
R_H_LINE_TO, -46,
R_ARC_TO, 4.01f, 4.01f, 0, 0, 1, -4, -4,
R_H_LINE_TO, 50,
CLOSE,
R_MOVE_TO, 2, -2,
R_H_LINE_TO, -54,
R_V_LINE_TO, 2,
R_ARC_TO, 6, 6, 0, 0, 0, 6, 6,
R_H_LINE_TO, 48,
R_V_LINE_TO, -8,
CLOSE,
NEW_PATH,
PATH_COLOR_ARGB, 0xFF, 0x38, 0x38, 0x38,
MOVE_TO, 298, 107,
R_ARC_TO, 5.01f, 5.01f, 0, 0, 1, -5, -5,
R_V_LINE_TO, -1,
R_H_LINE_TO, 76,
R_V_LINE_TO, 1,
R_ARC_TO, 5.01f, 5.01f, 0, 0, 1, -5, 5,
R_H_LINE_TO, -66,
CLOSE,
NEW_PATH,
PATH_COLOR_ARGB, 0xFF, 0x4E, 0x51, 0x54,
MOVE_TO, 368, 102,
R_ARC_TO, 4.01f, 4.01f, 0, 0, 1, -4, 4,
R_H_LINE_TO, -66,
R_ARC_TO, 4.01f, 4.01f, 0, 0, 1, -4, -4,
R_H_LINE_TO, 74,
CLOSE,
R_MOVE_TO, 2, -2,
R_H_LINE_TO, -78,
R_V_LINE_TO, 2,
R_ARC_TO, 6, 6, 0, 0, 0, 6, 6,
R_H_LINE_TO, 66,
R_ARC_TO, 6, 6, 0, 0, 0, 6, -6,
R_V_LINE_TO, -2,
CLOSE,
MOVE_TO, 337.35f, 104,
R_H_LINE_TO, -12.7f,
R_ARC_TO, 3.65f, 3.65f, 0, 0, 1, -3.65f, -3.65f,
V_LINE_TO, 100,
R_H_LINE_TO, 20,
R_V_LINE_TO, 0.35f,
R_ARC_TO, 3.65f, 3.65f, 0, 0, 1, -3.65f, 3.65f,
CLOSE,
NEW_PATH,
PATH_COLOR_ARGB, 0xFF, 0x38, 0x38, 0x38,
MOVE_TO, 257, 49,
R_H_LINE_TO, 62,
R_V_LINE_TO, 46,
R_H_LINE_TO, -62,
CLOSE,
NEW_PATH,
PATH_COLOR_ARGB, 0xFF, 0x4E, 0x51, 0x54,
MOVE_TO, 318, 50,
R_V_LINE_TO, 44,
R_H_LINE_TO, -60,
V_LINE_TO, 50,
R_H_LINE_TO, 60,
CLOSE,
R_MOVE_TO, 2, -2,
R_H_LINE_TO, -64,
R_V_LINE_TO, 48,
R_H_LINE_TO, 64,
V_LINE_TO, 48,
CLOSE,
NEW_PATH,
PATH_COLOR_ARGB, 0xFF, 0x38, 0x38, 0x38,
ROUND_RECT, 267, 61, 74, 22, 3,
CLOSE,
NEW_PATH,
PATH_COLOR_ARGB, 0xFF, 0x4E, 0x51, 0x54,
MOVE_TO, 338, 62,
R_ARC_TO, 2, 2, 0, 0, 1, 2, 2,
R_V_LINE_TO, 16,
R_ARC_TO, 2, 2, 0, 0, 1, -2, 2,
R_H_LINE_TO, -68,
R_ARC_TO, 2, 2, 0, 0, 1, -2, -2,
V_LINE_TO, 64,
R_ARC_TO, 2, 2, 0, 0, 1, 2, -2,
R_H_LINE_TO, 68,
CLOSE,
R_MOVE_TO, 0, -2,
R_H_LINE_TO, -68,
R_ARC_TO, 4, 4, 0, 0, 0, -4, 4,
R_V_LINE_TO, 16,
R_ARC_TO, 4, 4, 0, 0, 0, 4, 4,
R_H_LINE_TO, 68,
R_ARC_TO, 4, 4, 0, 0, 0, 4, -4,
V_LINE_TO, 64,
R_ARC_TO, 4, 4, 0, 0, 0, -4, -4,
CLOSE,
ROUND_RECT, 332, 66, 2, 12, 1,
MOVE_TO, 274, 71,
R_H_LINE_TO, 10,
R_V_LINE_TO, 2,
R_H_LINE_TO, -10,
CLOSE,
MOVE_TO, 275.63f, 75.83f,
R_LINE_TO, 5, -8.66f,
R_LINE_TO, 1.73f, 1,
R_LINE_TO, -5, 8.66f,
CLOSE,
MOVE_TO, 280.63f, 76.83f,
R_LINE_TO, -5, -8.66f,
R_LINE_TO, 1.73f, -1,
R_LINE_TO, 5, 8.66f,
CLOSE,
MOVE_TO, 288, 71,
R_H_LINE_TO, 10,
R_V_LINE_TO, 2,
R_H_LINE_TO, -10,
CLOSE,
MOVE_TO, 289.63f, 75.83f,
R_LINE_TO, 5, -8.66f,
R_LINE_TO, 1.73f, 1,
R_LINE_TO, -5, 8.66f,
CLOSE,
MOVE_TO, 294.63f, 76.83f,
R_LINE_TO, -5, -8.66f,
R_LINE_TO, 1.73f, -1,
R_LINE_TO, 5, 8.66f,
CLOSE,
MOVE_TO, 302, 71,
R_H_LINE_TO, 10,
R_V_LINE_TO, 2,
R_H_LINE_TO, -10,
CLOSE,
MOVE_TO, 303.63f, 75.83f,
R_LINE_TO, 5, -8.66f,
R_LINE_TO, 1.73f, 1,
R_LINE_TO, -5, 8.66f,
CLOSE,
MOVE_TO, 308.63f, 76.83f,
R_LINE_TO, -5, -8.66f,
R_LINE_TO, 1.73f, -1,
R_LINE_TO, 5, 8.66f,
CLOSE,
MOVE_TO, 316, 71,
R_H_LINE_TO, 10,
R_V_LINE_TO, 2,
R_H_LINE_TO, -10,
CLOSE,
MOVE_TO, 317.63f, 75.83f,
R_LINE_TO, 5, -8.66f,
R_LINE_TO, 1.73f, 1,
R_LINE_TO, -5, 8.66f,
CLOSE,
MOVE_TO, 322.63f, 76.83f,
R_LINE_TO, -5, -8.66f,
R_LINE_TO, 1.73f, -1,
R_LINE_TO, 5, 8.66f,
CLOSE,
NEW_PATH,
PATH_COLOR_ARGB, 0xFF, 0x8A, 0xB4, 0xF8,
ROUND_RECT, 190, 38, 68, 92, 6,
CLOSE,
NEW_PATH,
PATH_COLOR_ARGB, 0xFF, 0x38, 0x38, 0x38,
MOVE_TO, 196, 50,
R_H_LINE_TO, 56,
R_V_LINE_TO, 68,
R_H_LINE_TO, -56,
CLOSE,
NEW_PATH,
PATH_COLOR_ARGB, 0xFF, 0x8A, 0xB4, 0xF8,
MOVE_TO, 202, 85,
R_H_LINE_TO, 12,
R_V_LINE_TO, 2,
R_H_LINE_TO, -12,
CLOSE,
MOVE_TO, 204.13f, 90.7f,
R_LINE_TO, 6, -10.39f,
R_LINE_TO, 1.73f, 1,
R_LINE_TO, -6, 10.39f,
CLOSE,
MOVE_TO, 210.13f, 91.7f,
R_LINE_TO, -6, -10.39f,
R_LINE_TO, 1.73f, -1,
R_LINE_TO, 6, 10.39f,
CLOSE,
MOVE_TO, 218, 85,
R_H_LINE_TO, 12,
R_V_LINE_TO, 2,
R_H_LINE_TO, -12,
CLOSE,
MOVE_TO, 220.13f, 90.7f,
R_LINE_TO, 6, -10.39f,
R_LINE_TO, 1.73f, 1,
R_LINE_TO, -6, 10.39f,
CLOSE,
MOVE_TO, 226.13f, 91.7f,
R_LINE_TO, -6, -10.39f,
R_LINE_TO, 1.73f, -1,
R_LINE_TO, 6, 10.39f,
CLOSE,
MOVE_TO, 234, 85,
R_H_LINE_TO, 12,
R_V_LINE_TO, 2,
R_H_LINE_TO, -12,
CLOSE,
MOVE_TO, 236.13f, 90.7f,
R_LINE_TO, 6, -10.39f,
R_LINE_TO, 1.73f, 1,
R_LINE_TO, -6, 10.39f,
CLOSE,
MOVE_TO, 242.13f, 91.7f,
R_LINE_TO, -6, -10.39f,
R_LINE_TO, 1.73f, -1,
R_LINE_TO, 6, 10.39f,
CLOSE,
NEW_PATH,
PATH_COLOR_ARGB, 0xFF, 0x4E, 0x51, 0x54,
ROUND_RECT, 202, 96, 44, 2, 1,
ROUND_RECT, 202, 64, 16, 2, 1,
ROUND_RECT, 202, 70, 28, 2, 1,
CLOSE,
NEW_PATH,
PATH_COLOR_ARGB, 0xFF, 0xF2, 0x8B, 0x82,
MOVE_TO, 258, 90,
R_CUBIC_TO, -9.94f, 0, -18, 8.06f, -18, 18,
R_CUBIC_TO, 0, 9.94f, 8.06f, 18, 18, 18,
R_CUBIC_TO, 9.94f, 0, 18, -8.06f, 18, -18,
R_CUBIC_TO, 0, -9.94f, -8.06f, -18, -18, -18,
CLOSE,
NEW_PATH,
PATH_COLOR_ARGB, 0xFF, 0x38, 0x38, 0x38,
MOVE_TO, 259.38f, 116.38f,
R_H_LINE_TO, -2.75f,
R_V_LINE_TO, -2.75f,
R_H_LINE_TO, 2.75f,
CLOSE,
MOVE_TO, 259.38f, 111,
R_H_LINE_TO, -2.75f,
R_V_LINE_TO, -11,
R_H_LINE_TO, 2.75f,
CLOSE,
NEW_PATH,
PATH_COLOR_ARGB, 0xFF, 0x4E, 0x51, 0x54,
MOVE_TO, 224, 30,
R_ARC_TO, 7, 7, 0, 0, 1, 7, 7,
R_V_LINE_TO, 7,
R_H_LINE_TO, -14,
R_V_LINE_TO, -7,
R_ARC_TO, 7, 7, 0, 0, 1, 7, -7,
CLOSE,
CIRCLE, 224, 37, 3,
MOVE_TO, 240, 44,
R_H_LINE_TO, -32,
R_ARC_TO, 6, 6, 0, 0, 0, -6, 6,
R_V_LINE_TO, 4,
R_H_LINE_TO, 44,
R_V_LINE_TO, -4,
R_ARC_TO, 6, 6, 0, 0, 0, -6, -6,
CLOSE
\ No newline at end of file
......@@ -5,7 +5,6 @@
#include "chrome/browser/ui/views/passwords/credential_leak_dialog_view.h"
#include "build/build_config.h"
#include "chrome/app/vector_icons/vector_icons.h"
#include "chrome/browser/ui/passwords/credential_leak_dialog_controller.h"
#include "chrome/browser/ui/views/accessibility/non_accessible_image_view.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h"
......@@ -23,39 +22,19 @@
namespace {
// Fixed height of the illustration shown on the top of the dialog.
constexpr int kIllustrationHeight = 148;
// Fixed background color of the illustration shown on the top of the dialog in
// normal mode.
constexpr SkColor kPictureBackgroundColor = SkColorSetARGB(0x0A, 0, 0, 0);
// Fixed background color of the illustration shown on the top of the dialog in
// dark mode.
constexpr SkColor kPictureBackgroundColorDarkMode =
SkColorSetARGB(0x1A, 0x00, 0x00, 0x00);
// Updates the image displayed on the illustration based on the current theme.
void UpdateImageView(NonAccessibleImageView* image_view,
bool dark_mode_enabled) {
image_view->SetImage(
gfx::CreateVectorIcon(dark_mode_enabled ? kPasswordCheckWarningDarkIcon
: kPasswordCheckWarningIcon,
dark_mode_enabled ? kPictureBackgroundColorDarkMode
: kPictureBackgroundColor));
*ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
dark_mode_enabled ? IDR_PASSWORD_CHECK_DARK : IDR_PASSWORD_CHECK));
}
// Creates the illustration which is rendered on top of the dialog.
std::unique_ptr<NonAccessibleImageView> CreateIllustration(
bool dark_mode_enabled) {
const gfx::Size illustration_size(
ChromeLayoutProvider::Get()->GetDistanceMetric(
DISTANCE_MODAL_DIALOG_PREFERRED_WIDTH),
kIllustrationHeight);
auto image_view = std::make_unique<NonAccessibleImageView>();
image_view->SetPreferredSize(illustration_size);
UpdateImageView(image_view.get(), dark_mode_enabled);
image_view->SetSize(illustration_size);
image_view->SetVerticalAlignment(views::ImageView::Alignment::kLeading);
return image_view;
}
......
......@@ -11,6 +11,7 @@
#include "chrome/browser/ui/views/accessibility/non_accessible_image_view.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h"
#include "chrome/browser/ui/views/chrome_typography.h"
#include "chrome/grit/theme_resources.h"
#include "components/constrained_window/constrained_window_views.h"
#include "components/password_manager/core/browser/password_manager_metrics_util.h"
#include "components/password_manager/core/common/password_manager_features.h"
......@@ -20,6 +21,7 @@
#include "components/vector_icons/vector_icons.h"
#include "content/public/browser/web_contents.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/color_palette.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/image/image_skia.h"
......@@ -33,40 +35,19 @@ using views::BoxLayout;
namespace {
// Fixed height of the illustration shown on the top of the dialog.
constexpr int kSafeBrowsingIllustrationHeight = 148;
// Fixed background color of the illustration shown on the top of the dialog in
// normal mode.
constexpr SkColor kSafeBrowsingPictureBackgroundColor =
SkColorSetARGB(0x0A, 0, 0, 0);
// Fixed background color of the illustration shown on the top of the dialog in
// dark mode.
constexpr SkColor kSafeBrowsingPictureBackgroundColorDarkMode =
SkColorSetARGB(0x1A, 0x00, 0x00, 0x00);
// Updates the image displayed on the illustration based on the current theme.
void SafeBrowsingUpdateImageView(NonAccessibleImageView* image_view,
bool dark_mode_enabled) {
image_view->SetImage(gfx::CreateVectorIcon(
dark_mode_enabled ? kPasswordCheckWarningDarkIcon
: kPasswordCheckWarningIcon,
dark_mode_enabled ? kSafeBrowsingPictureBackgroundColorDarkMode
: kSafeBrowsingPictureBackgroundColor));
image_view->SetImage(
*ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
dark_mode_enabled ? IDR_PASSWORD_CHECK_DARK : IDR_PASSWORD_CHECK));
}
// Creates the illustration which is rendered on top of the dialog.
std::unique_ptr<NonAccessibleImageView> SafeBrowsingCreateIllustration(
bool dark_mode_enabled) {
const gfx::Size illustration_size(
ChromeLayoutProvider::Get()->GetDistanceMetric(
DISTANCE_MODAL_DIALOG_PREFERRED_WIDTH),
kSafeBrowsingIllustrationHeight);
auto image_view = std::make_unique<NonAccessibleImageView>();
image_view->SetPreferredSize(illustration_size);
SafeBrowsingUpdateImageView(image_view.get(), dark_mode_enabled);
image_view->SetSize(illustration_size);
image_view->SetVerticalAlignment(views::ImageView::Alignment::kLeading);
return image_view;
}
......
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