OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #import "ios/chrome/browser/content_suggestions/content_suggestions_mediator.h" | 5 #import "ios/chrome/browser/content_suggestions/content_suggestions_mediator.h" |
6 | 6 |
7 #include "base/mac/bind_objc_block.h" | 7 #include "base/mac/bind_objc_block.h" |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "base/optional.h" | 9 #include "base/optional.h" |
10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
11 #include "components/ntp_snippets/category.h" | 11 #include "components/ntp_snippets/category.h" |
12 #include "components/ntp_snippets/category_info.h" | 12 #include "components/ntp_snippets/category_info.h" |
13 #include "components/ntp_snippets/content_suggestion.h" | 13 #include "components/ntp_snippets/content_suggestion.h" |
14 #import "ios/chrome/browser/content_suggestions/content_suggestions_category_wra
pper.h" | 14 #import "ios/chrome/browser/content_suggestions/content_suggestions_category_wra
pper.h" |
15 #import "ios/chrome/browser/content_suggestions/content_suggestions_service_brid
ge_observer.h" | 15 #import "ios/chrome/browser/content_suggestions/content_suggestions_service_brid
ge_observer.h" |
16 #import "ios/chrome/browser/ui/content_suggestions/content_suggestion.h" | 16 #import "ios/chrome/browser/ui/content_suggestions/content_suggestion.h" |
17 #import "ios/chrome/browser/ui/content_suggestions/content_suggestion_identifier
.h" | |
18 #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_data_sink
.h" | 17 #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_data_sink
.h" |
19 #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_image_fet
cher.h" | 18 #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_image_fet
cher.h" |
20 #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_section_i
nformation.h" | 19 #import "ios/chrome/browser/ui/content_suggestions/identifier/content_suggestion
_identifier.h" |
| 20 #import "ios/chrome/browser/ui/content_suggestions/identifier/content_suggestion
s_section_information.h" |
21 #include "ios/chrome/grit/ios_strings.h" | 21 #include "ios/chrome/grit/ios_strings.h" |
22 #include "ui/base/l10n/l10n_util_mac.h" | 22 #include "ui/base/l10n/l10n_util_mac.h" |
23 #include "ui/gfx/image/image.h" | 23 #include "ui/gfx/image/image.h" |
24 | 24 |
25 #if !defined(__has_feature) || !__has_feature(objc_arc) | 25 #if !defined(__has_feature) || !__has_feature(objc_arc) |
26 #error "This file requires ARC support." | 26 #error "This file requires ARC support." |
27 #endif | 27 #endif |
28 | 28 |
29 namespace { | 29 namespace { |
30 | 30 |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 [NSMutableArray array]; | 367 [NSMutableArray array]; |
368 ntp_snippets::Category category = suggestions[0].id().category(); | 368 ntp_snippets::Category category = suggestions[0].id().category(); |
369 [self addSuggestions:suggestions | 369 [self addSuggestions:suggestions |
370 fromCategory:category | 370 fromCategory:category |
371 toArray:contentSuggestions]; | 371 toArray:contentSuggestions]; |
372 callback(contentSuggestions); | 372 callback(contentSuggestions); |
373 } | 373 } |
374 } | 374 } |
375 | 375 |
376 @end | 376 @end |
OLD | NEW |