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 #include "chrome/browser/ui/webui/options/chromeos/user_image_source.h" | 5 #include "chrome/browser/ui/webui/options/chromeos/user_image_source.h" |
6 | 6 |
7 #include "base/memory/ref_counted_memory.h" | 7 #include "base/memory/ref_counted_memory.h" |
| 8 #include "base/message_loop.h" |
8 #include "chrome/browser/chromeos/login/user_manager.h" | 9 #include "chrome/browser/chromeos/login/user_manager.h" |
9 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
10 #include "grit/theme_resources.h" | 11 #include "grit/theme_resources.h" |
11 #include "ui/base/resource/resource_bundle.h" | 12 #include "ui/base/resource/resource_bundle.h" |
12 #include "ui/gfx/codec/png_codec.h" | 13 #include "ui/gfx/codec/png_codec.h" |
13 | 14 |
14 namespace chromeos { | 15 namespace chromeos { |
15 | 16 |
16 std::vector<unsigned char> UserImageSource::GetUserImage( | 17 std::vector<unsigned char> UserImageSource::GetUserImage( |
17 const std::string& email) const { | 18 const std::string& email) const { |
(...skipping 26 matching lines...) Expand all Loading... |
44 SendResponse(request_id, new RefCountedBytes(GetUserImage(email))); | 45 SendResponse(request_id, new RefCountedBytes(GetUserImage(email))); |
45 } | 46 } |
46 | 47 |
47 std::string UserImageSource::GetMimeType(const std::string&) const { | 48 std::string UserImageSource::GetMimeType(const std::string&) const { |
48 // We need to explicitly return a mime type, otherwise if the user tries to | 49 // We need to explicitly return a mime type, otherwise if the user tries to |
49 // drag the image they get no extension. | 50 // drag the image they get no extension. |
50 return "image/png"; | 51 return "image/png"; |
51 } | 52 } |
52 | 53 |
53 } // namespace chromeos | 54 } // namespace chromeos |
OLD | NEW |