estade | 4b7d20a | 2015-05-03 20:21:26 | [diff] [blame^] | 1 | // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef UI_GFX_PAINT_THROBBER_H_ |
| 6 | #define UI_GFX_PAINT_THROBBER_H_ |
| 7 | |
| 8 | #include "base/basictypes.h" |
| 9 | #include "third_party/skia/include/core/SkColor.h" |
| 10 | #include "ui/gfx/gfx_export.h" |
| 11 | |
| 12 | namespace base { |
| 13 | class TimeDelta; |
| 14 | } |
| 15 | |
| 16 | namespace gfx { |
| 17 | |
| 18 | class Canvas; |
| 19 | class Rect; |
| 20 | |
| 21 | // Paints a single frame of the throbber in the "spinning", aka Material, state. |
| 22 | GFX_EXPORT void PaintThrobberSpinning(Canvas* canvas, |
| 23 | const Rect& bounds, SkColor color, const base::TimeDelta& elapsed_time); |
| 24 | // As above, but frame is passed in rather than calculated. Frame duration is |
| 25 | // assumed to be 30ms. |
| 26 | GFX_EXPORT void PaintThrobberSpinningForFrame(Canvas* canvas, |
| 27 | const Rect& bounds, SkColor color, uint32_t frame); |
| 28 | |
| 29 | // Paints a throbber in the "waiting" state. Used when waiting on a network |
| 30 | // response, for example. |
| 31 | GFX_EXPORT void PaintThrobberWaiting(Canvas* canvas, |
| 32 | const Rect& bounds, SkColor color, const base::TimeDelta& elapsed_time); |
| 33 | GFX_EXPORT void PaintThrobberWaitingForFrame(Canvas* canvas, |
| 34 | const Rect& bounds, SkColor color, uint32_t frame); |
| 35 | |
| 36 | } // namespace gfx |
| 37 | |
| 38 | #endif // UI_GFX_PAINT_THROBBER_H_ |