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. | |
sky
2013/09/12 21:22:18
Clarify exactly what 'prefix' here means.
huangs
2013/09/12 23:33:47
Referring to UrlIsPrefix() in url_utils.h; adding
| |
76 // As this method may be invoked on any thread the ref count needs to be | 78 // 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*. | 79 // incremented before this method returns, so this takes a scoped_refptr*. |
78 virtual bool GetPageThumbnail( | 80 virtual bool GetPageThumbnail( |
79 const GURL& url, scoped_refptr<base::RefCountedMemory>* bytes) = 0; | 81 const GURL& url, |
82 bool prefix_match, | |
83 scoped_refptr<base::RefCountedMemory>* bytes) = 0; | |
80 | 84 |
81 // Get a thumbnail score for a given page. Returns true iff we have the | 85 // 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 | 86 // thumbnail score. This may be invoked on any thread. The score will |
83 // be copied to |score|. | 87 // be copied to |score|. |
84 virtual bool GetPageThumbnailScore(const GURL& url, | 88 virtual bool GetPageThumbnailScore(const GURL& url, |
85 ThumbnailScore* score) = 0; | 89 ThumbnailScore* score) = 0; |
86 | 90 |
87 // Get a temporary thumbnail score for a given page. Returns true iff we | 91 // 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 | 92 // 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|. | 93 // 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 | 164 |
161 #if defined(OS_ANDROID) | 165 #if defined(OS_ANDROID) |
162 extern const TopSites::PrepopulatedPage kPrepopulatedPages[1]; | 166 extern const TopSites::PrepopulatedPage kPrepopulatedPages[1]; |
163 #else | 167 #else |
164 extern const TopSites::PrepopulatedPage kPrepopulatedPages[2]; | 168 extern const TopSites::PrepopulatedPage kPrepopulatedPages[2]; |
165 #endif | 169 #endif |
166 | 170 |
167 } // namespace history | 171 } // namespace history |
168 | 172 |
169 #endif // CHROME_BROWSER_HISTORY_TOP_SITES_H_ | 173 #endif // CHROME_BROWSER_HISTORY_TOP_SITES_H_ |
OLD | NEW |