| 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 #ifndef COMPONENTS_NTP_SNIPPETS_BOOKMARKS_BOOKMARK_SUGGESTIONS_PROVIDER_H_ | 5 #ifndef COMPONENTS_NTP_SNIPPETS_BOOKMARKS_BOOKMARK_SUGGESTIONS_PROVIDER_H_ |
| 6 #define COMPONENTS_NTP_SNIPPETS_BOOKMARKS_BOOKMARK_SUGGESTIONS_PROVIDER_H_ | 6 #define COMPONENTS_NTP_SNIPPETS_BOOKMARKS_BOOKMARK_SUGGESTIONS_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 void BookmarkNodeFaviconChanged( | 69 void BookmarkNodeFaviconChanged( |
| 70 bookmarks::BookmarkModel* model, | 70 bookmarks::BookmarkModel* model, |
| 71 const bookmarks::BookmarkNode* node) override {} | 71 const bookmarks::BookmarkNode* node) override {} |
| 72 void BookmarkNodeChildrenReordered( | 72 void BookmarkNodeChildrenReordered( |
| 73 bookmarks::BookmarkModel* model, | 73 bookmarks::BookmarkModel* model, |
| 74 const bookmarks::BookmarkNode* node) override {} | 74 const bookmarks::BookmarkNode* node) override {} |
| 75 void BookmarkAllUserNodesRemoved( | 75 void BookmarkAllUserNodesRemoved( |
| 76 bookmarks::BookmarkModel* model, | 76 bookmarks::BookmarkModel* model, |
| 77 const std::set<GURL>& removed_urls) override {} | 77 const std::set<GURL>& removed_urls) override {} |
| 78 | 78 |
| 79 ContentSuggestion ConvertBookmark(const bookmarks::BookmarkNode* bookmark); |
| 80 |
| 79 // The actual method to fetch bookmarks - follows each call to FetchBookmarks | 81 // The actual method to fetch bookmarks - follows each call to FetchBookmarks |
| 80 // but not sooner than the BookmarkModel gets loaded. | 82 // but not sooner than the BookmarkModel gets loaded. |
| 81 void FetchBookmarksInternal(); | 83 void FetchBookmarksInternal(); |
| 82 | 84 |
| 83 // Queries the BookmarkModel for recently visited bookmarks and pushes the | 85 // Queries the BookmarkModel for recently visited bookmarks and pushes the |
| 84 // results to the ContentSuggestionService. The actual fetching does not | 86 // results to the ContentSuggestionService. The actual fetching does not |
| 85 // happen before the Bookmark model gets loaded. | 87 // happen before the Bookmark model gets loaded. |
| 86 void FetchBookmarks(); | 88 void FetchBookmarks(); |
| 87 | 89 |
| 88 // Updates the |category_status_| and notifies the |observer_|, if necessary. | 90 // Updates the |category_status_| and notifies the |observer_|, if necessary. |
| 89 void NotifyStatusChanged(CategoryStatus new_status); | 91 void NotifyStatusChanged(CategoryStatus new_status); |
| 90 | 92 |
| 91 CategoryStatus category_status_; | 93 CategoryStatus category_status_; |
| 92 const Category provided_category_; | 94 const Category provided_category_; |
| 93 bookmarks::BookmarkModel* bookmark_model_; | 95 bookmarks::BookmarkModel* bookmark_model_; |
| 94 bool fetch_requested_; | 96 bool fetch_requested_; |
| 95 | 97 |
| 96 base::Time node_to_change_last_visit_date_; | 98 base::Time node_to_change_last_visit_date_; |
| 97 base::Time end_of_list_last_visit_date_; | 99 base::Time end_of_list_last_visit_date_; |
| 98 | 100 |
| 99 DISALLOW_COPY_AND_ASSIGN(BookmarkSuggestionsProvider); | 101 DISALLOW_COPY_AND_ASSIGN(BookmarkSuggestionsProvider); |
| 100 }; | 102 }; |
| 101 | 103 |
| 102 } // namespace ntp_snippets | 104 } // namespace ntp_snippets |
| 103 | 105 |
| 104 #endif // COMPONENTS_NTP_SNIPPETS_BOOKMARKS_BOOKMARK_SUGGESTIONS_PROVIDER_H_ | 106 #endif // COMPONENTS_NTP_SNIPPETS_BOOKMARKS_BOOKMARK_SUGGESTIONS_PROVIDER_H_ |
| OLD | NEW |