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_SYNC_TEST_INTEGRATION_TYPED_URLS_HELPER_H_ | 5 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_TYPED_URLS_HELPER_H_ |
6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_TYPED_URLS_HELPER_H_ | 6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_TYPED_URLS_HELPER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "components/history/core/browser/history_types.h" | 10 #include "components/history/core/browser/history_types.h" |
11 #include "ui/base/page_transition_types.h" | 11 #include "ui/base/page_transition_types.h" |
12 | 12 |
13 namespace base { | 13 namespace base { |
14 class Time; | 14 class Time; |
15 } | 15 } |
16 | 16 |
17 namespace typed_urls_helper { | 17 namespace typed_urls_helper { |
18 | 18 |
19 // Gets the typed URLs from a specific sync profile. | 19 // Gets the typed URLs from a specific sync profile. |
20 history::URLRows GetTypedUrlsFromClient(int index); | 20 history::URLRows GetTypedUrlsFromClient(int index); |
21 | 21 |
22 // Gets a specific url from a specific sync profile. Returns false if the URL | 22 // Gets a specific url from a specific sync profile. Returns false if the URL |
23 // was not found in the history DB. | 23 // was not found in the history DB. |
24 bool GetUrlFromClient(int index, const GURL& url, history::URLRow* row); | 24 bool GetUrlFromClient(int index, const GURL& url, history::URLRow* row); |
25 | 25 |
26 // Gets the visits for a URL from a specific sync profile. | 26 // Gets the visits for a URL from a specific sync profile. |
27 history::VisitVector GetVisitsFromClient(int index, history::URLID id); | 27 history::VisitVector GetVisitsFromClient(int index, history::URLID id); |
28 | 28 |
| 29 // Gets the visits for a URL from a specific sync profile. Like above, but |
| 30 // takes a GURL instead of URLID. Returns empty vector if |url| is not returned |
| 31 // by GetUrlFromClient(). |
| 32 history::VisitVector GetVisitsForURLFromClient(int index, const GURL& url); |
| 33 |
29 // Removes the passed |visits| from a specific sync profile. | 34 // Removes the passed |visits| from a specific sync profile. |
30 void RemoveVisitsFromClient(int index, const history::VisitVector& visits); | 35 void RemoveVisitsFromClient(int index, const history::VisitVector& visits); |
31 | 36 |
32 // Adds a URL to the history DB for a specific sync profile (just registers a | 37 // Adds a URL to the history DB for a specific sync profile (just registers a |
33 // new visit if the URL already exists) using a TYPED PageTransition. | 38 // new visit if the URL already exists) using a TYPED PageTransition. |
34 void AddUrlToHistory(int index, const GURL& url); | 39 void AddUrlToHistory(int index, const GURL& url); |
35 | 40 |
36 // Adds a URL to the history DB for a specific sync profile (just registers a | 41 // Adds a URL to the history DB for a specific sync profile (just registers a |
37 // new visit if the URL already exists), using the passed PageTransition. | 42 // new visit if the URL already exists), using the passed PageTransition. |
38 void AddUrlToHistoryWithTransition(int index, | 43 void AddUrlToHistoryWithTransition(int index, |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 // Returns a unique timestamp to use when generating page visits | 87 // Returns a unique timestamp to use when generating page visits |
83 // (HistoryService does not like having identical timestamps and will modify | 88 // (HistoryService does not like having identical timestamps and will modify |
84 // the timestamps behind the scenes if it encounters them, which leads to | 89 // the timestamps behind the scenes if it encounters them, which leads to |
85 // spurious test failures when the resulting timestamps aren't what we | 90 // spurious test failures when the resulting timestamps aren't what we |
86 // expect). | 91 // expect). |
87 base::Time GetTimestamp(); | 92 base::Time GetTimestamp(); |
88 | 93 |
89 } // namespace typed_urls_helper | 94 } // namespace typed_urls_helper |
90 | 95 |
91 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_TYPED_URLS_HELPER_H_ | 96 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_TYPED_URLS_HELPER_H_ |
OLD | NEW |