| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "components/ntp_snippets/sessions/foreign_sessions_suggestions_provider
.h" | 5 #include "components/ntp_snippets/sessions/foreign_sessions_suggestions_provider
.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <tuple> | 9 #include <tuple> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 return category_status_; | 114 return category_status_; |
| 115 } | 115 } |
| 116 | 116 |
| 117 CategoryInfo ForeignSessionsSuggestionsProvider::GetCategoryInfo( | 117 CategoryInfo ForeignSessionsSuggestionsProvider::GetCategoryInfo( |
| 118 Category category) { | 118 Category category) { |
| 119 DCHECK_EQ(category, provided_category_); | 119 DCHECK_EQ(category, provided_category_); |
| 120 return CategoryInfo( | 120 return CategoryInfo( |
| 121 l10n_util::GetStringUTF16( | 121 l10n_util::GetStringUTF16( |
| 122 IDS_NTP_FOREIGN_SESSIONS_SUGGESTIONS_SECTION_HEADER), | 122 IDS_NTP_FOREIGN_SESSIONS_SUGGESTIONS_SECTION_HEADER), |
| 123 ContentSuggestionsCardLayout::MINIMAL_CARD, | 123 ContentSuggestionsCardLayout::MINIMAL_CARD, |
| 124 /*has_more_button=*/true, | 124 /*has_more_action=*/false, |
| 125 /*has_reload_action=*/false, |
| 126 /*has_view_all_action=*/true, |
| 125 /*show_if_empty=*/false, | 127 /*show_if_empty=*/false, |
| 126 l10n_util::GetStringUTF16(IDS_NTP_SUGGESTIONS_SECTION_EMPTY)); | 128 l10n_util::GetStringUTF16(IDS_NTP_SUGGESTIONS_SECTION_EMPTY)); |
| 127 // TODO(skym): Replace IDS_NTP_SUGGESTIONS_SECTION_EMPTY with a | 129 // TODO(skym): Replace IDS_NTP_SUGGESTIONS_SECTION_EMPTY with a |
| 128 // category-specific string. | 130 // category-specific string. |
| 129 } | 131 } |
| 130 | 132 |
| 131 void ForeignSessionsSuggestionsProvider::DismissSuggestion( | 133 void ForeignSessionsSuggestionsProvider::DismissSuggestion( |
| 132 const ContentSuggestion::ID& suggestion_id) { | 134 const ContentSuggestion::ID& suggestion_id) { |
| 133 // TODO(skym): Right now this continuously grows, without clearing out old and | 135 // TODO(skym): Right now this continuously grows, without clearing out old and |
| 134 // irrelevant entries. Could either use a timestamp and expire after a | 136 // irrelevant entries. Could either use a timestamp and expire after a |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 // This field is sandwiched between the url's favicon, which is on the left, | 311 // This field is sandwiched between the url's favicon, which is on the left, |
| 310 // and the |publish_date|, which is to the right. The domain should always | 312 // and the |publish_date|, which is to the right. The domain should always |
| 311 // appear next to the favicon. | 313 // appear next to the favicon. |
| 312 suggestion.set_publisher_name( | 314 suggestion.set_publisher_name( |
| 313 base::UTF8ToUTF16(data.navigation->virtual_url().host() + " - " + | 315 base::UTF8ToUTF16(data.navigation->virtual_url().host() + " - " + |
| 314 data.session->session_name)); | 316 data.session->session_name)); |
| 315 return suggestion; | 317 return suggestion; |
| 316 } | 318 } |
| 317 | 319 |
| 318 } // namespace ntp_snippets | 320 } // namespace ntp_snippets |
| OLD | NEW |