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_HISTORY_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ |
6 #define CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ | 6 #define CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 // Navigation ---------------------------------------------------------------- | 156 // Navigation ---------------------------------------------------------------- |
157 | 157 |
158 // Adds the given canonical URL to history with the given time as the visit | 158 // Adds the given canonical URL to history with the given time as the visit |
159 // time. Referrer may be the empty string. | 159 // time. Referrer may be the empty string. |
160 // | 160 // |
161 // The supplied context id is used to scope the given page ID. Page IDs | 161 // The supplied context id is used to scope the given page ID. Page IDs |
162 // are only unique inside a given context, so we need that to differentiate | 162 // are only unique inside a given context, so we need that to differentiate |
163 // them. | 163 // them. |
164 // | 164 // |
165 // The context/page ids can be NULL if there is no meaningful tracking | 165 // The context/page ids can be NULL if there is no meaningful tracking |
166 // information that can be performed on the given URL. The 'page_id' should | 166 // information that can be performed on the given URL. The 'nav_entry_id' |
167 // be the ID of the current session history entry in the given process. | 167 // should be the unique ID of the current navigation entry in the given |
| 168 // process. |
168 // | 169 // |
169 // 'redirects' is an array of redirect URLs leading to this page, with the | 170 // 'redirects' is an array of redirect URLs leading to this page, with the |
170 // page itself as the last item (so when there is no redirect, it will have | 171 // page itself as the last item (so when there is no redirect, it will have |
171 // one entry). If there are no redirects, this array may also be empty for | 172 // one entry). If there are no redirects, this array may also be empty for |
172 // the convenience of callers. | 173 // the convenience of callers. |
173 // | 174 // |
174 // 'did_replace_entry' is true when the navigation entry for this page has | 175 // 'did_replace_entry' is true when the navigation entry for this page has |
175 // replaced the existing entry. A non-user initiated redirect causes such | 176 // replaced the existing entry. A non-user initiated redirect causes such |
176 // replacement. | 177 // replacement. |
177 // | 178 // |
178 // All "Add Page" functions will update the visited link database. | 179 // All "Add Page" functions will update the visited link database. |
179 void AddPage(const GURL& url, | 180 void AddPage(const GURL& url, |
180 base::Time time, | 181 base::Time time, |
181 history::ContextID context_id, | 182 history::ContextID context_id, |
182 int32 page_id, | 183 int nav_entry_id, |
183 const GURL& referrer, | 184 const GURL& referrer, |
184 const history::RedirectList& redirects, | 185 const history::RedirectList& redirects, |
185 ui::PageTransition transition, | 186 ui::PageTransition transition, |
186 history::VisitSource visit_source, | 187 history::VisitSource visit_source, |
187 bool did_replace_entry); | 188 bool did_replace_entry); |
188 | 189 |
189 // For adding pages to history where no tracking information can be done. | 190 // For adding pages to history where no tracking information can be done. |
190 void AddPage(const GURL& url, | 191 void AddPage(const GURL& url, |
191 base::Time time, | 192 base::Time time, |
192 history::VisitSource visit_source); | 193 history::VisitSource visit_source); |
193 | 194 |
194 // All AddPage variants end up here. | 195 // All AddPage variants end up here. |
195 void AddPage(const history::HistoryAddPageArgs& add_page_args); | 196 void AddPage(const history::HistoryAddPageArgs& add_page_args); |
196 | 197 |
197 // Adds an entry for the specified url without creating a visit. This should | 198 // Adds an entry for the specified url without creating a visit. This should |
198 // only be used when bookmarking a page, otherwise the row leaks in the | 199 // only be used when bookmarking a page, otherwise the row leaks in the |
199 // history db (it never gets cleaned). | 200 // history db (it never gets cleaned). |
200 void AddPageNoVisitForBookmark(const GURL& url, const base::string16& title); | 201 void AddPageNoVisitForBookmark(const GURL& url, const base::string16& title); |
201 | 202 |
202 // Sets the title for the given page. The page should be in history. If it | 203 // Sets the title for the given page. The page should be in history. If it |
203 // is not, this operation is ignored. | 204 // is not, this operation is ignored. |
204 void SetPageTitle(const GURL& url, const base::string16& title); | 205 void SetPageTitle(const GURL& url, const base::string16& title); |
205 | 206 |
206 // Updates the history database with a page's ending time stamp information. | 207 // Updates the history database with a page's ending time stamp information. |
207 // The page can be identified by the combination of the context id, the page | 208 // The page can be identified by the combination of the context id, the |
208 // id and the url. | 209 // navigation entry id and the url. |
209 void UpdateWithPageEndTime(history::ContextID context_id, | 210 void UpdateWithPageEndTime(history::ContextID context_id, |
210 int32 page_id, | 211 int nav_entry_id, |
211 const GURL& url, | 212 const GURL& url, |
212 base::Time end_ts); | 213 base::Time end_ts); |
213 | 214 |
214 // Querying ------------------------------------------------------------------ | 215 // Querying ------------------------------------------------------------------ |
215 | 216 |
216 // Returns the information about the requested URL. If the URL is found, | 217 // Returns the information about the requested URL. If the URL is found, |
217 // success will be true and the information will be in the URLRow parameter. | 218 // success will be true and the information will be in the URLRow parameter. |
218 // On success, the visits, if requested, will be sorted by date. If they have | 219 // On success, the visits, if requested, will be sorted by date. If they have |
219 // not been requested, the pointer will be valid, but the vector will be | 220 // not been requested, the pointer will be valid, but the vector will be |
220 // empty. | 221 // empty. |
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
905 | 906 |
906 history::DeleteDirectiveHandler delete_directive_handler_; | 907 history::DeleteDirectiveHandler delete_directive_handler_; |
907 | 908 |
908 // All vended weak pointers are invalidated in Cleanup(). | 909 // All vended weak pointers are invalidated in Cleanup(). |
909 base::WeakPtrFactory<HistoryService> weak_ptr_factory_; | 910 base::WeakPtrFactory<HistoryService> weak_ptr_factory_; |
910 | 911 |
911 DISALLOW_COPY_AND_ASSIGN(HistoryService); | 912 DISALLOW_COPY_AND_ASSIGN(HistoryService); |
912 }; | 913 }; |
913 | 914 |
914 #endif // CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ | 915 #endif // CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ |
OLD | NEW |