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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 static TopSites* Create(Profile* profile, const base::FilePath& db_name); | 46 static TopSites* Create(Profile* profile, const base::FilePath& db_name); |
47 | 47 |
48 // Sets the given thumbnail for the given URL. Returns true if the thumbnail | 48 // Sets the given thumbnail for the given URL. Returns true if the thumbnail |
49 // was updated. False means either the URL wasn't known to us, or we felt | 49 // was updated. False means either the URL wasn't known to us, or we felt |
50 // that our current thumbnail was superior to the given one. Should be called | 50 // that our current thumbnail was superior to the given one. Should be called |
51 // from the UI thread. | 51 // from the UI thread. |
52 virtual bool SetPageThumbnail(const GURL& url, | 52 virtual bool SetPageThumbnail(const GURL& url, |
53 const gfx::Image& thumbnail, | 53 const gfx::Image& thumbnail, |
54 const ThumbnailScore& score) = 0; | 54 const ThumbnailScore& score) = 0; |
55 | 55 |
| 56 // While testing the history system, we want to set the thumbnail to a piece |
| 57 // of static memory. |
| 58 virtual bool SetPageThumbnailToJPEGBytes( |
| 59 const GURL& url, |
| 60 const base::RefCountedMemory* memory, |
| 61 const ThumbnailScore& score) = 0; |
| 62 |
56 typedef base::Callback<void(const MostVisitedURLList&)> | 63 typedef base::Callback<void(const MostVisitedURLList&)> |
57 GetMostVisitedURLsCallback; | 64 GetMostVisitedURLsCallback; |
58 typedef std::vector<GetMostVisitedURLsCallback> PendingCallbacks; | 65 typedef std::vector<GetMostVisitedURLsCallback> PendingCallbacks; |
59 | 66 |
60 // Returns a list of most visited URLs via a callback. This may be invoked on | 67 // Returns a list of most visited URLs via a callback. This may be invoked on |
61 // any thread. | 68 // any thread. |
62 // NOTE: the callback is called immediately if we have the data cached. If | 69 // NOTE: the callback is called immediately if we have the data cached. If |
63 // data is not available yet, callback will later be posted to the thread | 70 // data is not available yet, callback will later be posted to the thread |
64 // called this function. | 71 // called this function. |
65 virtual void GetMostVisitedURLs( | 72 virtual void GetMostVisitedURLs( |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 | 169 |
163 #if defined(OS_ANDROID) | 170 #if defined(OS_ANDROID) |
164 extern const TopSites::PrepopulatedPage kPrepopulatedPages[1]; | 171 extern const TopSites::PrepopulatedPage kPrepopulatedPages[1]; |
165 #else | 172 #else |
166 extern const TopSites::PrepopulatedPage kPrepopulatedPages[2]; | 173 extern const TopSites::PrepopulatedPage kPrepopulatedPages[2]; |
167 #endif | 174 #endif |
168 | 175 |
169 } // namespace history | 176 } // namespace history |
170 | 177 |
171 #endif // CHROME_BROWSER_HISTORY_TOP_SITES_H_ | 178 #endif // CHROME_BROWSER_HISTORY_TOP_SITES_H_ |
OLD | NEW |