| 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_NTP_MOST_VISITED_SITES_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_NTP_MOST_VISITED_SITES_H_ |
| 6 #define CHROME_BROWSER_ANDROID_NTP_MOST_VISITED_SITES_H_ | 6 #define CHROME_BROWSER_ANDROID_NTP_MOST_VISITED_SITES_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 Suggestion& operator=(Suggestion&&); | 87 Suggestion& operator=(Suggestion&&); |
| 88 | 88 |
| 89 private: | 89 private: |
| 90 DISALLOW_COPY_AND_ASSIGN(Suggestion); | 90 DISALLOW_COPY_AND_ASSIGN(Suggestion); |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 MostVisitedSites(PrefService* prefs, | 93 MostVisitedSites(PrefService* prefs, |
| 94 const TemplateURLService* template_url_service, | 94 const TemplateURLService* template_url_service, |
| 95 variations::VariationsService* variations_service, | 95 variations::VariationsService* variations_service, |
| 96 net::URLRequestContextGetter* download_context, | 96 net::URLRequestContextGetter* download_context, |
| 97 const base::FilePath& popular_sites_directory, |
| 97 scoped_refptr<history::TopSites> top_sites, | 98 scoped_refptr<history::TopSites> top_sites, |
| 98 suggestions::SuggestionsService* suggestions, | 99 suggestions::SuggestionsService* suggestions, |
| 99 bool is_child_profile, | 100 bool is_child_profile, |
| 100 Profile* profile); | 101 Profile* profile); |
| 101 | 102 |
| 102 ~MostVisitedSites() override; | 103 ~MostVisitedSites() override; |
| 103 | 104 |
| 104 // Does not take ownership of |observer|, which must outlive this object and | 105 // Does not take ownership of |observer|, which must outlive this object and |
| 105 // must not be null. | 106 // must not be null. |
| 106 void SetMostVisitedURLsObserver(Observer* observer, int num_sites); | 107 void SetMostVisitedURLsObserver(Observer* observer, int num_sites); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 void TopSitesChanged(history::TopSites* top_sites, | 222 void TopSitesChanged(history::TopSites* top_sites, |
| 222 ChangeReason change_reason) override; | 223 ChangeReason change_reason) override; |
| 223 | 224 |
| 224 // The profile whose most visited sites will be queried. | 225 // The profile whose most visited sites will be queried. |
| 225 Profile* profile_; | 226 Profile* profile_; |
| 226 | 227 |
| 227 PrefService* prefs_; | 228 PrefService* prefs_; |
| 228 const TemplateURLService* template_url_service_; | 229 const TemplateURLService* template_url_service_; |
| 229 variations::VariationsService* variations_service_; | 230 variations::VariationsService* variations_service_; |
| 230 net::URLRequestContextGetter* download_context_; | 231 net::URLRequestContextGetter* download_context_; |
| 232 base::FilePath popular_sites_directory_; |
| 231 scoped_refptr<history::TopSites> top_sites_; | 233 scoped_refptr<history::TopSites> top_sites_; |
| 232 suggestions::SuggestionsService* suggestions_service_; | 234 suggestions::SuggestionsService* suggestions_service_; |
| 233 | 235 |
| 234 // Children will not be shown popular sites as suggestions. | 236 // Children will not be shown popular sites as suggestions. |
| 235 // TODO(sfiera): enable/disable suggestions if the profile is marked or | 237 // TODO(sfiera): enable/disable suggestions if the profile is marked or |
| 236 // unmarked as a child profile during the lifetime of the object. For now, it | 238 // unmarked as a child profile during the lifetime of the object. For now, it |
| 237 // doesn't matter, because a MostVisitedSites is instantiated for each NTP, | 239 // doesn't matter, because a MostVisitedSites is instantiated for each NTP, |
| 238 // but a longer-lived object would need to update. | 240 // but a longer-lived object would need to update. |
| 239 bool is_child_profile_; | 241 bool is_child_profile_; |
| 240 | 242 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 267 | 269 |
| 268 SuggestionsVector current_suggestions_; | 270 SuggestionsVector current_suggestions_; |
| 269 | 271 |
| 270 // For callbacks may be run after destruction. | 272 // For callbacks may be run after destruction. |
| 271 base::WeakPtrFactory<MostVisitedSites> weak_ptr_factory_; | 273 base::WeakPtrFactory<MostVisitedSites> weak_ptr_factory_; |
| 272 | 274 |
| 273 DISALLOW_COPY_AND_ASSIGN(MostVisitedSites); | 275 DISALLOW_COPY_AND_ASSIGN(MostVisitedSites); |
| 274 }; | 276 }; |
| 275 | 277 |
| 276 #endif // CHROME_BROWSER_ANDROID_NTP_MOST_VISITED_SITES_H_ | 278 #endif // CHROME_BROWSER_ANDROID_NTP_MOST_VISITED_SITES_H_ |
| OLD | NEW |