Chromium Code Reviews| 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/bookmarks/bookmark_suggestions_provider.h" | 5 #include "components/ntp_snippets/bookmarks/bookmark_suggestions_provider.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 57 | 57 |
| 58 std::vector<Category> BookmarkSuggestionsProvider::GetProvidedCategories() { | 58 std::vector<Category> BookmarkSuggestionsProvider::GetProvidedCategories() { |
| 59 return std::vector<Category>({provided_category_}); | 59 return std::vector<Category>({provided_category_}); |
| 60 } | 60 } |
| 61 | 61 |
| 62 CategoryStatus BookmarkSuggestionsProvider::GetCategoryStatus( | 62 CategoryStatus BookmarkSuggestionsProvider::GetCategoryStatus( |
| 63 Category category) { | 63 Category category) { |
| 64 return category_status_; | 64 return category_status_; |
| 65 } | 65 } |
| 66 | 66 |
| 67 CategoryInfo BookmarkSuggestionsProvider::GetCategoryInfo(Category category) { | |
| 68 // TODO(pke): Use the proper string once it's agreed on. | |
| 69 return CategoryInfo(base::ASCIIToUTF16("Recent bookmarks"), | |
|
Bernhard Bauer
2016/08/09 10:25:41
I think you could already now use a localized stri
Philipp Keck
2016/08/09 12:26:58
Done.
| |
| 70 ContentSuggestionsCardLayout::MINIMAL_CARD); | |
| 71 } | |
| 72 | |
| 67 void BookmarkSuggestionsProvider::DismissSuggestion( | 73 void BookmarkSuggestionsProvider::DismissSuggestion( |
| 68 const std::string& suggestion_id) { | 74 const std::string& suggestion_id) { |
| 69 // TODO(jkrcal): Implement blacklisting bookmarks until they are next visited. | 75 // TODO(jkrcal): Implement blacklisting bookmarks until they are next visited. |
| 70 // Then also implement ClearDismissedSuggestionsForDebugging. | 76 // Then also implement ClearDismissedSuggestionsForDebugging. |
| 71 } | 77 } |
| 72 | 78 |
| 73 void BookmarkSuggestionsProvider::FetchSuggestionImage( | 79 void BookmarkSuggestionsProvider::FetchSuggestionImage( |
| 74 const std::string& suggestion_id, | 80 const std::string& suggestion_id, |
| 75 const ImageFetchedCallback& callback) { | 81 const ImageFetchedCallback& callback) { |
| 76 base::ThreadTaskRunnerHandle::Get()->PostTask( | 82 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 154 | 160 |
| 155 void BookmarkSuggestionsProvider::NotifyStatusChanged( | 161 void BookmarkSuggestionsProvider::NotifyStatusChanged( |
| 156 CategoryStatus new_status) { | 162 CategoryStatus new_status) { |
| 157 if (category_status_ == new_status) | 163 if (category_status_ == new_status) |
| 158 return; | 164 return; |
| 159 category_status_ = new_status; | 165 category_status_ = new_status; |
| 160 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); | 166 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); |
| 161 } | 167 } |
| 162 | 168 |
| 163 } // namespace ntp_snippets | 169 } // namespace ntp_snippets |
| OLD | NEW |