Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/views/download/download_item_view.h" | 5 #include "chrome/browser/ui/views/download/download_item_view.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 965 dropdown_button_->SetVisible(mode_ == MALICIOUS_MODE); | 965 dropdown_button_->SetVisible(mode_ == MALICIOUS_MODE); |
| 966 } | 966 } |
| 967 | 967 |
| 968 gfx::ImageSkia DownloadItemView::GetWarningIcon() { | 968 gfx::ImageSkia DownloadItemView::GetWarningIcon() { |
| 969 switch (download()->GetDangerType()) { | 969 switch (download()->GetDangerType()) { |
| 970 case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL: | 970 case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL: |
| 971 case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT: | 971 case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT: |
| 972 case content::DOWNLOAD_DANGER_TYPE_UNCOMMON_CONTENT: | 972 case content::DOWNLOAD_DANGER_TYPE_UNCOMMON_CONTENT: |
| 973 case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST: | 973 case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST: |
| 974 case content::DOWNLOAD_DANGER_TYPE_POTENTIALLY_UNWANTED: | 974 case content::DOWNLOAD_DANGER_TYPE_POTENTIALLY_UNWANTED: |
| 975 return gfx::CreateVectorIcon(gfx::VectorIconId::REMOVE_CIRCLE, | 975 case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE: |
| 976 kWarningIconSize, gfx::kGoogleRed700); | 976 return gfx::CreateVectorIcon(gfx::VectorIconId::WARNING, |
|
Dan Beam
2016/11/01 18:49:50
can we just use google red everywhere? it's prett
Jialiu Lin
2016/11/01 21:19:01
Agree. I cannot tell the difference between these
| |
| 977 kWarningIconSize, | |
| 978 gfx::kSafeBrowsingWarningRed); | |
| 977 | 979 |
| 978 case content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS: | 980 case content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS: |
| 979 case content::DOWNLOAD_DANGER_TYPE_MAYBE_DANGEROUS_CONTENT: | 981 case content::DOWNLOAD_DANGER_TYPE_MAYBE_DANGEROUS_CONTENT: |
| 980 case content::DOWNLOAD_DANGER_TYPE_USER_VALIDATED: | 982 case content::DOWNLOAD_DANGER_TYPE_USER_VALIDATED: |
| 981 case content::DOWNLOAD_DANGER_TYPE_MAX: | 983 case content::DOWNLOAD_DANGER_TYPE_MAX: |
| 982 NOTREACHED(); | 984 NOTREACHED(); |
| 983 break; | 985 break; |
| 984 | |
| 985 case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE: | |
| 986 return gfx::CreateVectorIcon(gfx::VectorIconId::WARNING, kWarningIconSize, | |
| 987 gfx::kGoogleYellow700); | |
| 988 } | 986 } |
| 989 return gfx::ImageSkia(); | 987 return gfx::ImageSkia(); |
| 990 } | 988 } |
| 991 | 989 |
| 992 gfx::Size DownloadItemView::GetButtonSize() const { | 990 gfx::Size DownloadItemView::GetButtonSize() const { |
| 993 DCHECK(discard_button_ && (mode_ == MALICIOUS_MODE || save_button_)); | 991 DCHECK(discard_button_ && (mode_ == MALICIOUS_MODE || save_button_)); |
| 994 gfx::Size size = discard_button_->GetPreferredSize(); | 992 gfx::Size size = discard_button_->GetPreferredSize(); |
| 995 if (save_button_) | 993 if (save_button_) |
| 996 size.SetToMax(save_button_->GetPreferredSize()); | 994 size.SetToMax(save_button_->GetPreferredSize()); |
| 997 return size; | 995 return size; |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1107 SchedulePaint(); | 1105 SchedulePaint(); |
| 1108 } | 1106 } |
| 1109 | 1107 |
| 1110 SkColor DownloadItemView::GetTextColor() const { | 1108 SkColor DownloadItemView::GetTextColor() const { |
| 1111 return GetTextColorForThemeProvider(GetThemeProvider()); | 1109 return GetTextColorForThemeProvider(GetThemeProvider()); |
| 1112 } | 1110 } |
| 1113 | 1111 |
| 1114 SkColor DownloadItemView::GetDimmedTextColor() const { | 1112 SkColor DownloadItemView::GetDimmedTextColor() const { |
| 1115 return SkColorSetA(GetTextColor(), 0xC7); | 1113 return SkColorSetA(GetTextColor(), 0xC7); |
| 1116 } | 1114 } |
| OLD | NEW |