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

Side by Side Diff: chrome/browser/chromeos/login/image_decoder.cc

Issue 2729020: Show Captcha dialog. (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: remove debug line Created 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/chromeos/login/image_decoder.h"
6
7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/chrome_thread.h"
9
10 namespace chromeos {
11
12 ImageDecoder::ImageDecoder(Delegate* delegate,
13 const std::vector<unsigned char>& image_data)
14 : delegate_(delegate),
15 image_data_(image_data) {
16 }
17
18 void ImageDecoder::Start() {
19 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
20 ChromeThread::PostTask(
21 ChromeThread::IO, FROM_HERE,
22 NewRunnableMethod(
23 this, &ImageDecoder::DecodeImageInSandbox,
24 g_browser_process->resource_dispatcher_host(),
25 image_data_));
26 }
27
28 void ImageDecoder::OnDecodeImageSucceeded(const SkBitmap& decoded_image) {
29 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
30 if (delegate_)
31 delegate_->OnImageDecoded(decoded_image);
32 }
33
34 void ImageDecoder::DecodeImageInSandbox(
35 ResourceDispatcherHost* rdh,
36 const std::vector<unsigned char>& image_data) {
37 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
38 UtilityProcessHost* utility_process_host =
39 new UtilityProcessHost(rdh,
40 this,
41 ChromeThread::UI);
42 utility_process_host->StartImageDecoding(image_data);
43 }
44
45 } // namespace chromeos
46
OLDNEW
« 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