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

Unified Diff: printing/image.cc

Issue 2850042: Deprecate more old filepath functions. (Closed)
Patch Set: rebase Created 10 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: printing/image.cc
diff --git a/printing/image.cc b/printing/image.cc
index d12d3d602b2fa818422c8163d8f187f48777ea95..77f5d5ef610d0e6495c0c5f21e2d7fe24ad5acd0 100644
--- a/printing/image.cc
+++ b/printing/image.cc
@@ -60,16 +60,15 @@ class DisableFontSmoothing {
namespace printing {
-Image::Image(const std::wstring& filename)
+Image::Image(const FilePath& path)
: row_length_(0),
ignore_alpha_(true) {
std::string data;
- file_util::ReadFileToString(filename, &data);
- std::wstring ext = file_util::GetFileExtensionFromPath(filename);
+ file_util::ReadFileToString(path, &data);
bool success = false;
- if (LowerCaseEqualsASCII(ext, "png")) {
+ if (path.MatchesExtension(FILE_PATH_LITERAL(".png"))) {
success = LoadPng(data);
- } else if (LowerCaseEqualsASCII(ext, "emf")) {
+ } else if (path.MatchesExtension(FILE_PATH_LITERAL(".emf"))) {
success = LoadMetafile(data);
} else {
DCHECK(false);

Powered by Google App Engine
This is Rietveld 408576698