| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_HISTORY_TOP_SITES_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_TOP_SITES_H_ |
| 6 #define CHROME_BROWSER_HISTORY_TOP_SITES_H_ | 6 #define CHROME_BROWSER_HISTORY_TOP_SITES_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 // Returns true if the top sites list of forced URLs is full (i.e. we already | 142 // Returns true if the top sites list of forced URLs is full (i.e. we already |
| 143 // have the maximum number of forced top sites). This function also returns | 143 // have the maximum number of forced top sites). This function also returns |
| 144 // false if TopSites isn't loaded yet. | 144 // false if TopSites isn't loaded yet. |
| 145 virtual bool IsForcedFull() = 0; | 145 virtual bool IsForcedFull() = 0; |
| 146 | 146 |
| 147 virtual bool loaded() const = 0; | 147 virtual bool loaded() const = 0; |
| 148 | 148 |
| 149 // Returns the set of prepopulate pages. | 149 // Returns the set of prepopulate pages. |
| 150 virtual MostVisitedURLList GetPrepopulatePages() = 0; | 150 virtual MostVisitedURLList GetPrepopulatePages() = 0; |
| 151 | 151 |
| 152 // Adds or updates a |url| for which we should force the capture of a |
| 153 // thumbnail next time it's visited. If there is already a non-forced URL |
| 154 // matching this |url| this call has no effect. Indicate this URL was laste |
| 155 // forced at |time| so we can evict the older URLs when needed. Should be |
| 156 // called from the UI thread. |
| 157 virtual bool AddForcedURL(const GURL& url, const base::Time& time) = 0; |
| 158 |
| 152 struct PrepopulatedPage { | 159 struct PrepopulatedPage { |
| 153 // The string resource for the url. | 160 // The string resource for the url. |
| 154 int url_id; | 161 int url_id; |
| 155 // The string resource for the page title. | 162 // The string resource for the page title. |
| 156 int title_id; | 163 int title_id; |
| 157 // The raw data resource for the favicon. | 164 // The raw data resource for the favicon. |
| 158 int favicon_id; | 165 int favicon_id; |
| 159 // The raw data resource for the thumbnail. | 166 // The raw data resource for the thumbnail. |
| 160 int thumbnail_id; | 167 int thumbnail_id; |
| 161 // The best color to highlight the page (should roughly match favicon). | 168 // The best color to highlight the page (should roughly match favicon). |
| 162 SkColor color; | 169 SkColor color; |
| 163 }; | 170 }; |
| 164 protected: | 171 protected: |
| 165 virtual ~TopSites() {} | 172 virtual ~TopSites() {} |
| 166 | 173 |
| 167 private: | 174 private: |
| 168 friend class base::RefCountedThreadSafe<TopSites>; | 175 friend class base::RefCountedThreadSafe<TopSites>; |
| 169 }; | 176 }; |
| 170 | 177 |
| 171 #if defined(OS_ANDROID) | 178 #if defined(OS_ANDROID) |
| 172 extern const TopSites::PrepopulatedPage kPrepopulatedPages[1]; | 179 extern const TopSites::PrepopulatedPage kPrepopulatedPages[1]; |
| 173 #else | 180 #else |
| 174 extern const TopSites::PrepopulatedPage kPrepopulatedPages[2]; | 181 extern const TopSites::PrepopulatedPage kPrepopulatedPages[2]; |
| 175 #endif | 182 #endif |
| 176 | 183 |
| 177 } // namespace history | 184 } // namespace history |
| 178 | 185 |
| 179 #endif // CHROME_BROWSER_HISTORY_TOP_SITES_H_ | 186 #endif // CHROME_BROWSER_HISTORY_TOP_SITES_H_ |
| OLD | NEW |