Commit 3377c626 authored by mathp's avatar mathp Committed by Commit bot

[Suggestions] Headers cleanup for iOS image encoder

BUG=None

Review URL: https://codereview.chromium.org/649793002

Cr-Commit-Position: refs/heads/master@{#299188}
parent 4e5b67db
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
'sources': [ 'sources': [
'suggestions/blacklist_store.cc', 'suggestions/blacklist_store.cc',
'suggestions/blacklist_store.h', 'suggestions/blacklist_store.h',
'suggestions/image_encoder.h',
'suggestions/image_fetcher.h', 'suggestions/image_fetcher.h',
'suggestions/image_fetcher_delegate.h', 'suggestions/image_fetcher_delegate.h',
'suggestions/image_manager.cc', 'suggestions/image_manager.cc',
...@@ -46,13 +47,11 @@ ...@@ -46,13 +47,11 @@
'conditions': [ 'conditions': [
['OS == "ios"', { ['OS == "ios"', {
'sources': [ 'sources': [
'suggestions/image_encoder_ios.h',
'suggestions/image_encoder_ios.mm', 'suggestions/image_encoder_ios.mm',
] ]
}, { # 'OS != "ios"' }, { # 'OS != "ios"'
'sources': [ 'sources': [
'suggestions/image_encoder.cc', 'suggestions/image_encoder.cc',
'suggestions/image_encoder.h',
] ]
} }
]] ]]
......
...@@ -6,6 +6,7 @@ static_library("suggestions") { ...@@ -6,6 +6,7 @@ static_library("suggestions") {
sources = [ sources = [
"blacklist_store.cc", "blacklist_store.cc",
"blacklist_store.h", "blacklist_store.h",
"image_encoder.h",
"image_fetcher.h", "image_fetcher.h",
"image_fetcher_delegate.h", "image_fetcher_delegate.h",
"image_manager.cc", "image_manager.cc",
...@@ -33,13 +34,11 @@ static_library("suggestions") { ...@@ -33,13 +34,11 @@ static_library("suggestions") {
if (is_ios) { if (is_ios) {
sources += [ sources += [
"image_encoder_ios.h",
"image_encoder_ios.mm", "image_encoder_ios.mm",
] ]
} else { } else {
sources += [ sources += [
"image_encoder.cc", "image_encoder.cc",
"image_encoder.h",
] ]
} }
} }
// 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_
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "components/suggestions/image_encoder_ios.h" #include "components/suggestions/image_encoder.h"
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
......
...@@ -5,13 +5,8 @@ ...@@ -5,13 +5,8 @@
#include "components/suggestions/image_manager.h" #include "components/suggestions/image_manager.h"
#include "base/bind.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" #include "components/suggestions/image_encoder.h"
#endif #include "components/suggestions/image_fetcher.h"
using leveldb_proto::ProtoDatabase; using leveldb_proto::ProtoDatabase;
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "base/run_loop.h" #include "base/run_loop.h"
#include "components/leveldb_proto/proto_database.h" #include "components/leveldb_proto/proto_database.h"
#include "components/leveldb_proto/testing/fake_db.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.h"
#include "components/suggestions/image_fetcher_delegate.h" #include "components/suggestions/image_fetcher_delegate.h"
#include "components/suggestions/image_manager.h" #include "components/suggestions/image_manager.h"
...@@ -17,12 +18,6 @@ ...@@ -17,12 +18,6 @@
#include "ui/gfx/image/image_skia.h" #include "ui/gfx/image/image_skia.h"
#include "url/gurl.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::Return;
using ::testing::StrictMock; using ::testing::StrictMock;
using ::testing::_; using ::testing::_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment