From 33b61bcc0c64b4d44377f86df8746b54f2bce01b Mon Sep 17 00:00:00 2001 From: "jochen@chromium.org" Date: Thu, 10 Jun 2010 12:55:00 +0000 Subject: Wrappers around BrowsingDataHelpers that returned canned responses. BUG=45230 TEST=CannedBrowsingData*HelperTest.* Review URL: http://codereview.chromium.org/2707001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49388 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/browsing_data_database_helper.cc | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'chrome/browser/browsing_data_database_helper.cc') diff --git a/chrome/browser/browsing_data_database_helper.cc b/chrome/browser/browsing_data_database_helper.cc index 7ff2428..27549f5 100644 --- a/chrome/browser/browsing_data_database_helper.cc +++ b/chrome/browser/browsing_data_database_helper.cc @@ -110,3 +110,29 @@ void BrowsingDataDatabaseHelper::DeleteDatabaseInFileThread( return; tracker_->DeleteDatabase(UTF8ToUTF16(origin), UTF8ToUTF16(name), NULL); } + +CannedBrowsingDataDatabaseHelper::CannedBrowsingDataDatabaseHelper( + Profile* profile) + : BrowsingDataDatabaseHelper(profile) { +} + +void CannedBrowsingDataDatabaseHelper::AddDatabase( + const GURL& origin, + const std::string& name, + const std::string& description) { + WebKit::WebSecurityOrigin web_security_origin = + WebKit::WebSecurityOrigin::createFromString( + UTF8ToUTF16(origin.spec())); + database_info_.push_back(DatabaseInfo( + web_security_origin.host().utf8(), + name, + web_security_origin.databaseIdentifier().utf8(), + description, + 0, + base::Time())); +} + +void CannedBrowsingDataDatabaseHelper::StartFetching( + Callback1& >::Type* callback) { + callback->Run(database_info_); +} -- cgit v1.1