| 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 "base/basictypes.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 |url| might point to an offline page. | 21 // Returns true if |url| might point to an offline page. |
| 22 static bool MightBeOfflineURL(const GURL& url); | 22 static bool MightBeOfflineURL(const GURL& url); |
| 23 | 23 |
| 24 // Gets an offline URL of an offline page with |online_url| if one exists. | 24 // Gets an offline URL of an offline page with |online_url| if one exists. |
| 25 static GURL GetOfflineURLForOnlineURL( | 25 static GURL GetOfflineURLForOnlineURL( |
| 26 content::BrowserContext* browser_context, | 26 content::BrowserContext* browser_context, |
| 27 const GURL& online_url); | 27 const GURL& online_url); |
| 28 | 28 |
| 29 // Gets an online URL of an offline page with |offline_url| if one exists. | 29 // Gets an online URL of an offline page with |offline_url| if one exists. |
| 30 static GURL GetOnlineURLForOfflineURL( | 30 static GURL GetOnlineURLForOfflineURL( |
| 31 content::BrowserContext* browser_context, | 31 content::BrowserContext* browser_context, |
| 32 const GURL& offline_url); | 32 const GURL& offline_url); |
| 33 | 33 |
| 34 // Gets a bookmark ID related to the |offline_url|. | 34 // Gets a bookmark ID related to the |offline_url|. |
| 35 static int64 GetBookmarkIdForOfflineURL( | 35 static int64_t GetBookmarkIdForOfflineURL( |
| 36 content::BrowserContext* browser_context, | 36 content::BrowserContext* browser_context, |
| 37 const GURL& offline_url); | 37 const GURL& offline_url); |
| 38 | 38 |
| 39 // Checks whether |offline_url| points to an offline page. | 39 // Checks whether |offline_url| points to an offline page. |
| 40 static bool IsOfflinePage(content::BrowserContext* browser_context, | 40 static bool IsOfflinePage(content::BrowserContext* browser_context, |
| 41 const GURL& offline_url); | 41 const GURL& offline_url); |
| 42 | 42 |
| 43 // Checks whether offline page for |online_url| exists. | 43 // Checks whether offline page for |online_url| exists. |
| 44 static bool HasOfflinePageForOnlineURL( | 44 static bool HasOfflinePageForOnlineURL( |
| 45 content::BrowserContext* browser_context, | 45 content::BrowserContext* browser_context, |
| 46 const GURL& online_url); | 46 const GURL& online_url); |
| 47 | 47 |
| 48 // Checks whether any offline page is saved. | 48 // Checks whether any offline page is saved. |
| 49 static const bool HasOfflinePages(content::BrowserContext* browser_context); | 49 static const bool HasOfflinePages(content::BrowserContext* browser_context); |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 } // namespace offline_pages | 52 } // namespace offline_pages |
| 53 | 53 |
| 54 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_UTILS_H_ | 54 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_UTILS_H_ |
| OLD | NEW |