Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(268)

Side by Side Diff: components/offline_pages/offline_page_model.h

Issue 2185973003: [Offline Pages] Delete associated page along with bookmark. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding offline_pages::ExternalListener. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_MODEL_H_ 5 #ifndef COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_
6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ 6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <set> 11 #include <set>
12 #include <string> 12 #include <string>
13 #include <vector> 13 #include <vector>
14 14
15 #include "base/supports_user_data.h" 15 #include "base/supports_user_data.h"
16 #include "components/offline_pages/offline_event_logger.h" 16 #include "components/offline_pages/offline_event_logger.h"
17 #include "components/offline_pages/offline_page_archiver.h" 17 #include "components/offline_pages/offline_page_archiver.h"
18 #include "components/offline_pages/offline_page_storage_manager.h" 18 #include "components/offline_pages/offline_page_storage_manager.h"
19 #include "components/offline_pages/offline_page_types.h" 19 #include "components/offline_pages/offline_page_types.h"
20 20
21 class GURL; 21 class GURL;
22 namespace base { 22 namespace base {
23 class Time; 23 class Time;
24 } // namespace base 24 } // namespace base
25 25
26 namespace bookmarks {
27 class BookmarkNode;
28 } // namespace bookmarks
29
26 namespace offline_pages { 30 namespace offline_pages {
27 31
28 struct ClientId; 32 struct ClientId;
29 struct OfflinePageItem; 33 struct OfflinePageItem;
30 34
31 // Service for saving pages offline, storing the offline copy and metadata, and 35 // Service for saving pages offline, storing the offline copy and metadata, and
32 // retrieving them upon request. 36 // retrieving them upon request.
33 // 37 //
34 // Example usage: 38 // Example usage:
35 // class ArchiverImpl : public OfflinePageArchiver { 39 // class ArchiverImpl : public OfflinePageArchiver {
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 // metadata will be expired. If an archive file is discovered missing its 190 // metadata will be expired. If an archive file is discovered missing its
187 // offline page, it will be deleted. 191 // offline page, it will be deleted.
188 virtual void CheckMetadataConsistency() = 0; 192 virtual void CheckMetadataConsistency() = 0;
189 193
190 // Marks pages with |offline_ids| as expired and deletes the associated 194 // Marks pages with |offline_ids| as expired and deletes the associated
191 // archive files. 195 // archive files.
192 virtual void ExpirePages(const std::vector<int64_t>& offline_ids, 196 virtual void ExpirePages(const std::vector<int64_t>& offline_ids,
193 const base::Time& expiration_time, 197 const base::Time& expiration_time,
194 const base::Callback<void(bool)>& callback) = 0; 198 const base::Callback<void(bool)>& callback) = 0;
195 199
200 // Expire the offline page whose associated bookmark was deleted.
201 virtual void ExpireRemovedBookmarkPage(
202 const bookmarks::BookmarkNode* node) = 0;
203
196 // Returns the policy controller. 204 // Returns the policy controller.
197 virtual ClientPolicyController* GetPolicyController() = 0; 205 virtual ClientPolicyController* GetPolicyController() = 0;
198 206
199 // TODO(dougarnett): Remove this and its uses. 207 // TODO(dougarnett): Remove this and its uses.
200 virtual bool is_loaded() const = 0; 208 virtual bool is_loaded() const = 0;
201 209
202 // Returns the logger. Ownership is retained by the model. 210 // Returns the logger. Ownership is retained by the model.
203 virtual OfflineEventLogger* GetLogger() = 0; 211 virtual OfflineEventLogger* GetLogger() = 0;
204 }; 212 };
205 213
206 } // namespace offline_pages 214 } // namespace offline_pages
207 215
208 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ 216 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698