| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "chrome/browser/browsing_data_database_helper.h" | 5 #include "chrome/browser/browsing_data_database_helper.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 for (std::vector<string16>::const_iterator db = databases.begin(); | 70 for (std::vector<string16>::const_iterator db = databases.begin(); |
| 71 db != databases.end(); ++db) { | 71 db != databases.end(); ++db) { |
| 72 FilePath file_path = tracker_->GetFullDBFilePath(ori->GetOrigin(), *db); | 72 FilePath file_path = tracker_->GetFullDBFilePath(ori->GetOrigin(), *db); |
| 73 file_util::FileInfo file_info; | 73 file_util::FileInfo file_info; |
| 74 if (file_util::GetFileInfo(file_path, &file_info)) { | 74 if (file_util::GetFileInfo(file_path, &file_info)) { |
| 75 database_info_.push_back(DatabaseInfo( | 75 database_info_.push_back(DatabaseInfo( |
| 76 web_security_origin.host().utf8(), | 76 web_security_origin.host().utf8(), |
| 77 UTF16ToUTF8(*db), | 77 UTF16ToUTF8(*db), |
| 78 origin_identifier, | 78 origin_identifier, |
| 79 UTF16ToUTF8(ori->GetDatabaseDescription(*db)), | 79 UTF16ToUTF8(ori->GetDatabaseDescription(*db)), |
| 80 web_security_origin.toString().utf8(), |
| 80 file_info.size, | 81 file_info.size, |
| 81 file_info.last_modified)); | 82 file_info.last_modified)); |
| 82 } | 83 } |
| 83 } | 84 } |
| 84 } | 85 } |
| 85 } | 86 } |
| 86 | 87 |
| 87 ChromeThread::PostTask(ChromeThread::UI, FROM_HERE, NewRunnableMethod( | 88 ChromeThread::PostTask(ChromeThread::UI, FROM_HERE, NewRunnableMethod( |
| 88 this, &BrowsingDataDatabaseHelper::NotifyInUIThread)); | 89 this, &BrowsingDataDatabaseHelper::NotifyInUIThread)); |
| 89 } | 90 } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 if (database->origin_identifier == origin_identifier && | 131 if (database->origin_identifier == origin_identifier && |
| 131 database->database_name == name) | 132 database->database_name == name) |
| 132 return; | 133 return; |
| 133 } | 134 } |
| 134 | 135 |
| 135 database_info_.push_back(DatabaseInfo( | 136 database_info_.push_back(DatabaseInfo( |
| 136 web_security_origin.host().utf8(), | 137 web_security_origin.host().utf8(), |
| 137 name, | 138 name, |
| 138 origin_identifier, | 139 origin_identifier, |
| 139 description, | 140 description, |
| 141 web_security_origin.toString().utf8(), |
| 140 0, | 142 0, |
| 141 base::Time())); | 143 base::Time())); |
| 142 } | 144 } |
| 143 | 145 |
| 144 void CannedBrowsingDataDatabaseHelper::Reset() { | 146 void CannedBrowsingDataDatabaseHelper::Reset() { |
| 145 database_info_.clear(); | 147 database_info_.clear(); |
| 146 } | 148 } |
| 147 | 149 |
| 148 void CannedBrowsingDataDatabaseHelper::StartFetching( | 150 void CannedBrowsingDataDatabaseHelper::StartFetching( |
| 149 Callback1<const std::vector<DatabaseInfo>& >::Type* callback) { | 151 Callback1<const std::vector<DatabaseInfo>& >::Type* callback) { |
| 150 callback->Run(database_info_); | 152 callback->Run(database_info_); |
| 151 } | 153 } |
| OLD | NEW |