| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROME_BROWSER_ANDROID_MOST_VISITED_SITES_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_MOST_VISITED_SITES_H_ |
| 6 #define CHROME_BROWSER_ANDROID_MOST_VISITED_SITES_H_ | 6 #define CHROME_BROWSER_ANDROID_MOST_VISITED_SITES_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 | 10 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 105 |
| 106 using SuggestionsVector = std::vector<scoped_ptr<Suggestion>>; | 106 using SuggestionsVector = std::vector<scoped_ptr<Suggestion>>; |
| 107 | 107 |
| 108 ~MostVisitedSites() override; | 108 ~MostVisitedSites() override; |
| 109 void QueryMostVisitedURLs(); | 109 void QueryMostVisitedURLs(); |
| 110 | 110 |
| 111 // Initialize the query to Top Sites. Called if the SuggestionsService is not | 111 // Initialize the query to Top Sites. Called if the SuggestionsService is not |
| 112 // enabled, or if it returns no data. | 112 // enabled, or if it returns no data. |
| 113 void InitiateTopSitesQuery(); | 113 void InitiateTopSitesQuery(); |
| 114 | 114 |
| 115 // If there's a whitelist entry point for the URL, return the large icon path. |
| 116 base::FilePath GetWhitelistLargeIconPath(const GURL& url); |
| 117 |
| 115 // Callback for when data is available from TopSites. | 118 // Callback for when data is available from TopSites. |
| 116 void OnMostVisitedURLsAvailable( | 119 void OnMostVisitedURLsAvailable( |
| 117 const history::MostVisitedURLList& visited_list); | 120 const history::MostVisitedURLList& visited_list); |
| 118 | 121 |
| 119 // Callback for when data is available from the SuggestionsService. | 122 // Callback for when data is available from the SuggestionsService. |
| 120 void OnSuggestionsProfileAvailable( | 123 void OnSuggestionsProfileAvailable( |
| 121 const suggestions::SuggestionsProfile& suggestions_profile); | 124 const suggestions::SuggestionsProfile& suggestions_profile); |
| 122 | 125 |
| 123 // Takes the personal suggestions and creates whitelist entry point | 126 // Takes the personal suggestions and creates whitelist entry point |
| 124 // suggestions if necessary. | 127 // suggestions if necessary. |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 | 237 |
| 235 SuggestionsVector current_suggestions_; | 238 SuggestionsVector current_suggestions_; |
| 236 | 239 |
| 237 // For callbacks may be run after destruction. | 240 // For callbacks may be run after destruction. |
| 238 base::WeakPtrFactory<MostVisitedSites> weak_ptr_factory_; | 241 base::WeakPtrFactory<MostVisitedSites> weak_ptr_factory_; |
| 239 | 242 |
| 240 DISALLOW_COPY_AND_ASSIGN(MostVisitedSites); | 243 DISALLOW_COPY_AND_ASSIGN(MostVisitedSites); |
| 241 }; | 244 }; |
| 242 | 245 |
| 243 #endif // CHROME_BROWSER_ANDROID_MOST_VISITED_SITES_H_ | 246 #endif // CHROME_BROWSER_ANDROID_MOST_VISITED_SITES_H_ |
| OLD | NEW |