| 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..fee0d44deb48b0b473ad59e80c7210d8fc71f341 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;
|
| @@ -23,6 +26,10 @@ class DownloadItem;
|
| class DownloadManager;
|
| }
|
|
|
| +namespace ui {
|
| +class ThemeProvider;
|
| +}
|
| +
|
| // This is an abstract base class for platform specific download shelf
|
| // implementations.
|
| class DownloadShelf {
|
| @@ -43,20 +50,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 +62,23 @@ 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.
|
| - 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 ui::ThemeProvider& theme_provider,
|
| + const base::TimeTicks& progress_start_time,
|
| int percent);
|
|
|
| static void PaintDownloadComplete(gfx::Canvas* canvas,
|
| - const BoundsAdjusterCallback& rtl_mirror,
|
| - int origin_x,
|
| - int origin_y,
|
| + const ui::ThemeProvider& theme_provider,
|
| double animation_progress);
|
|
|
| static void PaintDownloadInterrupted(gfx::Canvas* canvas,
|
| - const BoundsAdjusterCallback& rtl_mirror,
|
| - int origin_x,
|
| - int origin_y,
|
| + const ui::ThemeProvider& theme_provider,
|
| double animation_progress);
|
|
|
| // A new download has started. Add it to our shelf and show the download
|
|
|