| 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 #ifndef CHROME_BROWSER_BROWSING_DATA_DATABASE_HELPER_H_ | 5 #ifndef CHROME_BROWSER_BROWSING_DATA_DATABASE_HELPER_H_ |
| 6 #define CHROME_BROWSER_BROWSING_DATA_DATABASE_HELPER_H_ | 6 #define CHROME_BROWSER_BROWSING_DATA_DATABASE_HELPER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 class BrowsingDataDatabaseHelper | 26 class BrowsingDataDatabaseHelper |
| 27 : public base::RefCountedThreadSafe<BrowsingDataDatabaseHelper> { | 27 : public base::RefCountedThreadSafe<BrowsingDataDatabaseHelper> { |
| 28 public: | 28 public: |
| 29 // Contains detailed information about a web database. | 29 // Contains detailed information about a web database. |
| 30 struct DatabaseInfo { | 30 struct DatabaseInfo { |
| 31 DatabaseInfo() {} | 31 DatabaseInfo() {} |
| 32 DatabaseInfo(const std::string& host, | 32 DatabaseInfo(const std::string& host, |
| 33 const std::string& database_name, | 33 const std::string& database_name, |
| 34 const std::string& origin_identifier, | 34 const std::string& origin_identifier, |
| 35 const std::string& description, | 35 const std::string& description, |
| 36 const std::string& origin, |
| 36 int64 size, | 37 int64 size, |
| 37 base::Time last_modified) | 38 base::Time last_modified) |
| 38 : host(host), | 39 : host(host), |
| 39 database_name(database_name), | 40 database_name(database_name), |
| 40 origin_identifier(origin_identifier), | 41 origin_identifier(origin_identifier), |
| 41 description(description), | 42 description(description), |
| 43 origin(origin), |
| 42 size(size), | 44 size(size), |
| 43 last_modified(last_modified) { | 45 last_modified(last_modified) { |
| 44 } | 46 } |
| 45 | 47 |
| 46 bool IsFileSchemeData() { | 48 bool IsFileSchemeData() { |
| 47 return StartsWithASCII(origin_identifier, | 49 return StartsWithASCII(origin_identifier, |
| 48 std::string(chrome::kFileScheme), | 50 std::string(chrome::kFileScheme), |
| 49 true); | 51 true); |
| 50 } | 52 } |
| 51 | 53 |
| 52 std::string host; | 54 std::string host; |
| 53 std::string database_name; | 55 std::string database_name; |
| 54 std::string origin_identifier; | 56 std::string origin_identifier; |
| 55 std::string description; | 57 std::string description; |
| 58 std::string origin; |
| 56 int64 size; | 59 int64 size; |
| 57 base::Time last_modified; | 60 base::Time last_modified; |
| 58 }; | 61 }; |
| 59 | 62 |
| 60 explicit BrowsingDataDatabaseHelper(Profile* profile); | 63 explicit BrowsingDataDatabaseHelper(Profile* profile); |
| 61 | 64 |
| 62 // Starts the fetching process, which will notify its completion via | 65 // Starts the fetching process, which will notify its completion via |
| 63 // callback. | 66 // callback. |
| 64 // This must be called only in the UI thread. | 67 // This must be called only in the UI thread. |
| 65 virtual void StartFetching( | 68 virtual void StartFetching( |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 Callback1<const std::vector<DatabaseInfo>& >::Type* callback); | 132 Callback1<const std::vector<DatabaseInfo>& >::Type* callback); |
| 130 virtual void CancelNotification() {} | 133 virtual void CancelNotification() {} |
| 131 | 134 |
| 132 private: | 135 private: |
| 133 virtual ~CannedBrowsingDataDatabaseHelper() {} | 136 virtual ~CannedBrowsingDataDatabaseHelper() {} |
| 134 | 137 |
| 135 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataDatabaseHelper); | 138 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataDatabaseHelper); |
| 136 }; | 139 }; |
| 137 | 140 |
| 138 #endif // CHROME_BROWSER_BROWSING_DATA_DATABASE_HELPER_H_ | 141 #endif // CHROME_BROWSER_BROWSING_DATA_DATABASE_HELPER_H_ |
| OLD | NEW |