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

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: init to zero 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..5db76e25af63cf5749df5c0ee6eda37b6c17f025 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;
}
@@ -66,9 +66,12 @@ std::vector<PathElement> PathFromSource(const std::string& source) {
std::vector<std::string> pieces = base::SplitString(
source, "\n ,f", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
for (const auto& piece : pieces) {
- double value;
+ double value = 0;
+ int hex_value = 0;
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