Commit 5318d265 authored by Evan Stade's avatar Evan Stade Committed by Commit Bot

Use NativeTheme for warning/error icon colors in download shelf.

Bug: none
Change-Id: I723b19f0c95f9cf9ef6a8dcc314a73b65e9cbff6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1733091
Commit-Queue: Evan Stade <estade@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#685308}
parent 5521e0bd
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
#include "ui/gfx/paint_vector_icon.h" #include "ui/gfx/paint_vector_icon.h"
#include "ui/gfx/text_elider.h" #include "ui/gfx/text_elider.h"
#include "ui/gfx/text_utils.h" #include "ui/gfx/text_utils.h"
#include "ui/native_theme/native_theme.h"
#include "ui/views/accessibility/view_accessibility.h" #include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/animation/flood_fill_ink_drop_ripple.h" #include "ui/views/animation/flood_fill_ink_drop_ripple.h"
#include "ui/views/animation/ink_drop_highlight.h" #include "ui/views/animation/ink_drop_highlight.h"
...@@ -941,24 +942,27 @@ void DownloadItemView::ShowWarningDialog() { ...@@ -941,24 +942,27 @@ void DownloadItemView::ShowWarningDialog() {
gfx::ImageSkia DownloadItemView::GetWarningIcon() { gfx::ImageSkia DownloadItemView::GetWarningIcon() {
switch (model_->GetDangerType()) { switch (model_->GetDangerType()) {
case download::DOWNLOAD_DANGER_TYPE_UNCOMMON_CONTENT:
if (safe_browsing::AdvancedProtectionStatusManagerFactory::GetForProfile(
model()->profile())
->RequestsAdvancedProtectionVerdicts()) {
return gfx::CreateVectorIcon(
vector_icons::kErrorIcon, kErrorIconSize,
GetNativeTheme()->GetSystemColor(
ui::NativeTheme::kColorId_AlertSeverityMedium));
}
FALLTHROUGH;
case download::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL: case download::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL:
case download::DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT: case download::DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT:
case download::DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST: case download::DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST:
case download::DOWNLOAD_DANGER_TYPE_POTENTIALLY_UNWANTED: case download::DOWNLOAD_DANGER_TYPE_POTENTIALLY_UNWANTED:
case download::DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE: case download::DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE:
return gfx::CreateVectorIcon(vector_icons::kWarningIcon, kWarningIconSize, return gfx::CreateVectorIcon(
gfx::kGoogleRed700); vector_icons::kWarningIcon, kWarningIconSize,
GetNativeTheme()->GetSystemColor(
ui::NativeTheme::kColorId_AlertSeverityHigh));
case download::DOWNLOAD_DANGER_TYPE_UNCOMMON_CONTENT:
if (safe_browsing::AdvancedProtectionStatusManagerFactory::GetForProfile(
model()->profile())
->RequestsAdvancedProtectionVerdicts()) {
return gfx::CreateVectorIcon(vector_icons::kErrorIcon, kErrorIconSize,
gfx::kGoogleYellow500);
} else {
return gfx::CreateVectorIcon(vector_icons::kWarningIcon,
kWarningIconSize, gfx::kGoogleRed700);
}
case download::DOWNLOAD_DANGER_TYPE_BLOCKED_PASSWORD_PROTECTED: case download::DOWNLOAD_DANGER_TYPE_BLOCKED_PASSWORD_PROTECTED:
case download::DOWNLOAD_DANGER_TYPE_ASYNC_SCANNING: case download::DOWNLOAD_DANGER_TYPE_ASYNC_SCANNING:
case download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS: case download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS:
......
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