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

Unified Diff: ui/gfx/paint_vector_icon.cc

Issue 2143863004: Use vector assets for media router icons. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix icon offsets Created 4 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
Index: ui/gfx/paint_vector_icon.cc
diff --git a/ui/gfx/paint_vector_icon.cc b/ui/gfx/paint_vector_icon.cc
index c6a2620d71cffbd05579324234772f50aeae9d68..24543f59b515c51a16794adf866941e24205ba3b 100644
--- a/ui/gfx/paint_vector_icon.cc
+++ b/ui/gfx/paint_vector_icon.cc
@@ -57,7 +57,7 @@ CommandType CommandFromString(const std::string& source) {
RETURN_IF_IS(END);
#undef RETURN_IF_IS
- NOTREACHED();
+ NOTREACHED() << "Unrecognized command: " << source;
return CLOSE;
}
@@ -67,8 +67,11 @@ std::vector<PathElement> PathFromSource(const std::string& source) {
source, "\n ,f", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
for (const auto& piece : pieces) {
double value;
+ int hex_value;
msw 2016/07/14 20:57:02 nit: init to 0; ditto above.
if (base::StringToDouble(piece, &value))
path.push_back(PathElement(SkDoubleToScalar(value)));
+ else if (base::HexStringToInt(piece, &hex_value))
+ path.push_back(PathElement(SkIntToScalar(hex_value)));
else
path.push_back(PathElement(CommandFromString(piece)));
}
« no previous file with comments | « chrome/browser/ui/toolbar/media_router_action_unittest.cc ('k') | ui/gfx/vector_icons/media_router_active.icon » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698