Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_UTILS_H_ | |
| 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_UTILS_H_ | |
| 7 | |
| 8 #include "base/basictypes.h" | |
| 9 | |
| 10 class GURL; | |
| 11 | |
| 12 namespace content { | |
| 13 class BrowserContext; | |
| 14 } | |
| 15 | |
| 16 namespace offline_pages { | |
| 17 struct OfflinePageItem; | |
| 18 | |
| 19 class OfflinePageUtils { | |
| 20 public: | |
| 21 // Returns true if |url| might point to an offline page. | |
| 22 static bool MightBeOfflineURL(const GURL& url); | |
| 23 | |
| 24 // Gets an offline URL of an offline page with |online_url| if one is present | |
| 25 // in the |browser_context|. | |
| 26 static GURL GetOfflineURLByOnlineURL(content::BrowserContext* browser_context, | |
|
newt (away)
2015/12/17 03:08:45
"By" doesn't seem like the right preposition. Mayb
fgorski
2015/12/17 19:00:14
Done.
| |
| 27 const GURL& online_url); | |
| 28 | |
| 29 // Gets an online URL of an offline page with |offline_url| if one is present | |
| 30 // in | |
|
newt (away)
2015/12/17 03:08:45
nit: wrapping
fgorski
2015/12/17 19:00:14
Done.
| |
| 31 // the |browser_context|. | |
| 32 static GURL GetOnlineURLByOfflineURL(content::BrowserContext* browser_context, | |
| 33 const GURL& offline_url); | |
| 34 | |
| 35 // Gets a bookmark ID related to the |offline_url|. | |
| 36 static int64 GetBookmarkIdByOfflineURL( | |
| 37 content::BrowserContext* browser_context, | |
| 38 const GURL& offline_url); | |
| 39 | |
| 40 // Checks whether a given |offline_url| points to an offline page. | |
|
jianli
2015/12/16 23:08:07
nit: drop "given"
fgorski
2015/12/17 19:00:14
Done.
| |
| 41 static bool IsOfflinePage(content::BrowserContext* browser_context, | |
| 42 const GURL& offline_url); | |
| 43 | |
| 44 // Checks whether a given |online_url| has a related offline page. | |
|
jianli
2015/12/16 23:08:07
nit: "related to" sounds a bit not intuitive. Also
fgorski
2015/12/17 19:00:14
Done.
| |
| 45 static bool HasOfflinePageForOnlineURL( | |
| 46 content::BrowserContext* browser_context, | |
| 47 const GURL& online_url); | |
| 48 | |
| 49 // Checks if there are any offline pages saved in the |browser_context| | |
|
jianli
2015/12/16 23:08:07
nit: suggest dropping the comment for browser_cont
fgorski
2015/12/17 19:00:14
Done.
| |
| 50 static const bool HasOfflinePages(content::BrowserContext* browser_context); | |
| 51 }; | |
| 52 | |
| 53 } // namespace offline_pages | |
| 54 | |
| 55 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_UTILS_H_ | |
| OLD | NEW |