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

Unified Diff: components/image_fetcher/content/image_decoder_impl.cc

Issue 2763103002: Move ImageDecoder to components/image_fetcher/content (Closed)
Patch Set: Rebased. Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/image_fetcher/content/image_decoder_impl.h ('k') | components/image_fetcher/core/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/image_fetcher/content/image_decoder_impl.cc
diff --git a/chrome/browser/search/suggestions/image_decoder_impl.cc b/components/image_fetcher/content/image_decoder_impl.cc
similarity index 81%
rename from chrome/browser/search/suggestions/image_decoder_impl.cc
rename to components/image_fetcher/content/image_decoder_impl.cc
index c8ae236f93324539f4848222c30c49d2f53f4522..d33306e6bd1dd61cab337446e27d0f03e6abf2f1 100644
--- a/chrome/browser/search/suggestions/image_decoder_impl.cc
+++ b/components/image_fetcher/content/image_decoder_impl.cc
@@ -2,22 +2,24 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "components/image_fetcher/content/image_decoder_impl.h"
+
#include <algorithm>
+#include <utility>
#include <vector>
#include "base/callback.h"
-#include "chrome/browser/search/suggestions/image_decoder_impl.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/image/image.h"
-namespace suggestions {
+namespace image_fetcher {
// A request for decoding an image.
class ImageDecoderImpl::DecodeImageRequest
: public ::ImageDecoder::ImageRequest {
public:
DecodeImageRequest(ImageDecoderImpl* decoder,
- const image_fetcher::ImageDecodedCallback& callback)
+ const ImageDecodedCallback& callback)
: decoder_(decoder), callback_(callback) {}
~DecodeImageRequest() override {}
@@ -34,7 +36,7 @@ class ImageDecoderImpl::DecodeImageRequest
ImageDecoderImpl* decoder_;
// The callback to call after the request completed.
- image_fetcher::ImageDecodedCallback callback_;
+ ImageDecodedCallback callback_;
DISALLOW_COPY_AND_ASSIGN(DecodeImageRequest);
};
@@ -60,14 +62,13 @@ void ImageDecoderImpl::DecodeImageRequest::RunCallbackAndRemoveRequest(
decoder_->RemoveDecodeImageRequest(this);
}
-ImageDecoderImpl::ImageDecoderImpl() {}
+ImageDecoderImpl::ImageDecoderImpl() {}
ImageDecoderImpl::~ImageDecoderImpl() {}
-void ImageDecoderImpl::DecodeImage(
- const std::string& image_data,
- const gfx::Size& desired_image_frame_size,
- const image_fetcher::ImageDecodedCallback& callback) {
+void ImageDecoderImpl::DecodeImage(const std::string& image_data,
+ const gfx::Size& desired_image_frame_size,
+ const ImageDecodedCallback& callback) {
std::unique_ptr<DecodeImageRequest> decode_image_request(
new DecodeImageRequest(this, callback));
@@ -83,8 +84,7 @@ void ImageDecoderImpl::DecodeImage(
void ImageDecoderImpl::RemoveDecodeImageRequest(DecodeImageRequest* request) {
// Remove the finished request from the request queue.
auto request_it =
- std::find_if(decode_image_requests_.begin(),
- decode_image_requests_.end(),
+ std::find_if(decode_image_requests_.begin(), decode_image_requests_.end(),
[request](const std::unique_ptr<DecodeImageRequest>& r) {
return r.get() == request;
});
@@ -92,4 +92,4 @@ void ImageDecoderImpl::RemoveDecodeImageRequest(DecodeImageRequest* request) {
decode_image_requests_.erase(request_it);
}
-} // namespace suggestions
+} // namespace image_fetcher
« no previous file with comments | « components/image_fetcher/content/image_decoder_impl.h ('k') | components/image_fetcher/core/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698