| 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 COMPONENTS_NTP_TILES_MOST_VISITED_SITES_H_ | 5 #ifndef COMPONENTS_NTP_TILES_MOST_VISITED_SITES_H_ |
| 6 #define COMPONENTS_NTP_TILES_MOST_VISITED_SITES_H_ | 6 #define COMPONENTS_NTP_TILES_MOST_VISITED_SITES_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 ICON_COLOR, | 98 ICON_COLOR, |
| 99 // The item displays a default gray box in place of an icon. | 99 // The item displays a default gray box in place of an icon. |
| 100 ICON_DEFAULT, | 100 ICON_DEFAULT, |
| 101 NUM_TILE_TYPES, | 101 NUM_TILE_TYPES, |
| 102 }; | 102 }; |
| 103 | 103 |
| 104 // The observer to be notified when the list of most visited sites changes. | 104 // The observer to be notified when the list of most visited sites changes. |
| 105 class Observer { | 105 class Observer { |
| 106 public: | 106 public: |
| 107 virtual void OnMostVisitedURLsAvailable(const NTPTilesVector& tiles) = 0; | 107 virtual void OnMostVisitedURLsAvailable(const NTPTilesVector& tiles) = 0; |
| 108 virtual void OnPopularURLsAvailable(const PopularSitesVector& sites) = 0; | 108 virtual void OnPopularURLsAvailable(const PopularSitesVector& sites) {} |
| 109 | 109 |
| 110 protected: | 110 protected: |
| 111 virtual ~Observer() {} | 111 virtual ~Observer() {} |
| 112 }; | 112 }; |
| 113 | 113 |
| 114 // Construct a MostVisitedSites instance. | 114 // Construct a MostVisitedSites instance. |
| 115 // | 115 // |
| 116 // |prefs|, |top_sites|, and |suggestions| are required and may not be null. | 116 // |prefs|, |top_sites|, and |suggestions| are required and may not be null. |
| 117 // |popular_sites| and |supervisor| are optional and if null the associated | 117 // |popular_sites| and |supervisor| are optional and if null the associated |
| 118 // features will be disabled. | 118 // features will be disabled. |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 | 231 |
| 232 // For callbacks may be run after destruction. | 232 // For callbacks may be run after destruction. |
| 233 base::WeakPtrFactory<MostVisitedSites> weak_ptr_factory_; | 233 base::WeakPtrFactory<MostVisitedSites> weak_ptr_factory_; |
| 234 | 234 |
| 235 DISALLOW_COPY_AND_ASSIGN(MostVisitedSites); | 235 DISALLOW_COPY_AND_ASSIGN(MostVisitedSites); |
| 236 }; | 236 }; |
| 237 | 237 |
| 238 } // namespace ntp_tiles | 238 } // namespace ntp_tiles |
| 239 | 239 |
| 240 #endif // COMPONENTS_NTP_TILES_MOST_VISITED_SITES_H_ | 240 #endif // COMPONENTS_NTP_TILES_MOST_VISITED_SITES_H_ |
| OLD | NEW |