| 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 CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_UTILS_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_UTILS_H_ |
| 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_UTILS_H_ | 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_UTILS_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 class GURL; | 10 class GURL; |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 class BrowserContext; | 13 class BrowserContext; |
| 14 } | 14 } |
| 15 | 15 |
| 16 namespace offline_pages { | 16 namespace offline_pages { |
| 17 struct OfflinePageItem; | 17 struct OfflinePageItem; |
| 18 | 18 |
| 19 class OfflinePageUtils { | 19 class OfflinePageUtils { |
| 20 public: | 20 public: |
| 21 // Returns true if saving an offline snapshot may be attempted for |url|. |
| 22 static bool CanSaveURL(const GURL& url); |
| 23 |
| 21 // Returns true if |url| might point to an offline page. | 24 // Returns true if |url| might point to an offline page. |
| 22 static bool MightBeOfflineURL(const GURL& url); | 25 static bool MightBeOfflineURL(const GURL& url); |
| 23 | 26 |
| 24 // Gets an offline URL of an offline page with |online_url| if one exists. | 27 // Gets an offline URL of an offline page with |online_url| if one exists. |
| 25 static GURL GetOfflineURLForOnlineURL( | 28 static GURL GetOfflineURLForOnlineURL( |
| 26 content::BrowserContext* browser_context, | 29 content::BrowserContext* browser_context, |
| 27 const GURL& online_url); | 30 const GURL& online_url); |
| 28 | 31 |
| 29 // Gets an online URL of an offline page with |offline_url| if one exists. | 32 // Gets an online URL of an offline page with |offline_url| if one exists. |
| 30 static GURL GetOnlineURLForOfflineURL( | 33 static GURL GetOnlineURLForOfflineURL( |
| (...skipping 10 matching lines...) Expand all Loading... |
| 41 const GURL& online_url); | 44 const GURL& online_url); |
| 42 | 45 |
| 43 // Marks that the offline page related to the |offline_url| has been accessed. | 46 // Marks that the offline page related to the |offline_url| has been accessed. |
| 44 static void MarkPageAccessed(content::BrowserContext* browser_context, | 47 static void MarkPageAccessed(content::BrowserContext* browser_context, |
| 45 const GURL& offline_url); | 48 const GURL& offline_url); |
| 46 }; | 49 }; |
| 47 | 50 |
| 48 } // namespace offline_pages | 51 } // namespace offline_pages |
| 49 | 52 |
| 50 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_UTILS_H_ | 53 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_UTILS_H_ |
| OLD | NEW |