diff options
author | mathp <mathp@chromium.org> | 2014-10-10 14:13:00 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-10 21:13:11 +0000 |
commit | 3377c626623cb1bcb9b39d0508360a690e8d9818 (patch) | |
tree | 94e88c7ba0c8b0b67badc38238606e0b6a9f7e2d /components/suggestions | |
parent | 4e5b67dbbf81d83bdbacaf4691e1daff365addd9 (diff) | |
download | chromium_src-3377c626623cb1bcb9b39d0508360a690e8d9818.zip chromium_src-3377c626623cb1bcb9b39d0508360a690e8d9818.tar.gz chromium_src-3377c626623cb1bcb9b39d0508360a690e8d9818.tar.bz2 |
[Suggestions] Headers cleanup for iOS image encoder
BUG=None
Review URL: https://codereview.chromium.org/649793002
Cr-Commit-Position: refs/heads/master@{#299188}
Diffstat (limited to 'components/suggestions')
-rw-r--r-- | components/suggestions/BUILD.gn | 3 | ||||
-rw-r--r-- | components/suggestions/image_encoder_ios.h | 24 | ||||
-rw-r--r-- | components/suggestions/image_encoder_ios.mm | 2 | ||||
-rw-r--r-- | components/suggestions/image_manager.cc | 7 | ||||
-rw-r--r-- | components/suggestions/image_manager_unittest.cc | 7 |
5 files changed, 4 insertions, 39 deletions
diff --git a/components/suggestions/BUILD.gn b/components/suggestions/BUILD.gn index b540faf..2af25a3 100644 --- a/components/suggestions/BUILD.gn +++ b/components/suggestions/BUILD.gn @@ -6,6 +6,7 @@ static_library("suggestions") { sources = [ "blacklist_store.cc", "blacklist_store.h", + "image_encoder.h", "image_fetcher.h", "image_fetcher_delegate.h", "image_manager.cc", @@ -33,13 +34,11 @@ static_library("suggestions") { if (is_ios) { sources += [ - "image_encoder_ios.h", "image_encoder_ios.mm", ] } else { sources += [ "image_encoder.cc", - "image_encoder.h", ] } } diff --git a/components/suggestions/image_encoder_ios.h b/components/suggestions/image_encoder_ios.h deleted file mode 100644 index 50741ac..0000000 --- a/components/suggestions/image_encoder_ios.h +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef COMPONENTS_SUGGESTIONS_IMAGE_ENCODER_IOS_H_ -#define COMPONENTS_SUGGESTIONS_IMAGE_ENCODER_IOS_H_ - -#include <vector> - -class SkBitmap; - -namespace suggestions { - -// From encoded bytes to SkBitmap. It's the caller's responsibility to delete -// the bitmap. -SkBitmap* DecodeJPEGToSkBitmap(const std::vector<unsigned char>& encoded_data); - -// From SkBitmap to a vector of JPEG-encoded bytes, |dst|. -bool EncodeSkBitmapToJPEG(const SkBitmap& bitmap, - std::vector<unsigned char>* dest); - -} // namespace suggestions - -#endif // COMPONENTS_SUGGESTIONS_IMAGE_ENCODER_IOS_H_ diff --git a/components/suggestions/image_encoder_ios.mm b/components/suggestions/image_encoder_ios.mm index 5e8733b..e81fb30 100644 --- a/components/suggestions/image_encoder_ios.mm +++ b/components/suggestions/image_encoder_ios.mm @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/suggestions/image_encoder_ios.h" +#include "components/suggestions/image_encoder.h" #import <UIKit/UIKit.h> diff --git a/components/suggestions/image_manager.cc b/components/suggestions/image_manager.cc index 5309e0b..6e29ddb 100644 --- a/components/suggestions/image_manager.cc +++ b/components/suggestions/image_manager.cc @@ -5,13 +5,8 @@ #include "components/suggestions/image_manager.h" #include "base/bind.h" -#include "components/suggestions/image_fetcher.h" - -#if defined(OS_IOS) -#include "components/suggestions/image_encoder_ios.h" -#else #include "components/suggestions/image_encoder.h" -#endif +#include "components/suggestions/image_fetcher.h" using leveldb_proto::ProtoDatabase; diff --git a/components/suggestions/image_manager_unittest.cc b/components/suggestions/image_manager_unittest.cc index e0f67a2..525160b 100644 --- a/components/suggestions/image_manager_unittest.cc +++ b/components/suggestions/image_manager_unittest.cc @@ -8,6 +8,7 @@ #include "base/run_loop.h" #include "components/leveldb_proto/proto_database.h" #include "components/leveldb_proto/testing/fake_db.h" +#include "components/suggestions/image_encoder.h" #include "components/suggestions/image_fetcher.h" #include "components/suggestions/image_fetcher_delegate.h" #include "components/suggestions/image_manager.h" @@ -17,12 +18,6 @@ #include "ui/gfx/image/image_skia.h" #include "url/gurl.h" -#if defined(OS_IOS) -#include "components/suggestions/image_encoder_ios.h" -#else -#include "components/suggestions/image_encoder.h" -#endif - using ::testing::Return; using ::testing::StrictMock; using ::testing::_; |