OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_SUGGESTIONS_SUGGESTIONS_SERVICE_H_ | 5 #ifndef COMPONENTS_SUGGESTIONS_SUGGESTIONS_SERVICE_H_ |
6 #define COMPONENTS_SUGGESTIONS_SUGGESTIONS_SERVICE_H_ | 6 #define COMPONENTS_SUGGESTIONS_SUGGESTIONS_SERVICE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 static bool IsEnabled(); | 62 static bool IsEnabled(); |
63 | 63 |
64 // Whether the user is part of a control group. | 64 // Whether the user is part of a control group. |
65 static bool IsControlGroup(); | 65 static bool IsControlGroup(); |
66 | 66 |
67 // Request suggestions data, which will be passed to |callback|. Initiates a | 67 // Request suggestions data, which will be passed to |callback|. Initiates a |
68 // fetch request unless a pending one exists. To prevent multiple requests, | 68 // fetch request unless a pending one exists. To prevent multiple requests, |
69 // we place all |callback|s in a queue and update them simultaneously when | 69 // we place all |callback|s in a queue and update them simultaneously when |
70 // fetch request completes. Also posts a task to execute OnRequestTimeout | 70 // fetch request completes. Also posts a task to execute OnRequestTimeout |
71 // if the request hasn't completed in a given amount of time. | 71 // if the request hasn't completed in a given amount of time. |
72 void FetchSuggestionsData(ResponseCallback callback); | 72 void FetchSuggestionsData(bool sync_initialized, |
| 73 bool history_sync_enabled, |
| 74 ResponseCallback callback); |
73 | 75 |
74 // Similar to FetchSuggestionsData but doesn't post a task to execute | 76 // Similar to FetchSuggestionsData but doesn't post a task to execute |
75 // OnDelaySinceFetch. | 77 // OnDelaySinceFetch. |
76 void FetchSuggestionsDataNoTimeout(ResponseCallback callback); | 78 void FetchSuggestionsDataNoTimeout(ResponseCallback callback); |
77 | 79 |
78 // Retrieves stored thumbnail for website |url| asynchronously. Calls | 80 // Retrieves stored thumbnail for website |url| asynchronously. Calls |
79 // |callback| with Bitmap pointer if found, and NULL otherwise. | 81 // |callback| with Bitmap pointer if found, and NULL otherwise. |
80 void GetPageThumbnail( | 82 void GetPageThumbnail( |
81 const GURL& url, | 83 const GURL& url, |
82 base::Callback<void(const GURL&, const SkBitmap*)> callback); | 84 base::Callback<void(const GURL&, const SkBitmap*)> callback); |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 // Timeout (in ms) before serving requestors after a fetch suggestions request | 186 // Timeout (in ms) before serving requestors after a fetch suggestions request |
185 // has been issued. | 187 // has been issued. |
186 int request_timeout_ms_; | 188 int request_timeout_ms_; |
187 | 189 |
188 DISALLOW_COPY_AND_ASSIGN(SuggestionsService); | 190 DISALLOW_COPY_AND_ASSIGN(SuggestionsService); |
189 }; | 191 }; |
190 | 192 |
191 } // namespace suggestions | 193 } // namespace suggestions |
192 | 194 |
193 #endif // COMPONENTS_SUGGESTIONS_SUGGESTIONS_SERVICE_H_ | 195 #endif // COMPONENTS_SUGGESTIONS_SUGGESTIONS_SERVICE_H_ |
OLD | NEW |