Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(707)

Unified Diff: chrome/browser/ui/views/download/download_item_view.cc

Issue 6905049: Detect removed files and reflect the state in chrome://downloads and the download shelf (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Merge with the latest revision Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/download/download_item_view.cc
diff --git a/chrome/browser/ui/views/download/download_item_view.cc b/chrome/browser/ui/views/download/download_item_view.cc
index 62a12e5086fe77ca07fb23b19a5a825f713bec33..5097c7aaf444a0659fb11b3c01f7220208b017c0 100644
--- a/chrome/browser/ui/views/download/download_item_view.cc
+++ b/chrome/browser/ui/views/download/download_item_view.cc
@@ -86,7 +86,6 @@ DownloadItemView::DownloadItemView(DownloadItem* download,
parent_(parent),
status_text_(UTF16ToWide(
l10n_util::GetStringUTF16(IDS_DOWNLOAD_STATUS_STARTING))),
- show_status_text_(true),
body_state_(NORMAL),
drop_down_state_(NORMAL),
progress_angle_(download_util::kStartAngleDegrees),
@@ -355,8 +354,6 @@ void DownloadItemView::OnDownloadUpdated(DownloadItem* download) {
complete_animation_->SetSlideDuration(kInterruptedAnimationDurationMs);
complete_animation_->SetTweenType(ui::Tween::LINEAR);
complete_animation_->Show();
- if (status_text.empty())
- show_status_text_ = false;
SchedulePaint();
LoadIcon();
break;
@@ -370,8 +367,6 @@ void DownloadItemView::OnDownloadUpdated(DownloadItem* download) {
complete_animation_->SetSlideDuration(kCompleteAnimationDurationMs);
complete_animation_->SetTweenType(ui::Tween::LINEAR);
complete_animation_->Show();
- if (status_text.empty())
- show_status_text_ = false;
SchedulePaint();
LoadIcon();
break;
@@ -723,7 +718,7 @@ void DownloadItemView::OnPaint(gfx::Canvas* canvas) {
// Draw status before button image to effectively lighten text.
if (!IsDangerousMode()) {
- if (show_status_text_) {
+ if (!status_text_.empty()) {
int mirrored_x = GetMirroredXWithWidthInView(
download_util::kSmallProgressIconSize, kTextWidth);
// Add font_.height() to compensate for title, which is drawn later.
@@ -856,8 +851,8 @@ void DownloadItemView::OnPaint(gfx::Canvas* canvas) {
SkColor file_name_color = GetThemeProvider()->GetColor(
ThemeService::COLOR_BOOKMARK_TEXT);
int y =
- box_y_ + (show_status_text_ ? kVerticalPadding :
- (box_height_ - font_.GetHeight()) / 2);
+ box_y_ + (status_text_.empty() ?
+ ((box_height_ - font_.GetHeight()) / 2) : kVerticalPadding);
// Draw the file's name.
canvas->DrawStringInt(filename, font_,
« no previous file with comments | « chrome/browser/ui/views/download/download_item_view.h ('k') | chrome/browser/ui/webui/downloads_dom_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698