summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/download_item_gtk.h
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-11 22:18:19 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-11 22:18:19 +0000
commit79114c013c0bb312c4efdda33935b2340187e6cf (patch)
treecd02466045448001b7cff19021e7fd002f841907 /chrome/browser/gtk/download_item_gtk.h
parent26ebce450f0e708eb8c173ce7b5a303a00b502a9 (diff)
downloadchromium_src-79114c013c0bb312c4efdda33935b2340187e6cf.zip
chromium_src-79114c013c0bb312c4efdda33935b2340187e6cf.tar.gz
chromium_src-79114c013c0bb312c4efdda33935b2340187e6cf.tar.bz2
Download progress and complete animation on linux.
Review URL: http://codereview.chromium.org/113179 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15798 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/download_item_gtk.h')
-rw-r--r--chrome/browser/gtk/download_item_gtk.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/chrome/browser/gtk/download_item_gtk.h b/chrome/browser/gtk/download_item_gtk.h
index b7cde2d..00f1795 100644
--- a/chrome/browser/gtk/download_item_gtk.h
+++ b/chrome/browser/gtk/download_item_gtk.h
@@ -36,11 +36,27 @@ class DownloadItemGtk : public DownloadItem::Observer,
virtual void AnimationProgressed(const Animation* animation);
private:
+ // Functions for controlling the progress animation.
+ // Repaint the download progress.
+ void UpdateDownloadProgress();
+
+ // Starts a repeating timer for UpdateDownloadProgress.
+ void StartDownloadProgress();
+
+ // Stops the repeating timer.
+ void StopDownloadProgress();
+
static void InitNineBoxes();
+ // Used for the download item's body and menu button.
static gboolean OnExpose(GtkWidget* widget, GdkEventExpose* e,
DownloadItemGtk* download_item);
+ // Used for the download icon.
+ static gboolean OnProgressAreaExpose(GtkWidget* widget,
+ GdkEventExpose* e,
+ DownloadItemGtk* download_item);
+
static gboolean OnMenuButtonPressEvent(GtkWidget* button,
GdkEvent* event,
DownloadItemGtk* item);
@@ -78,6 +94,13 @@ class DownloadItemGtk : public DownloadItem::Observer,
// The widget that creates a dropdown menu when pressed.
GtkWidget* menu_button_;
+ // The widget that contains the animation progress and the file's icon
+ // (as well as the complete animation).
+ GtkWidget* progress_area_;
+
+ // In degrees. Only used for downloads with no known total size.
+ int progress_angle_;
+
// The menu that pops down when the user presses |menu_button_|. We do not
// create this until the first time we actually need it.
scoped_ptr<DownloadShelfContextMenuGtk> menu_;
@@ -95,6 +118,12 @@ class DownloadItemGtk : public DownloadItem::Observer,
// The animation when this item is first added to the shelf.
scoped_ptr<SlideAnimation> new_item_animation_;
+
+ // Progress animation.
+ base::RepeatingTimer<DownloadItemGtk> progress_timer_;
+
+ // Animation for download complete.
+ scoped_ptr<SlideAnimation> complete_animation_;
};
#endif // CHROME_BROWSER_GTK_DOWNLOAD_ITEM_GTK_H_