summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-06 22:00:27 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-06 22:00:27 +0000
commit8e92efdf4d3b2a50b8efc1bd4aca9a3895b7d2b7 (patch)
tree8c2f4223e7f9de78ea0437c40141e22a27be2007 /chrome/browser
parent433130213fe9f29f94007e4492605d4af935470b (diff)
downloadchromium_src-8e92efdf4d3b2a50b8efc1bd4aca9a3895b7d2b7.zip
chromium_src-8e92efdf4d3b2a50b8efc1bd4aca9a3895b7d2b7.tar.gz
chromium_src-8e92efdf4d3b2a50b8efc1bd4aca9a3895b7d2b7.tar.bz2
Properly size accepted dangerous downloads.
BUG=18448 Review URL: http://codereview.chromium.org/165086 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22675 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/gtk/download_item_gtk.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/chrome/browser/gtk/download_item_gtk.cc b/chrome/browser/gtk/download_item_gtk.cc
index f0c38b7..63cea8e 100644
--- a/chrome/browser/gtk/download_item_gtk.cc
+++ b/chrome/browser/gtk/download_item_gtk.cc
@@ -61,6 +61,10 @@ const int kNewItemAnimationDurationMs = 800;
// How long the 'download complete' animation should last for.
const int kCompleteAnimationDurationMs = 2500;
+// Width of the body area of the download item.
+// TODO(estade): get rid of the fudge factor. http://crbug.com/18692
+const int kBodyWidth = kTextWidth + 50 + download_util::kSmallProgressIconSize;
+
} // namespace
// DownloadShelfContextMenuGtk -------------------------------------------------
@@ -372,6 +376,7 @@ void DownloadItemGtk::OnDownloadUpdated(DownloadItem* download) {
// We have been approved.
gtk_widget_show_all(hbox_.get());
gtk_widget_destroy(dangerous_prompt_);
+ gtk_widget_set_size_request(body_.get(), kBodyWidth, -1);
dangerous_prompt_ = NULL;
}
@@ -427,12 +432,9 @@ void DownloadItemGtk::AnimationProgressed(const Animation* animation) {
gtk_widget_set_size_request(dangerous_hbox_, showing_width, -1);
} else {
DCHECK(animation == new_item_animation_.get());
- // See above TODO for explanation of the extra 50.
int showing_width = std::max(kMinDownloadItemWidth,
- static_cast<int>((kTextWidth + 50 +
- download_util::kSmallProgressIconSize) *
+ static_cast<int>(kBodyWidth *
new_item_animation_->GetCurrentValue()));
- showing_width = std::max(showing_width, kMinDownloadItemWidth);
gtk_widget_set_size_request(body_.get(), showing_width, -1);
}
}