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

Unified Diff: chrome/browser/download/download_shelf.h

Issue 1236463002: Vectorize download shelf progress indicators (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 5 years, 5 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
« no previous file with comments | « chrome/app/theme/theme_resources.grd ('k') | chrome/browser/download/download_shelf.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..7ffa2c9eca40fbfaea38cfd7a67ed188f21c02a8 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,
Peter Kasting 2015/07/16 20:02:23 Nit: kFiletypeIconSize
Evan Stade 2015/07/22 16:39:45 was able to delete this one
@@ -67,46 +62,24 @@ class DownloadShelf {
kSmallProgressIconOffset = (kSmallProgressIconSize - kSmallIconSize) / 2
Peter Kasting 2015/07/16 20:02:23 Nit: If we want to keep this, I'd name it kFiletyp
Evan Stade 2015/07/22 16:39:45 Done.
};
- // 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);
-
+ // |progress_start_time| is only used for these unknown size downloads.
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
« no previous file with comments | « chrome/app/theme/theme_resources.grd ('k') | chrome/browser/download/download_shelf.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698