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

Unified Diff: printing/image.cc

Issue 2066843002: printing::Image: remove unused constructor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « printing/image.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: printing/image.cc
diff --git a/printing/image.cc b/printing/image.cc
index a0376bb048c6e79061cd34ec67755d82e6eaa894..37c4ceda8518a2af843f4438dd9fc8db29faed9c 100644
--- a/printing/image.cc
+++ b/printing/image.cc
@@ -13,32 +13,11 @@
#include "base/numerics/safe_conversions.h"
#include "base/strings/string_number_conversions.h"
#include "printing/metafile.h"
-#include "printing/pdf_metafile_skia.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/gfx/codec/png_codec.h"
namespace printing {
-Image::Image(const base::FilePath& path)
- : row_length_(0),
- ignore_alpha_(true) {
- std::string data;
- base::ReadFileToString(path, &data);
- bool success = false;
- if (path.MatchesExtension(FILE_PATH_LITERAL(".png"))) {
- success = LoadPng(data);
- } else if (path.MatchesExtension(FILE_PATH_LITERAL(".emf"))) {
- success = LoadMetafile(data);
- } else {
- DCHECK(false);
- }
- if (!success) {
- size_.SetSize(0, 0);
- row_length_ = 0;
- data_.clear();
- }
-}
-
Image::Image(const Metafile& metafile)
: row_length_(0),
ignore_alpha_(true) {
@@ -150,13 +129,4 @@ bool Image::LoadPng(const std::string& compressed) {
return success;
}
-bool Image::LoadMetafile(const std::string& data) {
- DCHECK(!data.empty());
- PdfMetafileSkia metafile;
- if (!metafile.InitFromData(data.data(),
- base::checked_cast<uint32_t>(data.size())))
- return false;
- return LoadMetafile(metafile);
-}
-
} // namespace printing
« no previous file with comments | « printing/image.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698