OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_IMAGE_DECODER_H_ | 5 #ifndef CHROME_BROWSER_GAIA_USERINFO_IMAGE_DECODER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_IMAGE_DECODER_H_ | 6 #define CHROME_BROWSER_GAIA_USERINFO_IMAGE_DECODER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "content/browser/utility_process_host.h" | 12 #include "content/browser/utility_process_host.h" |
13 | 13 |
14 class SkBitmap; | 14 class SkBitmap; |
15 | 15 |
16 namespace chromeos { | |
17 | |
18 // Decodes an image in a sandboxed process. | 16 // Decodes an image in a sandboxed process. |
19 class ImageDecoder : public UtilityProcessHost::Client { | 17 class ImageDecoder : public UtilityProcessHost::Client { |
20 public: | 18 public: |
21 class Delegate { | 19 class Delegate { |
22 public: | 20 public: |
23 // Called when image is decoded. | 21 // Called when image is decoded. |
24 // |decoder| is used to identify the image in case of decoding several | 22 // |decoder| is used to identify the image in case of decoding several |
25 // images simultaneously. | 23 // images simultaneously. |
26 virtual void OnImageDecoded(const ImageDecoder* decoder, | 24 virtual void OnImageDecoded(const ImageDecoder* decoder, |
27 const SkBitmap& decoded_image) = 0; | 25 const SkBitmap& decoded_image) = 0; |
(...skipping 26 matching lines...) Expand all Loading... |
54 // Launches sandboxed process that will decode the image. | 52 // Launches sandboxed process that will decode the image. |
55 void DecodeImageInSandbox(const std::vector<unsigned char>& image_data); | 53 void DecodeImageInSandbox(const std::vector<unsigned char>& image_data); |
56 | 54 |
57 Delegate* delegate_; | 55 Delegate* delegate_; |
58 std::vector<unsigned char> image_data_; | 56 std::vector<unsigned char> image_data_; |
59 content::BrowserThread::ID target_thread_id_; | 57 content::BrowserThread::ID target_thread_id_; |
60 | 58 |
61 DISALLOW_COPY_AND_ASSIGN(ImageDecoder); | 59 DISALLOW_COPY_AND_ASSIGN(ImageDecoder); |
62 }; | 60 }; |
63 | 61 |
64 } // namespace chromeos | 62 #endif // CHROME_BROWSER_GAIA_USERINFO_IMAGE_DECODER_H_ |
65 | |
66 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_IMAGE_DECODER_H_ | |
OLD | NEW |