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" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "chrome/browser/common/cancelable_request.h" | 12 #include "chrome/browser/common/cancelable_request.h" |
13 #include "chrome/browser/history/history_service.h" | 13 #include "chrome/browser/history/history_service.h" |
14 #include "chrome/browser/history/history_types.h" | 14 #include "chrome/browser/history/history_types.h" |
15 #include "chrome/common/thumbnail_score.h" | 15 #include "chrome/common/thumbnail_score.h" |
16 #include "third_party/skia/include/core/SkColor.h" | 16 #include "third_party/skia/include/core/SkColor.h" |
17 #include "ui/gfx/image/image.h" | 17 #include "ui/gfx/image/image.h" |
18 #include "url/gurl.h" | |
19 | 18 |
| 19 class GURL; |
20 class Profile; | 20 class Profile; |
21 | 21 |
22 namespace base { | 22 namespace base { |
23 class FilePath; | 23 class FilePath; |
24 class RefCountedBytes; | 24 class RefCountedBytes; |
25 class RefCountedMemory; | 25 class RefCountedMemory; |
26 } | 26 } |
27 | 27 |
28 namespace history { | 28 namespace history { |
29 | 29 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 typedef std::vector<GetMostVisitedURLsCallback> PendingCallbacks; | 64 typedef std::vector<GetMostVisitedURLsCallback> PendingCallbacks; |
65 | 65 |
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 // Gets 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 | 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 | 77 // not to try harder by matching the query thumbnail URL as URL prefix (as |
78 // defined by UrlIsPrefix()). | 78 // defined by UrlIsPrefix()). |
79 // 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 |
80 // incremented before this method returns, so this takes a scoped_refptr*. | 80 // incremented before this method returns, so this takes a scoped_refptr*. |
81 virtual bool GetPageThumbnail( | 81 virtual bool GetPageThumbnail( |
82 const GURL& url, | 82 const GURL& url, |
83 bool prefix_match, | 83 bool prefix_match, |
84 scoped_refptr<base::RefCountedMemory>* bytes) = 0; | 84 scoped_refptr<base::RefCountedMemory>* bytes) = 0; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 | 165 |
166 #if defined(OS_ANDROID) | 166 #if defined(OS_ANDROID) |
167 extern const TopSites::PrepopulatedPage kPrepopulatedPages[1]; | 167 extern const TopSites::PrepopulatedPage kPrepopulatedPages[1]; |
168 #else | 168 #else |
169 extern const TopSites::PrepopulatedPage kPrepopulatedPages[2]; | 169 extern const TopSites::PrepopulatedPage kPrepopulatedPages[2]; |
170 #endif | 170 #endif |
171 | 171 |
172 } // namespace history | 172 } // namespace history |
173 | 173 |
174 #endif // CHROME_BROWSER_HISTORY_TOP_SITES_H_ | 174 #endif // CHROME_BROWSER_HISTORY_TOP_SITES_H_ |
OLD | NEW |