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

Unified Diff: chrome/browser/chromeos/login/image_decoder.cc

Issue 8510069: Make ProfileImageDownloader available to non-chromeos code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix build Created 9 years, 1 month 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 | « chrome/browser/chromeos/login/image_decoder.h ('k') | chrome/browser/chromeos/login/image_downloader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/image_decoder.cc
diff --git a/chrome/browser/chromeos/login/image_decoder.cc b/chrome/browser/chromeos/login/image_decoder.cc
deleted file mode 100644
index 87671c2b17d0841c2d69108edd747cfd18ed84d5..0000000000000000000000000000000000000000
--- a/chrome/browser/chromeos/login/image_decoder.cc
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/chromeos/login/image_decoder.h"
-
-#include "base/bind.h"
-#include "chrome/browser/browser_process.h"
-#include "chrome/common/chrome_utility_messages.h"
-#include "content/public/browser/browser_thread.h"
-
-using content::BrowserThread;
-
-namespace chromeos {
-
-ImageDecoder::ImageDecoder(Delegate* delegate,
- const std::string& image_data)
- : delegate_(delegate),
- image_data_(image_data.begin(), image_data.end()),
- target_thread_id_(BrowserThread::UI) {
-}
-
-ImageDecoder::~ImageDecoder() {}
-
-void ImageDecoder::Start() {
- if (!BrowserThread::GetCurrentThreadIdentifier(&target_thread_id_)) {
- NOTREACHED();
- return;
- }
- BrowserThread::PostTask(
- BrowserThread::IO, FROM_HERE,
- base::Bind(&ImageDecoder::DecodeImageInSandbox, this, image_data_));
-}
-
-bool ImageDecoder::OnMessageReceived(const IPC::Message& message) {
- bool handled = true;
- IPC_BEGIN_MESSAGE_MAP(ImageDecoder, message)
- IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_DecodeImage_Succeeded,
- OnDecodeImageSucceeded)
- IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_DecodeImage_Failed,
- OnDecodeImageFailed)
- IPC_MESSAGE_UNHANDLED(handled = false)
- IPC_END_MESSAGE_MAP()
- return handled;
-}
-
-void ImageDecoder::OnDecodeImageSucceeded(const SkBitmap& decoded_image) {
- DCHECK(BrowserThread::CurrentlyOn(target_thread_id_));
- if (delegate_)
- delegate_->OnImageDecoded(this, decoded_image);
-}
-
-void ImageDecoder::OnDecodeImageFailed() {
- DCHECK(BrowserThread::CurrentlyOn(target_thread_id_));
- if (delegate_)
- delegate_->OnDecodeImageFailed(this);
-}
-
-void ImageDecoder::DecodeImageInSandbox(
- const std::vector<unsigned char>& image_data) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- UtilityProcessHost* utility_process_host =
- new UtilityProcessHost(this,
- target_thread_id_);
- utility_process_host->Send(new ChromeUtilityMsg_DecodeImage(image_data));
-}
-
-} // namespace chromeos
« no previous file with comments | « chrome/browser/chromeos/login/image_decoder.h ('k') | chrome/browser/chromeos/login/image_downloader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698