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

Unified Diff: components/user_manager/avatar/user_image.cc

Issue 376193002: Move UserImage to user_manager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add ui/gfx dep Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: components/user_manager/avatar/user_image.cc
diff --git a/chrome/browser/chromeos/login/users/avatar/user_image.cc b/components/user_manager/avatar/user_image.cc
similarity index 84%
rename from chrome/browser/chromeos/login/users/avatar/user_image.cc
rename to components/user_manager/avatar/user_image.cc
index 4613238434df2ff0bc1bac4e17841895d2b036df..0b6aea910401c3149bbab5637a0cadb19878a792 100644
--- a/chrome/browser/chromeos/login/users/avatar/user_image.cc
+++ b/components/user_manager/avatar/user_image.cc
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/chromeos/login/users/avatar/user_image.h"
+#include "components/user_manager/avatar/user_image.h"
#include "base/debug/trace_event.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/codec/jpeg_codec.h"
-namespace chromeos {
+namespace user_manager {
namespace {
@@ -28,8 +28,12 @@ bool IsAnimatedImage(const UserImage::RawImage& data) {
bool EncodeImageSkia(const gfx::ImageSkia& image,
std::vector<unsigned char>* output) {
- TRACE_EVENT2("oobe", "EncodeImageSkia",
- "width", image.width(), "height", image.height());
+ TRACE_EVENT2("oobe",
+ "EncodeImageSkia",
+ "width",
+ image.width(),
+ "height",
+ image.height());
if (image.isNull())
return false;
const SkBitmap& bitmap = *image.bitmap();
@@ -40,7 +44,8 @@ bool EncodeImageSkia(const gfx::ImageSkia& image,
bitmap.width(),
bitmap.height(),
bitmap.width() * bitmap.bytesPerPixel(),
- kDefaultEncodingQuality, output);
+ kDefaultEncodingQuality,
+ output);
}
} // namespace
@@ -69,8 +74,7 @@ UserImage::UserImage(const gfx::ImageSkia& image)
is_safe_format_(false) {
}
-UserImage::UserImage(const gfx::ImageSkia& image,
- const RawImage& raw_image)
+UserImage::UserImage(const gfx::ImageSkia& image, const RawImage& raw_image)
: image_(image),
has_raw_image_(false),
has_animated_image_(false),
@@ -88,7 +92,8 @@ UserImage::UserImage(const gfx::ImageSkia& image,
}
}
-UserImage::~UserImage() {}
+UserImage::~UserImage() {
+}
void UserImage::DiscardRawImage() {
RawImage().swap(raw_image_); // Clear |raw_image_|.
@@ -98,4 +103,4 @@ void UserImage::MarkAsSafe() {
is_safe_format_ = true;
}
-} // namespace chromeos
+} // namespace user_manager
« components/user_manager/avatar/user_image.h ('K') | « components/user_manager/avatar/user_image.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698