#include "chrome/browser/icon_transcoder/svg_icon_transcoder.h"
#include "base/base64.h"
#include "base/files/file_util.h"
#include "base/task/thread_pool.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/web_contents.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/codec/png_codec.h"
namespace apps {
namespace {
constexpr char kSvgDataUrlPrefix[] = …;
std::string ReadSvgOnFileThread(base::FilePath svg_path) { … }
void SaveIconOnFileThread(const base::FilePath& icon_path,
const std::string& content) { … }
}
SvgIconTranscoder::SvgIconTranscoder(content::BrowserContext* context)
: … { … }
SvgIconTranscoder::~SvgIconTranscoder() { … }
void SvgIconTranscoder::Transcode(const base::FilePath&& svg_path,
const base::FilePath&& png_path,
gfx::Size preferred_size,
IconContentCallback callback) { … }
void SvgIconTranscoder::Transcode(const std::string& svg_data,
const base::FilePath&& png_path,
gfx::Size preferred_size,
IconContentCallback callback) { … }
void SvgIconTranscoder::MaybeCreateWebContents() { … }
bool SvgIconTranscoder::PrepareWebContents() { … }
void SvgIconTranscoder::RenderProcessReady(content::RenderProcessHost* host) { … }
void SvgIconTranscoder::RenderProcessExited(
content::RenderProcessHost* host,
const content::ChildProcessTerminationInfo& info) { … }
void SvgIconTranscoder::RemoveObserver() { … }
void SvgIconTranscoder::OnDownloadImage(base::FilePath png_path,
IconContentCallback callback,
int id,
int http_status_code,
const GURL& image_url,
const std::vector<SkBitmap>& bitmaps,
const std::vector<gfx::Size>& sizes) { … }
}