Chromium Code Reviews| Index: chrome/browser/download/download_shelf.h |
| diff --git a/chrome/browser/download/download_shelf.h b/chrome/browser/download/download_shelf.h |
| index 4e14c39b227c6c9ef2da87e313118f4954989eb9..e400424af9d99d768bf93daff6036361ec08e11c 100644 |
| --- a/chrome/browser/download/download_shelf.h |
| +++ b/chrome/browser/download/download_shelf.h |
| @@ -5,13 +5,16 @@ |
| #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SHELF_H_ |
| #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SHELF_H_ |
| -#include "base/callback_forward.h" |
| #include "base/memory/weak_ptr.h" |
| #include "base/time/time.h" |
| #include "build/build_config.h" |
| class Browser; |
| +namespace base { |
| +class TimeTicks; |
| +} |
| + |
| namespace gfx { |
| class Canvas; |
| class ImageSkia; |
| @@ -43,20 +46,8 @@ class DownloadShelf { |
| // Download progress animations ---------------------------------------------- |
| enum { |
| - // Arc sweep angle for use with downloads of unknown size. |
| - kUnknownAngleDegrees = 50, |
| - |
| - // Rate of progress for use with downloads of unknown size. |
| - kUnknownIncrementDegrees = 12, |
| - |
| - // Start angle for downloads with known size (midnight position). |
| - kStartAngleDegrees = -90, |
| - |
| - // A the maximum number of degrees of a circle. |
| - kMaxDegrees = 360, |
| - |
| // Progress animation timer period, in milliseconds. |
| - kProgressRateMs = 150, |
| + kProgressRateMs = 30, |
| // Size of the filetype icon. |
| kSmallIconSize = 16, |
| @@ -67,46 +58,20 @@ class DownloadShelf { |
| kSmallProgressIconOffset = (kSmallProgressIconSize - kSmallIconSize) / 2 |
| }; |
| - // Type of the callback used on toolkit-views platforms for the |rtl_mirror| |
| - // argument of the PaintDownload functions. It captures the View subclass |
| - // within which the progress animation is drawn and is used to update the |
| - // correct 'left' value for the given rectangle in RTL locales. This is used |
| - // to mirror the position of the progress animation. The callback is |
| - // guaranteed to be invoked before the paint function returns. |
| - typedef base::Callback<void(gfx::Rect*)> BoundsAdjusterCallback; |
| - |
| DownloadShelf(); |
| virtual ~DownloadShelf(); |
| // Paint the common download animation progress foreground and background, |
| // clipping the foreground to 'percent' full. If percent is -1, then we don't |
| // know the total size, so we just draw a rotating segment until we're done. |
|
asanka
2015/07/16 00:45:08
Nit: Mention that |progress_start_time| is only ne
Evan Stade
2015/07/16 02:16:44
Done.
|
| - static void PaintCustomDownloadProgress( |
| - gfx::Canvas* canvas, |
| - const gfx::ImageSkia& background_image, |
| - const gfx::ImageSkia& foreground_image, |
| - int image_size, |
| - const gfx::Rect& bounds, |
| - int start_angle, |
| - int percent_done); |
| - |
| static void PaintDownloadProgress(gfx::Canvas* canvas, |
| - const BoundsAdjusterCallback& rtl_mirror, |
| - int origin_x, |
| - int origin_y, |
| - int start_angle, |
| + const base::TimeTicks& progress_start_time, |
| int percent); |
| static void PaintDownloadComplete(gfx::Canvas* canvas, |
| - const BoundsAdjusterCallback& rtl_mirror, |
| - int origin_x, |
| - int origin_y, |
| double animation_progress); |
| static void PaintDownloadInterrupted(gfx::Canvas* canvas, |
| - const BoundsAdjusterCallback& rtl_mirror, |
| - int origin_x, |
| - int origin_y, |
| double animation_progress); |
| // A new download has started. Add it to our shelf and show the download |