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

Side by Side Diff: chrome/browser/chromeos/login/users/avatar/user_image_loader.cc

Issue 1747843002: Rename raw_image() to image_bytes() in UserImage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/users/avatar/user_image_manager_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/chromeos/login/users/avatar/user_image_loader.h" 5 #include "chrome/browser/chromeos/login/users/avatar/user_image_loader.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 // ImageDecoder::ImageRequest implementation. 84 // ImageDecoder::ImageRequest implementation.
85 void OnImageDecoded(const SkBitmap& decoded_image) override; 85 void OnImageDecoded(const SkBitmap& decoded_image) override;
86 void OnDecodeImageFailed() override; 86 void OnDecodeImageFailed() override;
87 87
88 // Called after the image is transformed (cropped and downsized) as needed. 88 // Called after the image is transformed (cropped and downsized) as needed.
89 void OnImageFinalized(const SkBitmap& image); 89 void OnImageFinalized(const SkBitmap& image);
90 90
91 private: 91 private:
92 const ImageInfo image_info_; 92 const ImageInfo image_info_;
93 std::vector<unsigned char> image_data_; 93 const user_manager::UserImage::Bytes image_data_;
94 scoped_refptr<base::SequencedTaskRunner> background_task_runner_; 94 scoped_refptr<base::SequencedTaskRunner> background_task_runner_;
95 95
96 // This should be the last member. 96 // This should be the last member.
97 base::WeakPtrFactory<UserImageRequest> weak_ptr_factory_; 97 base::WeakPtrFactory<UserImageRequest> weak_ptr_factory_;
98 }; 98 };
99 99
100 void UserImageRequest::OnImageDecoded(const SkBitmap& decoded_image) { 100 void UserImageRequest::OnImageDecoded(const SkBitmap& decoded_image) {
101 int target_size = image_info_.pixels_per_side; 101 int target_size = image_info_.pixels_per_side;
102 if (target_size > 0) { 102 if (target_size > 0) {
103 // Transforming an image could be expensive, hence posting to the 103 // Transforming an image could be expensive, hence posting to the
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 ImageDecoder::ImageCodec image_codec, 175 ImageDecoder::ImageCodec image_codec,
176 int pixels_per_side, 176 int pixels_per_side,
177 const LoadedCallback& loaded_cb) { 177 const LoadedCallback& loaded_cb) {
178 DecodeImage( 178 DecodeImage(
179 ImageInfo(base::FilePath(), pixels_per_side, image_codec, loaded_cb), 179 ImageInfo(base::FilePath(), pixels_per_side, image_codec, loaded_cb),
180 background_task_runner, data.get(), true /* data_is_ready */); 180 background_task_runner, data.get(), true /* data_is_ready */);
181 } 181 }
182 182
183 } // namespace user_image_loader 183 } // namespace user_image_loader
184 } // namespace chromeos 184 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/users/avatar/user_image_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698