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_BACKEND_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ |
6 #define CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ | 6 #define CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/containers/mru_cache.h" | 13 #include "base/containers/mru_cache.h" |
14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
15 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
16 #include "base/memory/memory_pressure_listener.h" | 16 #include "base/memory/memory_pressure_listener.h" |
17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
18 #include "base/task/cancelable_task_tracker.h" | 18 #include "base/task/cancelable_task_tracker.h" |
19 #include "chrome/browser/history/expire_history_backend.h" | 19 #include "chrome/browser/history/expire_history_backend.h" |
20 #include "chrome/browser/history/history_database.h" | 20 #include "chrome/browser/history/history_database.h" |
21 #include "chrome/browser/history/history_marshaling.h" | 21 #include "chrome/browser/history/history_marshaling.h" |
22 #include "chrome/browser/history/history_types.h" | 22 #include "chrome/browser/history/history_types.h" |
23 #include "chrome/browser/history/thumbnail_database.h" | 23 #include "chrome/browser/history/thumbnail_database.h" |
24 #include "chrome/browser/history/visit_tracker.h" | 24 #include "chrome/browser/history/visit_tracker.h" |
25 #include "components/history/core/browser/keyword_id.h" | 25 #include "components/history/core/browser/keyword_id.h" |
26 #include "sql/init_status.h" | 26 #include "sql/init_status.h" |
27 | 27 |
| 28 #if defined(OS_ANDROID) |
| 29 #include "chrome/browser/history/android/android_history_types.h" |
| 30 #endif |
| 31 |
28 class TestingProfile; | 32 class TestingProfile; |
29 class TypedUrlSyncableService; | 33 class TypedUrlSyncableService; |
30 struct ThumbnailScore; | 34 struct ThumbnailScore; |
31 | 35 |
32 namespace history { | 36 namespace history { |
33 #if defined(OS_ANDROID) | 37 #if defined(OS_ANDROID) |
34 class AndroidProviderBackend; | 38 class AndroidProviderBackend; |
35 #endif | 39 #endif |
36 | 40 |
37 class CommitLaterTask; | 41 class CommitLaterTask; |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 | 279 |
276 void DeleteKeywordSearchTermForURL(const GURL& url); | 280 void DeleteKeywordSearchTermForURL(const GURL& url); |
277 | 281 |
278 void DeleteMatchingURLsForKeyword(KeywordID keyword_id, | 282 void DeleteMatchingURLsForKeyword(KeywordID keyword_id, |
279 const base::string16& term); | 283 const base::string16& term); |
280 | 284 |
281 #if defined(OS_ANDROID) | 285 #if defined(OS_ANDROID) |
282 // Android Provider --------------------------------------------------------- | 286 // Android Provider --------------------------------------------------------- |
283 | 287 |
284 // History and bookmarks ---------------------------------------------------- | 288 // History and bookmarks ---------------------------------------------------- |
285 void InsertHistoryAndBookmark(scoped_refptr<InsertRequest> request, | 289 // Inserts the given values into history backend. |
286 const HistoryAndBookmarkRow& row); | 290 AndroidURLID InsertHistoryAndBookmark(const HistoryAndBookmarkRow& row); |
287 | 291 |
288 // Runs the given query on history backend and returns the result. | 292 // Runs the given query on history backend and returns the result. |
289 // | 293 // |
290 // |projections| is the vector of the result columns. | 294 // |projections| is the vector of the result columns. |
291 // |selection| is the SQL WHERE clause without 'WHERE'. | 295 // |selection| is the SQL WHERE clause without 'WHERE'. |
292 // |selection_args| is the arguments for WHERE clause. | 296 // |selection_args| is the arguments for WHERE clause. |
293 // |sort_order| is the SQL ORDER clause. | 297 // |sort_order| is the SQL ORDER clause. |
294 history::AndroidStatement* QueryHistoryAndBookmarks( | 298 history::AndroidStatement* QueryHistoryAndBookmarks( |
295 const std::vector<HistoryAndBookmarkRow::ColumnID>& projections, | 299 const std::vector<HistoryAndBookmarkRow::ColumnID>& projections, |
296 const std::string& selection, | 300 const std::string& selection, |
(...skipping 18 matching lines...) Expand all Loading... |
315 // Statement ---------------------------------------------------------------- | 319 // Statement ---------------------------------------------------------------- |
316 // Move the statement's current position. | 320 // Move the statement's current position. |
317 int MoveStatement(history::AndroidStatement* statement, | 321 int MoveStatement(history::AndroidStatement* statement, |
318 int current_pos, | 322 int current_pos, |
319 int destination); | 323 int destination); |
320 | 324 |
321 // Close the given statement. The ownership is transfered. | 325 // Close the given statement. The ownership is transfered. |
322 void CloseStatement(AndroidStatement* statement); | 326 void CloseStatement(AndroidStatement* statement); |
323 | 327 |
324 // Search terms ------------------------------------------------------------- | 328 // Search terms ------------------------------------------------------------- |
325 void InsertSearchTerm(scoped_refptr<InsertRequest> request, | 329 // Inserts the given values and returns the SearchTermID of the inserted row. |
326 const SearchRow& row); | 330 SearchTermID InsertSearchTerm(const SearchRow& row); |
327 | 331 |
328 void UpdateSearchTerms(scoped_refptr<UpdateRequest> request, | 332 void UpdateSearchTerms(scoped_refptr<UpdateRequest> request, |
329 const SearchRow& row, | 333 const SearchRow& row, |
330 const std::string& selection, | 334 const std::string& selection, |
331 const std::vector<base::string16> selection_args); | 335 const std::vector<base::string16> selection_args); |
332 | 336 |
333 void DeleteSearchTerms(scoped_refptr<DeleteRequest> request, | 337 void DeleteSearchTerms(scoped_refptr<DeleteRequest> request, |
334 const std::string& selection, | 338 const std::string& selection, |
335 const std::vector<base::string16> selection_args); | 339 const std::vector<base::string16> selection_args); |
336 | 340 |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
864 | 868 |
865 // Listens for the system being under memory pressure. | 869 // Listens for the system being under memory pressure. |
866 scoped_ptr<base::MemoryPressureListener> memory_pressure_listener_; | 870 scoped_ptr<base::MemoryPressureListener> memory_pressure_listener_; |
867 | 871 |
868 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); | 872 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); |
869 }; | 873 }; |
870 | 874 |
871 } // namespace history | 875 } // namespace history |
872 | 876 |
873 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ | 877 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ |
OLD | NEW |