| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_HISTORY_H_ |
| 6 #define CHROME_BROWSER_HISTORY_HISTORY_H_ | 6 #define CHROME_BROWSER_HISTORY_HISTORY_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "app/sql/init_status.h" | 12 #include "app/sql/init_status.h" |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/callback_old.h" | 14 #include "base/callback_old.h" |
| 15 #include "base/file_path.h" | 15 #include "base/file_path.h" |
| 16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 18 #include "base/string16.h" | 18 #include "base/string16.h" |
| 19 #include "base/task.h" | 19 #include "base/task.h" |
| 20 #include "chrome/browser/favicon/favicon_service.h" | 20 #include "chrome/browser/favicon/favicon_service.h" |
| 21 #include "chrome/browser/history/history_types.h" | 21 #include "chrome/browser/history/history_types.h" |
| 22 #include "chrome/browser/search_engines/template_url_id.h" | 22 #include "chrome/browser/search_engines/template_url_id.h" |
| 23 #include "chrome/common/ref_counted_util.h" | 23 #include "chrome/common/ref_counted_util.h" |
| 24 #include "content/browser/cancelable_request.h" | 24 #include "content/browser/cancelable_request.h" |
| 25 #include "content/common/notification_observer.h" | 25 #include "content/common/notification_observer.h" |
| 26 #include "content/common/notification_registrar.h" | 26 #include "content/common/notification_registrar.h" |
| 27 #include "content/common/page_transition_types.h" | 27 #include "content/common/page_transition_types.h" |
| 28 | 28 |
| 29 class BookmarkService; | 29 class BookmarkService; |
| 30 struct DownloadCreateInfo; | 30 struct DownloadHistoryInfo; |
| 31 class FilePath; | 31 class FilePath; |
| 32 class GURL; | 32 class GURL; |
| 33 class HistoryURLProvider; | 33 class HistoryURLProvider; |
| 34 struct HistoryURLProviderParams; | 34 struct HistoryURLProviderParams; |
| 35 class InMemoryURLDatabase; | 35 class InMemoryURLDatabase; |
| 36 class MainPagesRequest; | 36 class MainPagesRequest; |
| 37 class PageUsageData; | 37 class PageUsageData; |
| 38 class PageUsageRequest; | 38 class PageUsageRequest; |
| 39 class Profile; | 39 class Profile; |
| 40 class SkBitmap; | 40 class SkBitmap; |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 // removed. | 409 // removed. |
| 410 void ExpireHistoryBetween(const std::set<GURL>& restrict_urls, | 410 void ExpireHistoryBetween(const std::set<GURL>& restrict_urls, |
| 411 base::Time begin_time, base::Time end_time, | 411 base::Time begin_time, base::Time end_time, |
| 412 CancelableRequestConsumerBase* consumer, | 412 CancelableRequestConsumerBase* consumer, |
| 413 ExpireHistoryCallback* callback); | 413 ExpireHistoryCallback* callback); |
| 414 | 414 |
| 415 // Downloads ----------------------------------------------------------------- | 415 // Downloads ----------------------------------------------------------------- |
| 416 | 416 |
| 417 // Implemented by the caller of 'CreateDownload' below, and is called when the | 417 // Implemented by the caller of 'CreateDownload' below, and is called when the |
| 418 // history service has created a new entry for a download in the history db. | 418 // history service has created a new entry for a download in the history db. |
| 419 typedef Callback2<DownloadCreateInfo, int64>::Type | 419 typedef Callback2<int32, int64>::Type |
| 420 DownloadCreateCallback; | 420 DownloadCreateCallback; |
| 421 | 421 |
| 422 // Begins a history request to create a new persistent entry for a download. | 422 // Begins a history request to create a new persistent entry for a download. |
| 423 // 'info' contains all the download's creation state, and 'callback' runs | 423 // 'info' contains all the download's creation state, and 'callback' runs |
| 424 // when the history service request is complete. | 424 // when the history service request is complete. |
| 425 Handle CreateDownload(const DownloadCreateInfo& info, | 425 Handle CreateDownload(const DownloadHistoryInfo& info, |
| 426 CancelableRequestConsumerBase* consumer, | 426 CancelableRequestConsumerBase* consumer, |
| 427 DownloadCreateCallback* callback); | 427 DownloadCreateCallback* callback); |
| 428 | 428 |
| 429 // Implemented by the caller of 'QueryDownloads' below, and is called when the | 429 // Implemented by the caller of 'QueryDownloads' below, and is called when the |
| 430 // history service has retrieved a list of all download state. The call | 430 // history service has retrieved a list of all download state. The call |
| 431 typedef Callback1<std::vector<DownloadCreateInfo>*>::Type | 431 typedef Callback1<std::vector<DownloadHistoryInfo>*>::Type |
| 432 DownloadQueryCallback; | 432 DownloadQueryCallback; |
| 433 | 433 |
| 434 // Begins a history request to retrieve the state of all downloads in the | 434 // Begins a history request to retrieve the state of all downloads in the |
| 435 // history db. 'callback' runs when the history service request is complete, | 435 // history db. 'callback' runs when the history service request is complete, |
| 436 // at which point 'info' contains an array of DownloadCreateInfo, one per | 436 // at which point 'info' contains an array of DownloadHistoryInfo, one per |
| 437 // download. | 437 // download. |
| 438 Handle QueryDownloads(CancelableRequestConsumerBase* consumer, | 438 Handle QueryDownloads(CancelableRequestConsumerBase* consumer, |
| 439 DownloadQueryCallback* callback); | 439 DownloadQueryCallback* callback); |
| 440 | 440 |
| 441 // Begins a request to clean up entries that has been corrupted (because of | 441 // Begins a request to clean up entries that has been corrupted (because of |
| 442 // the crash, for example). | 442 // the crash, for example). |
| 443 void CleanUpInProgressEntries(); | 443 void CleanUpInProgressEntries(); |
| 444 | 444 |
| 445 // Called to update the history service about the current state of a download. | 445 // Called to update the history service about the current state of a download. |
| 446 // This is a 'fire and forget' query, so just pass the relevant state info to | 446 // This is a 'fire and forget' query, so just pass the relevant state info to |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 866 BookmarkService* bookmark_service_; | 866 BookmarkService* bookmark_service_; |
| 867 bool no_db_; | 867 bool no_db_; |
| 868 | 868 |
| 869 // True if needs top site migration. | 869 // True if needs top site migration. |
| 870 bool needs_top_sites_migration_; | 870 bool needs_top_sites_migration_; |
| 871 | 871 |
| 872 DISALLOW_COPY_AND_ASSIGN(HistoryService); | 872 DISALLOW_COPY_AND_ASSIGN(HistoryService); |
| 873 }; | 873 }; |
| 874 | 874 |
| 875 #endif // CHROME_BROWSER_HISTORY_HISTORY_H_ | 875 #endif // CHROME_BROWSER_HISTORY_HISTORY_H_ |
| OLD | NEW |