| 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_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 Loading... |
| 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 Loading... |
| 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_ |
| OLD | NEW |