summaryrefslogtreecommitdiffstats
path: root/ui/gfx/paint_throbber.h
diff options
context:
space:
mode:
authorestade <estade@chromium.org>2015-05-03 13:21:26 -0700
committerCommit bot <commit-bot@chromium.org>2015-05-03 20:22:01 +0000
commit4b7d20a22e0c0a06109434005f2d39ac88f51722 (patch)
treed66b32ea0d2bda85e0b00e5806277d0c8d673ba8 /ui/gfx/paint_throbber.h
parent7d724373197ee4d8b7bc2bc968d9f25333b284fe (diff)
downloadchromium_src-4b7d20a22e0c0a06109434005f2d39ac88f51722.zip
chromium_src-4b7d20a22e0c0a06109434005f2d39ac88f51722.tar.gz
chromium_src-4b7d20a22e0c0a06109434005f2d39ac88f51722.tar.bz2
Material throbber: use in tabstrip
- move paint code to ui/gfx - add color and tinting enums in native_theme and ThemeProvider, calculate tinted color in ThemeService - port tabs to use new throbber - ash system throbber also gets new throbber - merge views::Throbber and view::MaterialThrobber and delete some code that wasn't being used (frame_time_ms was always the same, for example) BUG=473342, 461137 Review URL: https://codereview.chromium.org/1123573002 Cr-Commit-Position: refs/heads/master@{#328079}
Diffstat (limited to 'ui/gfx/paint_throbber.h')
-rw-r--r--ui/gfx/paint_throbber.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/ui/gfx/paint_throbber.h b/ui/gfx/paint_throbber.h
new file mode 100644
index 0000000..497de74
--- /dev/null
+++ b/ui/gfx/paint_throbber.h
@@ -0,0 +1,38 @@
+// Copyright (c) 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_GFX_PAINT_THROBBER_H_
+#define UI_GFX_PAINT_THROBBER_H_
+
+#include "base/basictypes.h"
+#include "third_party/skia/include/core/SkColor.h"
+#include "ui/gfx/gfx_export.h"
+
+namespace base {
+class TimeDelta;
+}
+
+namespace gfx {
+
+class Canvas;
+class Rect;
+
+// Paints a single frame of the throbber in the "spinning", aka Material, state.
+GFX_EXPORT void PaintThrobberSpinning(Canvas* canvas,
+ const Rect& bounds, SkColor color, const base::TimeDelta& elapsed_time);
+// As above, but frame is passed in rather than calculated. Frame duration is
+// assumed to be 30ms.
+GFX_EXPORT void PaintThrobberSpinningForFrame(Canvas* canvas,
+ const Rect& bounds, SkColor color, uint32_t frame);
+
+// Paints a throbber in the "waiting" state. Used when waiting on a network
+// response, for example.
+GFX_EXPORT void PaintThrobberWaiting(Canvas* canvas,
+ const Rect& bounds, SkColor color, const base::TimeDelta& elapsed_time);
+GFX_EXPORT void PaintThrobberWaitingForFrame(Canvas* canvas,
+ const Rect& bounds, SkColor color, uint32_t frame);
+
+} // namespace gfx
+
+#endif // UI_GFX_PAINT_THROBBER_H_