diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-16 23:39:42 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-16 23:39:42 +0000 |
commit | d3b129003402bb0f37d0f22803efa1960bee90a3 (patch) | |
tree | 3f6d62d040162549f699df4f67ac6368b4f6edf4 /chrome/browser/history | |
parent | eb997422bde4133da7db0e1e3ff82d18890de218 (diff) | |
download | chromium_src-d3b129003402bb0f37d0f22803efa1960bee90a3.zip chromium_src-d3b129003402bb0f37d0f22803efa1960bee90a3.tar.gz chromium_src-d3b129003402bb0f37d0f22803efa1960bee90a3.tar.bz2 |
Regression fix: Downloads page in Incognito mode works fine now.
Additionally, it fixes another ancient bug that prevented downloads search
from working in Incognito mode.
The design of DownloadHistory is also nicer now, with no dependencies
on DownloadManager.
TEST=see bug
BUG=51955
Review URL: http://codereview.chromium.org/3112011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56266 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/history')
-rw-r--r-- | chrome/browser/history/download_database.cc | 18 | ||||
-rw-r--r-- | chrome/browser/history/download_database.h | 4 | ||||
-rw-r--r-- | chrome/browser/history/history.cc | 8 | ||||
-rw-r--r-- | chrome/browser/history/history.h | 9 | ||||
-rw-r--r-- | chrome/browser/history/history_backend.cc | 11 | ||||
-rw-r--r-- | chrome/browser/history/history_backend.h | 2 | ||||
-rw-r--r-- | chrome/browser/history/history_marshaling.h | 4 |
7 files changed, 0 insertions, 56 deletions
diff --git a/chrome/browser/history/download_database.cc b/chrome/browser/history/download_database.cc index 62853a8..e985cca 100644 --- a/chrome/browser/history/download_database.cc +++ b/chrome/browser/history/download_database.cc @@ -196,22 +196,4 @@ void DownloadDatabase::RemoveDownloadsBetween(base::Time delete_begin, statement.Run(); } -void DownloadDatabase::SearchDownloads(std::vector<int64>* results, - const string16& search_text) { - sql::Statement statement(GetDB().GetCachedStatement(SQL_FROM_HERE, - "SELECT id FROM downloads WHERE url LIKE ? " - "OR full_path LIKE ? ORDER BY id")); - if (!statement) - return; - - std::string text("%"); - text.append(UTF16ToUTF8(search_text)); - text.push_back('%'); - statement.BindString(0, text); - statement.BindString(1, text); - - while (statement.Step()) - results->push_back(statement.ColumnInt64(0)); -} - } // namespace history diff --git a/chrome/browser/history/download_database.h b/chrome/browser/history/download_database.h index 3f2bd97..56f650a 100644 --- a/chrome/browser/history/download_database.h +++ b/chrome/browser/history/download_database.h @@ -51,10 +51,6 @@ class DownloadDatabase { // all downloads that are in progress or are waiting to be cancelled. void RemoveDownloadsBetween(base::Time remove_begin, base::Time remove_end); - // Search for downloads matching the search text. - void SearchDownloads(std::vector<int64>* results, - const string16& search_text); - protected: // Returns the database for the functions in this interface. virtual sql::Connection& GetDB() = 0; diff --git a/chrome/browser/history/history.cc b/chrome/browser/history/history.cc index c001298..156f9da 100644 --- a/chrome/browser/history/history.cc +++ b/chrome/browser/history/history.cc @@ -539,14 +539,6 @@ void HistoryService::RemoveDownloadsBetween(Time remove_begin, remove_end); } -HistoryService::Handle HistoryService::SearchDownloads( - const string16& search_text, - CancelableRequestConsumerBase* consumer, - DownloadSearchCallback* callback) { - return Schedule(PRIORITY_NORMAL, &HistoryBackend::SearchDownloads, consumer, - new history::DownloadSearchRequest(callback), search_text); -} - HistoryService::Handle HistoryService::QueryHistory( const string16& text_query, const history::QueryOptions& options, diff --git a/chrome/browser/history/history.h b/chrome/browser/history/history.h index bec532a..c142c97 100644 --- a/chrome/browser/history/history.h +++ b/chrome/browser/history/history.h @@ -445,15 +445,6 @@ class HistoryService : public CancelableRequestProvider, // both directions. void RemoveDownloadsBetween(base::Time remove_begin, base::Time remove_end); - // Implemented by the caller of 'SearchDownloads' below, and is called when - // the history system has retrieved the search results. - typedef Callback2<Handle, std::vector<int64>*>::Type DownloadSearchCallback; - - // Search for downloads that match the search text. - Handle SearchDownloads(const string16& search_text, - CancelableRequestConsumerBase* consumer, - DownloadSearchCallback* callback); - // Visit Segments ------------------------------------------------------------ typedef Callback2<Handle, std::vector<PageUsageData*>*>::Type diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc index 1c58f74..91aba75 100644 --- a/chrome/browser/history/history_backend.cc +++ b/chrome/browser/history/history_backend.cc @@ -1126,17 +1126,6 @@ void HistoryBackend::RemoveDownloadsBetween(const Time remove_begin, db_->RemoveDownloadsBetween(remove_begin, remove_end); } -void HistoryBackend::SearchDownloads( - scoped_refptr<DownloadSearchRequest> request, - const string16& search_text) { - if (request->canceled()) - return; - if (db_.get()) - db_->SearchDownloads(&request->value, search_text); - request->ForwardResult(DownloadSearchRequest::TupleType(request->handle(), - &request->value)); -} - void HistoryBackend::QueryHistory(scoped_refptr<QueryHistoryRequest> request, const string16& text_query, const QueryOptions& options) { diff --git a/chrome/browser/history/history_backend.h b/chrome/browser/history/history_backend.h index cf9e076..4d333f3 100644 --- a/chrome/browser/history/history_backend.h +++ b/chrome/browser/history/history_backend.h @@ -225,8 +225,6 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>, void RemoveDownloadsBetween(const base::Time remove_begin, const base::Time remove_end); void RemoveDownloads(const base::Time remove_end); - void SearchDownloads(scoped_refptr<DownloadSearchRequest>, - const string16& search_text); // Segment usage ------------------------------------------------------------- diff --git a/chrome/browser/history/history_marshaling.h b/chrome/browser/history/history_marshaling.h index 30cdbef..64cde29 100644 --- a/chrome/browser/history/history_marshaling.h +++ b/chrome/browser/history/history_marshaling.h @@ -105,10 +105,6 @@ typedef CancelableRequest1<HistoryService::DownloadQueryCallback, typedef CancelableRequest<HistoryService::DownloadCreateCallback> DownloadCreateRequest; -typedef CancelableRequest1<HistoryService::DownloadSearchCallback, - std::vector<int64> > - DownloadSearchRequest; - // Deletion -------------------------------------------------------------------- typedef CancelableRequest<HistoryService::ExpireHistoryCallback> |