| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/strings/string_split.h" | 9 #include "base/strings/string_split.h" |
| 10 #include "chrome/browser/chromeos/login/users/default_user_image/default_user_im
ages.h" | 10 #include "chrome/browser/chromeos/login/users/default_user_image/default_user_im
ages.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( | 59 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( |
| 60 IDR_PROFILE_PICTURE_LOADING, ui::SCALE_FACTOR_100P); | 60 IDR_PROFILE_PICTURE_LOADING, ui::SCALE_FACTOR_100P); |
| 61 } | 61 } |
| 62 if (user->HasDefaultImage()) { | 62 if (user->HasDefaultImage()) { |
| 63 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( | 63 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( |
| 64 chromeos::default_user_image::kDefaultImageResourceIDs | 64 chromeos::default_user_image::kDefaultImageResourceIDs |
| 65 [user->image_index()], | 65 [user->image_index()], |
| 66 ui::SCALE_FACTOR_100P); | 66 ui::SCALE_FACTOR_100P); |
| 67 } | 67 } |
| 68 NOTREACHED() << "User with custom image missing data bytes"; | 68 NOTREACHED() << "User with custom image missing data bytes"; |
| 69 } else { |
| 70 LOG(ERROR) << "User not found: " << account_id.GetUserEmail(); |
| 69 } | 71 } |
| 70 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( | 72 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( |
| 71 IDR_LOGIN_DEFAULT_USER, ui::SCALE_FACTOR_100P); | 73 IDR_LOGIN_DEFAULT_USER, ui::SCALE_FACTOR_100P); |
| 72 } | 74 } |
| 73 | 75 |
| 74 } // namespace | 76 } // namespace |
| 75 | 77 |
| 76 namespace chromeos { | 78 namespace chromeos { |
| 77 namespace options { | 79 namespace options { |
| 78 | 80 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 103 } | 105 } |
| 104 | 106 |
| 105 std::string UserImageSource::GetMimeType(const std::string& path) const { | 107 std::string UserImageSource::GetMimeType(const std::string& path) const { |
| 106 // We need to explicitly return a mime type, otherwise if the user tries to | 108 // We need to explicitly return a mime type, otherwise if the user tries to |
| 107 // drag the image they get no extension. | 109 // drag the image they get no extension. |
| 108 return "image/png"; | 110 return "image/png"; |
| 109 } | 111 } |
| 110 | 112 |
| 111 } // namespace options | 113 } // namespace options |
| 112 } // namespace chromeos | 114 } // namespace chromeos |
| OLD | NEW |