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

Unified Diff: ui/views/examples/vector_example.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
« no previous file with comments | « ui/gfx/vector_icons_sources.gypi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/examples/vector_example.cc
diff --git a/ui/views/examples/vector_example.cc b/ui/views/examples/vector_example.cc
index 94f897295641c18c34a49a46908d11ddee331dfd..f0ee3db7344c1428f73e138536b1638ed41caf81 100644
--- a/ui/views/examples/vector_example.cc
+++ b/ui/views/examples/vector_example.cc
@@ -128,6 +128,12 @@ class VectorIconGallery : public View,
base::FilePath path(file_chooser_->text());
#endif
base::ReadFileToString(path, &contents);
+ // Skip over comments.
+ for (size_t slashes = contents.find("//"); slashes != std::string::npos;
+ slashes = contents.find("//")) {
+ size_t eol = contents.find("\n", slashes);
+ contents.erase(slashes, eol - slashes);
+ }
image_view_->SetImage(
gfx::CreateVectorIconFromSource(contents, size_, color_));
}
« no previous file with comments | « ui/gfx/vector_icons_sources.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698