| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 // Returns a list of most visited URLs via a callback. This may be invoked on | 66 // Returns a list of most visited URLs via a callback. This may be invoked on |
| 67 // any thread. | 67 // any thread. |
| 68 // NOTE: the callback is called immediately if we have the data cached. If | 68 // NOTE: the callback is called immediately if we have the data cached. If |
| 69 // data is not available yet, callback will later be posted to the thread | 69 // data is not available yet, callback will later be posted to the thread |
| 70 // called this function. | 70 // called this function. |
| 71 virtual void GetMostVisitedURLs( | 71 virtual void GetMostVisitedURLs( |
| 72 const GetMostVisitedURLsCallback& callback) = 0; | 72 const GetMostVisitedURLsCallback& callback) = 0; |
| 73 | 73 |
| 74 // Get a thumbnail for a given page. Returns true iff we have the thumbnail. | 74 // Get a thumbnail for a given page. Returns true iff we have the thumbnail. |
| 75 // This may be invoked on any thread. | 75 // This may be invoked on any thread. |
| 76 // If an exact thumbnail URL match fails, |prefix_match| specifies whether or |
| 77 // not to try harder by matching the query thumbnail URL as URL prefix (as |
| 78 // defined by UrlIsPrefix()). |
| 76 // As this method may be invoked on any thread the ref count needs to be | 79 // As this method may be invoked on any thread the ref count needs to be |
| 77 // incremented before this method returns, so this takes a scoped_refptr*. | 80 // incremented before this method returns, so this takes a scoped_refptr*. |
| 78 virtual bool GetPageThumbnail( | 81 virtual bool GetPageThumbnail( |
| 79 const GURL& url, scoped_refptr<base::RefCountedMemory>* bytes) = 0; | 82 const GURL& url, |
| 83 bool prefix_match, |
| 84 scoped_refptr<base::RefCountedMemory>* bytes) = 0; |
| 80 | 85 |
| 81 // Get a thumbnail score for a given page. Returns true iff we have the | 86 // Get a thumbnail score for a given page. Returns true iff we have the |
| 82 // thumbnail score. This may be invoked on any thread. The score will | 87 // thumbnail score. This may be invoked on any thread. The score will |
| 83 // be copied to |score|. | 88 // be copied to |score|. |
| 84 virtual bool GetPageThumbnailScore(const GURL& url, | 89 virtual bool GetPageThumbnailScore(const GURL& url, |
| 85 ThumbnailScore* score) = 0; | 90 ThumbnailScore* score) = 0; |
| 86 | 91 |
| 87 // Get a temporary thumbnail score for a given page. Returns true iff we | 92 // Get a temporary thumbnail score for a given page. Returns true iff we |
| 88 // have the thumbnail score. Useful when checking if we should update a | 93 // have the thumbnail score. Useful when checking if we should update a |
| 89 // thumbnail for a given page. The score will be copied to |score|. | 94 // thumbnail for a given page. The score will be copied to |score|. |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 | 165 |
| 161 #if defined(OS_ANDROID) | 166 #if defined(OS_ANDROID) |
| 162 extern const TopSites::PrepopulatedPage kPrepopulatedPages[1]; | 167 extern const TopSites::PrepopulatedPage kPrepopulatedPages[1]; |
| 163 #else | 168 #else |
| 164 extern const TopSites::PrepopulatedPage kPrepopulatedPages[2]; | 169 extern const TopSites::PrepopulatedPage kPrepopulatedPages[2]; |
| 165 #endif | 170 #endif |
| 166 | 171 |
| 167 } // namespace history | 172 } // namespace history |
| 168 | 173 |
| 169 #endif // CHROME_BROWSER_HISTORY_TOP_SITES_H_ | 174 #endif // CHROME_BROWSER_HISTORY_TOP_SITES_H_ |
| OLD | NEW |