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

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: Remove unintended changes. 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_bookmark_observer.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
35 class ClientPolicyController;
36
31 // Service for saving pages offline, storing the offline copy and metadata, and 37 // Service for saving pages offline, storing the offline copy and metadata, and
32 // retrieving them upon request. 38 // retrieving them upon request.
33 // 39 //
34 // Example usage: 40 // Example usage:
35 // class ArchiverImpl : public OfflinePageArchiver { 41 // class ArchiverImpl : public OfflinePageArchiver {
36 // // This is a class that knows how to create archiver 42 // // This is a class that knows how to create archiver
37 // void CreateArchiver(...) override; 43 // void CreateArchiver(...) override;
38 // ... 44 // ...
39 // } 45 // }
40 // 46 //
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 // metadata will be expired. If an archive file is discovered missing its 192 // metadata will be expired. If an archive file is discovered missing its
187 // offline page, it will be deleted. 193 // offline page, it will be deleted.
188 virtual void CheckMetadataConsistency() = 0; 194 virtual void CheckMetadataConsistency() = 0;
189 195
190 // Marks pages with |offline_ids| as expired and deletes the associated 196 // Marks pages with |offline_ids| as expired and deletes the associated
191 // archive files. 197 // archive files.
192 virtual void ExpirePages(const std::vector<int64_t>& offline_ids, 198 virtual void ExpirePages(const std::vector<int64_t>& offline_ids,
193 const base::Time& expiration_time, 199 const base::Time& expiration_time,
194 const base::Callback<void(bool)>& callback) = 0; 200 const base::Callback<void(bool)>& callback) = 0;
195 201
202 // Expire the offline page whose associated bookmark was deleted.
203 virtual void ExpireRemovedBookmarkPage(
204 const bookmarks::BookmarkNode* node) = 0;
205
206 // Get the bookmark model observer.
207 virtual OfflinePageBookmarkObserver* GetBookmarkObserver() = 0;
208
196 // Returns the policy controller. 209 // Returns the policy controller.
197 virtual ClientPolicyController* GetPolicyController() = 0; 210 virtual ClientPolicyController* GetPolicyController() = 0;
198 211
199 // TODO(dougarnett): Remove this and its uses. 212 // TODO(dougarnett): Remove this and its uses.
200 virtual bool is_loaded() const = 0; 213 virtual bool is_loaded() const = 0;
201 214
202 // Returns the logger. Ownership is retained by the model. 215 // Returns the logger. Ownership is retained by the model.
203 virtual OfflineEventLogger* GetLogger() = 0; 216 virtual OfflineEventLogger* GetLogger() = 0;
204 }; 217 };
205 218
206 } // namespace offline_pages 219 } // namespace offline_pages
207 220
208 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ 221 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698