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 <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1066 // different cases. | 1066 // different cases. |
1067 if (mode_ == MALICIOUS_MODE) { | 1067 if (mode_ == MALICIOUS_MODE) { |
1068 warning_icon_ = rb.GetImageSkiaNamed(IDR_SAFEBROWSING_WARNING); | 1068 warning_icon_ = rb.GetImageSkiaNamed(IDR_SAFEBROWSING_WARNING); |
1069 } else { | 1069 } else { |
1070 // The download file has dangerous file type (e.g.: an executable). | 1070 // The download file has dangerous file type (e.g.: an executable). |
1071 warning_icon_ = rb.GetImageSkiaNamed(IDR_WARNING); | 1071 warning_icon_ = rb.GetImageSkiaNamed(IDR_WARNING); |
1072 } | 1072 } |
1073 string16 dangerous_label = model_->GetWarningText(font_, kTextWidth); | 1073 string16 dangerous_label = model_->GetWarningText(font_, kTextWidth); |
1074 dangerous_download_label_ = new views::Label(dangerous_label); | 1074 dangerous_download_label_ = new views::Label(dangerous_label); |
1075 dangerous_download_label_->SetMultiLine(true); | 1075 dangerous_download_label_->SetMultiLine(true); |
1076 dangerous_download_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 1076 dangerous_download_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
1077 dangerous_download_label_->SetAutoColorReadabilityEnabled(false); | 1077 dangerous_download_label_->SetAutoColorReadabilityEnabled(false); |
1078 AddChildView(dangerous_download_label_); | 1078 AddChildView(dangerous_download_label_); |
1079 SizeLabelToMinWidth(); | 1079 SizeLabelToMinWidth(); |
1080 UpdateDropDownButtonPosition(); | 1080 UpdateDropDownButtonPosition(); |
1081 TooltipTextChanged(); | 1081 TooltipTextChanged(); |
1082 } | 1082 } |
1083 | 1083 |
1084 gfx::Size DownloadItemView::GetButtonSize() { | 1084 gfx::Size DownloadItemView::GetButtonSize() { |
1085 DCHECK(discard_button_ && (mode_ == MALICIOUS_MODE || save_button_)); | 1085 DCHECK(discard_button_ && (mode_ == MALICIOUS_MODE || save_button_)); |
1086 gfx::Size size; | 1086 gfx::Size size; |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1223 void DownloadItemView::AnimateStateTransition(State from, State to, | 1223 void DownloadItemView::AnimateStateTransition(State from, State to, |
1224 ui::SlideAnimation* animation) { | 1224 ui::SlideAnimation* animation) { |
1225 if (from == NORMAL && to == HOT) { | 1225 if (from == NORMAL && to == HOT) { |
1226 animation->Show(); | 1226 animation->Show(); |
1227 } else if (from == HOT && to == NORMAL) { | 1227 } else if (from == HOT && to == NORMAL) { |
1228 animation->Hide(); | 1228 animation->Hide(); |
1229 } else if (from != to) { | 1229 } else if (from != to) { |
1230 animation->Reset((to == HOT) ? 1.0 : 0.0); | 1230 animation->Reset((to == HOT) ? 1.0 : 0.0); |
1231 } | 1231 } |
1232 } | 1232 } |
OLD | NEW |