| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_ITEM_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_ITEM_H_ |
| 6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_ITEM_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_ITEM_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 const ClientId& client_id, | 48 const ClientId& client_id, |
| 49 const base::FilePath& file_path, | 49 const base::FilePath& file_path, |
| 50 int64_t file_size, | 50 int64_t file_size, |
| 51 const base::Time& creation_time); | 51 const base::Time& creation_time); |
| 52 OfflinePageItem(const OfflinePageItem& other); | 52 OfflinePageItem(const OfflinePageItem& other); |
| 53 ~OfflinePageItem(); | 53 ~OfflinePageItem(); |
| 54 | 54 |
| 55 // Gets a URL of the file under |file_path|. | 55 // Gets a URL of the file under |file_path|. |
| 56 GURL GetOfflineURL() const; | 56 GURL GetOfflineURL() const; |
| 57 | 57 |
| 58 // Returns true if the page has been marked for deletion. This allows an undo | |
| 59 // in a short time period. After that, the marked page will be deleted. | |
| 60 bool IsMarkedForDeletion() const; | |
| 61 | |
| 62 // Sets/clears the mark for deletion. | |
| 63 void MarkForDeletion(); | |
| 64 void ClearMarkForDeletion(); | |
| 65 | |
| 66 // The URL of the page. | 58 // The URL of the page. |
| 67 GURL url; | 59 GURL url; |
| 68 // The primary key/ID for this page in offline pages internal database. | 60 // The primary key/ID for this page in offline pages internal database. |
| 69 int64_t offline_id; | 61 int64_t offline_id; |
| 70 | 62 |
| 71 // The Client ID (external) related to the offline page. This is opaque | 63 // The Client ID (external) related to the offline page. This is opaque |
| 72 // to our system, but useful for users of offline pages who want to map | 64 // to our system, but useful for users of offline pages who want to map |
| 73 // their ids to our saved pages. | 65 // their ids to our saved pages. |
| 74 ClientId client_id; | 66 ClientId client_id; |
| 75 | 67 |
| 76 // Version of the offline page item. | 68 // Version of the offline page item. |
| 77 int version; | 69 int version; |
| 78 // The file path to the archive with a local copy of the page. | 70 // The file path to the archive with a local copy of the page. |
| 79 base::FilePath file_path; | 71 base::FilePath file_path; |
| 80 // The size of the offline copy. | 72 // The size of the offline copy. |
| 81 int64_t file_size; | 73 int64_t file_size; |
| 82 // The time when the offline archive was created. | 74 // The time when the offline archive was created. |
| 83 base::Time creation_time; | 75 base::Time creation_time; |
| 84 // The time when the offline archive was last accessed. | 76 // The time when the offline archive was last accessed. |
| 85 base::Time last_access_time; | 77 base::Time last_access_time; |
| 86 // Number of times that the offline archive has been accessed. | 78 // Number of times that the offline archive has been accessed. |
| 87 int access_count; | 79 int access_count; |
| 88 // Flags about the state and behavior of the offline page. | 80 // Flags about the state and behavior of the offline page. |
| 89 Flags flags; | 81 Flags flags; |
| 90 }; | 82 }; |
| 91 | 83 |
| 92 } // namespace offline_pages | 84 } // namespace offline_pages |
| 93 | 85 |
| 94 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_ITEM_H_ | 86 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_ITEM_H_ |
| OLD | NEW |