| 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 #include "components/offline_pages/offline_page_item.h" | 5 #include "components/offline_pages/offline_page_item.h" |
| 6 | 6 |
| 7 #include "net/base/filename_util.h" | |
| 8 | |
| 9 namespace offline_pages { | 7 namespace offline_pages { |
| 10 | 8 |
| 11 ClientId::ClientId() : name_space(""), id("") {} | 9 ClientId::ClientId() : name_space(""), id("") {} |
| 12 | 10 |
| 13 ClientId::ClientId(std::string name_space, std::string id) | 11 ClientId::ClientId(std::string name_space, std::string id) |
| 14 : name_space(name_space), id(id) {} | 12 : name_space(name_space), id(id) {} |
| 15 | 13 |
| 16 bool ClientId::operator==(const ClientId& client_id) const { | 14 bool ClientId::operator==(const ClientId& client_id) const { |
| 17 return name_space == client_id.name_space && id == client_id.id; | 15 return name_space == client_id.name_space && id == client_id.id; |
| 18 } | 16 } |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 client_id == other.client_id && | 65 client_id == other.client_id && |
| 68 file_path == other.file_path && | 66 file_path == other.file_path && |
| 69 creation_time == other.creation_time && | 67 creation_time == other.creation_time && |
| 70 last_access_time == other.last_access_time && | 68 last_access_time == other.last_access_time && |
| 71 expiration_time == other.expiration_time && | 69 expiration_time == other.expiration_time && |
| 72 access_count == other.access_count && | 70 access_count == other.access_count && |
| 73 title == other.title && | 71 title == other.title && |
| 74 flags == other.flags; | 72 flags == other.flags; |
| 75 } | 73 } |
| 76 | 74 |
| 77 GURL OfflinePageItem::GetOfflineURL() const { | |
| 78 return net::FilePathToFileURL(file_path); | |
| 79 } | |
| 80 | |
| 81 bool OfflinePageItem::IsExpired() const { | 75 bool OfflinePageItem::IsExpired() const { |
| 82 return creation_time < expiration_time; | 76 return creation_time < expiration_time; |
| 83 } | 77 } |
| 84 | 78 |
| 85 } // namespace offline_pages | 79 } // namespace offline_pages |
| OLD | NEW |