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

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

Issue 2067143004: [Offline Pages] Duplicate pages when save/delete bookmarks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moving to model level. Created 4 years, 6 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>
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 using CheckPagesExistOfflineResult = 67 using CheckPagesExistOfflineResult =
68 offline_pages::CheckPagesExistOfflineResult; 68 offline_pages::CheckPagesExistOfflineResult;
69 using MultipleOfflinePageItemResult = 69 using MultipleOfflinePageItemResult =
70 offline_pages::MultipleOfflinePageItemResult; 70 offline_pages::MultipleOfflinePageItemResult;
71 using DeletePageResult = offline_pages::DeletePageResult; 71 using DeletePageResult = offline_pages::DeletePageResult;
72 using SavePageResult = offline_pages::SavePageResult; 72 using SavePageResult = offline_pages::SavePageResult;
73 73
74 // Returns true if saving an offline page may be attempted for |url|. 74 // Returns true if saving an offline page may be attempted for |url|.
75 static bool CanSaveURL(const GURL& url); 75 static bool CanSaveURL(const GURL& url);
76 76
77 // Returns true if the page with |client_id| is initiated by user.
78 static bool IsUserInitiated(const ClientId& client_id);
79
77 OfflinePageModel(); 80 OfflinePageModel();
78 ~OfflinePageModel() override; 81 ~OfflinePageModel() override;
79 82
80 virtual void AddObserver(Observer* observer) = 0; 83 virtual void AddObserver(Observer* observer) = 0;
81 virtual void RemoveObserver(Observer* observer) = 0; 84 virtual void RemoveObserver(Observer* observer) = 0;
82 85
83 // Attempts to save a page addressed by |url| offline. Requires that the model 86 // Attempts to save a page addressed by |url| offline. Requires that the model
84 // is loaded. Generates a new offline id and returns it. 87 // is loaded. Generates a new offline id and returns it.
85 virtual void SavePage(const GURL& url, 88 virtual void SavePage(const GURL& url,
86 const ClientId& client_id, 89 const ClientId& client_id,
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 // Returns the policy controller. 194 // Returns the policy controller.
192 virtual ClientPolicyController* GetPolicyController() = 0; 195 virtual ClientPolicyController* GetPolicyController() = 0;
193 196
194 // TODO(dougarnett): Remove this and its uses. 197 // TODO(dougarnett): Remove this and its uses.
195 virtual bool is_loaded() const = 0; 198 virtual bool is_loaded() const = 0;
196 }; 199 };
197 200
198 } // namespace offline_pages 201 } // namespace offline_pages
199 202
200 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ 203 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_
OLDNEW
« no previous file with comments | « no previous file | components/offline_pages/offline_page_model.cc » ('j') | components/offline_pages/offline_page_model_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698