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

Unified Diff: ui/views/controls/throbber.h

Issue 1067593006: Implement material throbber and use it in one place (Autofill card (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 8 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/browser/ui/views/autofill/card_unmask_prompt_views.cc ('k') | ui/views/controls/throbber.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/throbber.h
diff --git a/ui/views/controls/throbber.h b/ui/views/controls/throbber.h
index 0ee428d0dfa4aad51debed2dc825d772aab06f80..071653b521674ff1aa57928c5a81f0d2108f19c2 100644
--- a/ui/views/controls/throbber.h
+++ b/ui/views/controls/throbber.h
@@ -41,6 +41,8 @@ class VIEWS_EXPORT Throbber : public View {
void OnPaint(gfx::Canvas* canvas) override;
protected:
+ const base::Time& start_time() { return start_time_; }
sky 2015/04/21 20:17:38 It's my understanding we return times by value and
Evan Stade 2015/04/21 22:04:02 Done
+
// Specifies whether the throbber is currently animating or not
bool running_;
sky 2015/04/21 20:17:38 Style guide says no protected members.
Evan Stade 2015/04/21 22:04:02 fixed
@@ -102,6 +104,7 @@ class VIEWS_EXPORT SmoothedThrobber : public Throbber {
class VIEWS_EXPORT CheckmarkThrobber : public Throbber {
public:
CheckmarkThrobber();
+ ~CheckmarkThrobber() override;
// If checked is true, the throbber stops spinning and displays a checkmark.
// If checked is false, the throbber stops spinning and displays nothing.
@@ -122,6 +125,30 @@ class VIEWS_EXPORT CheckmarkThrobber : public Throbber {
DISALLOW_COPY_AND_ASSIGN(CheckmarkThrobber);
};
+// A throbber that follows material design guidelines. This is a specialization
+// of CheckmarkThrobber for now, but should probably replace Throbber
+// eventually.
+class VIEWS_EXPORT MaterialThrobber : public CheckmarkThrobber {
sky 2015/04/21 20:17:38 Do we need both CheckmarkThrobber and MaterialThro
Evan Stade 2015/04/21 22:04:02 Good point. I was going to roll all three into Thr
+ public:
+ MaterialThrobber();
+ ~MaterialThrobber() override;
+
+ void set_preferred_diameter(int diameter) { preferred_diameter_ = diameter; }
sky 2015/04/21 20:17:38 It's unclear exactly what diameter in this context
Evan Stade 2015/04/21 22:04:02 But size sounds like a gfx::Size. I chose diameter
+
+ // View implementation.
+ gfx::Size GetPreferredSize() const override;
+ int GetHeightForWidth(int w) const override;
+ void OnPaint(gfx::Canvas* canvas) override;
+
+ private:
+ // The preferred width and height for this view. Zero indicates the size is
+ // set by the parent class (i.e. matches the size of the pre-material
+ // sprites).
+ int preferred_diameter_;
+
+ DISALLOW_COPY_AND_ASSIGN(MaterialThrobber);
+};
+
} // namespace views
#endif // UI_VIEWS_CONTROLS_THROBBER_H_
« no previous file with comments | « chrome/browser/ui/views/autofill/card_unmask_prompt_views.cc ('k') | ui/views/controls/throbber.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698