| 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_URL_DATABASE_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_URL_DATABASE_H_ |
| 6 #define CHROME_BROWSER_HISTORY_URL_DATABASE_H_ | 6 #define CHROME_BROWSER_HISTORY_URL_DATABASE_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "chrome/browser/history/history_types.h" | 9 #include "chrome/browser/history/history_types.h" |
| 10 #include "chrome/browser/search_engines/template_url_id.h" | 10 #include "chrome/browser/search_engines/template_url_id.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 // also probably return a string instead since that is what the DB uses | 47 // also probably return a string instead since that is what the DB uses |
| 48 // internally and we can avoid the extra conversion. | 48 // internally and we can avoid the extra conversion. |
| 49 static std::string GURLToDatabaseURL(const GURL& url); | 49 static std::string GURLToDatabaseURL(const GURL& url); |
| 50 | 50 |
| 51 // URL table functions ------------------------------------------------------- | 51 // URL table functions ------------------------------------------------------- |
| 52 | 52 |
| 53 // Looks up a url given an id. Fills info with the data. Returns true on | 53 // Looks up a url given an id. Fills info with the data. Returns true on |
| 54 // success and false otherwise. | 54 // success and false otherwise. |
| 55 bool GetURLRow(URLID url_id, URLRow* info); | 55 bool GetURLRow(URLID url_id, URLRow* info); |
| 56 | 56 |
| 57 // Looks up all urls that were typed in manually. Fills info with the data. | 57 // Looks up all urls that were typed in manually. Fills urls with the data. |
| 58 // Returns true on success and false otherwise. | 58 // Returns true on success and false otherwise. |
| 59 bool GetAllTypedUrls(URLRows* urls); | 59 bool GetAllTypedUrls(URLRows* urls); |
| 60 | 60 |
| 61 // Looks up all unique URLs whose last visit times fall within the given |
| 62 // range. Fills urls with the data. Returns true on success and false |
| 63 // otherwise. |
| 64 bool GetUniqueURLsInRange(base::Time begin_time, base::Time end_time, |
| 65 int max_results, URLRows* urls); |
| 66 |
| 61 // Looks up the given URL and if it exists, fills the given pointers with the | 67 // Looks up the given URL and if it exists, fills the given pointers with the |
| 62 // associated info and returns the ID of that URL. If the info pointer is | 68 // associated info and returns the ID of that URL. If the info pointer is |
| 63 // NULL, no information about the URL will be filled in, only the ID will be | 69 // NULL, no information about the URL will be filled in, only the ID will be |
| 64 // returned. Returns 0 if the URL was not found. | 70 // returned. Returns 0 if the URL was not found. |
| 65 URLID GetRowForURL(const GURL& url, URLRow* info); | 71 URLID GetRowForURL(const GURL& url, URLRow* info); |
| 66 | 72 |
| 67 // Given an already-existing row in the URL table, updates that URL's stats. | 73 // Given an already-existing row in the URL table, updates that URL's stats. |
| 68 // This can not change the URL. Returns true on success. | 74 // This can not change the URL. Returns true on success. |
| 69 // | 75 // |
| 70 // This will NOT update the title used for full text indexing. If you are | 76 // This will NOT update the title used for full text indexing. If you are |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 // the macro if you want to put this in the middle of an otherwise constant | 305 // the macro if you want to put this in the middle of an otherwise constant |
| 300 // string, it will save time doing string appends. If you have to build a SQL | 306 // string, it will save time doing string appends. If you have to build a SQL |
| 301 // string dynamically anyway, use the constant, it will save space. | 307 // string dynamically anyway, use the constant, it will save space. |
| 302 #define HISTORY_URL_ROW_FIELDS \ | 308 #define HISTORY_URL_ROW_FIELDS \ |
| 303 " urls.id, urls.url, urls.title, urls.visit_count, urls.typed_count, " \ | 309 " urls.id, urls.url, urls.title, urls.visit_count, urls.typed_count, " \ |
| 304 "urls.last_visit_time, urls.hidden " | 310 "urls.last_visit_time, urls.hidden " |
| 305 | 311 |
| 306 } // history | 312 } // history |
| 307 | 313 |
| 308 #endif // CHROME_BROWSER_HISTORY_URL_DATABASE_H_ | 314 #endif // CHROME_BROWSER_HISTORY_URL_DATABASE_H_ |
| OLD | NEW |