| 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 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 content::WebContents* web_contents); | 53 content::WebContents* web_contents); |
| 54 | 54 |
| 55 // Gets the offline header provided when loading the offline page for the | 55 // Gets the offline header provided when loading the offline page for the |
| 56 // given web contents. | 56 // given web contents. |
| 57 static const OfflinePageHeader* GetOfflineHeaderFromWebContents( | 57 static const OfflinePageHeader* GetOfflineHeaderFromWebContents( |
| 58 content::WebContents* web_contents); | 58 content::WebContents* web_contents); |
| 59 | 59 |
| 60 // Returns true if the offline page is shown for previewing purpose. | 60 // Returns true if the offline page is shown for previewing purpose. |
| 61 static bool IsShowingOfflinePreview(content::WebContents* web_contents); | 61 static bool IsShowingOfflinePreview(content::WebContents* web_contents); |
| 62 | 62 |
| 63 // Returns true if download button is shown in the error page. |
| 64 static bool IsShowingDownloadButtonInErrorPage( |
| 65 content::WebContents* web_contents); |
| 66 |
| 63 // Gets an Android Tab ID from a tab containing |web_contents|. Returns false, | 67 // Gets an Android Tab ID from a tab containing |web_contents|. Returns false, |
| 64 // when tab is not available. Returns true otherwise and sets |tab_id| to the | 68 // when tab is not available. Returns true otherwise and sets |tab_id| to the |
| 65 // ID of the tab. | 69 // ID of the tab. |
| 66 static bool GetTabId(content::WebContents* web_contents, int* tab_id); | 70 static bool GetTabId(content::WebContents* web_contents, int* tab_id); |
| 67 | 71 |
| 68 // Performs a check, whether pages with specified |url| and |name_space| | 72 // Performs a check, whether pages with specified |url| and |name_space| |
| 69 // already exist. Result is returned in a |callback|, where first parameter | 73 // already exist. Result is returned in a |callback|, where first parameter |
| 70 // indicates whether offline pages exist, while second is a helper value to | 74 // indicates whether offline pages exist, while second is a helper value to |
| 71 // report UMA, indicating the time the latest existing page with such | 75 // report UMA, indicating the time the latest existing page with such |
| 72 // parameters was saved. | 76 // parameters was saved. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 89 | 93 |
| 90 static bool EqualsIgnoringFragment(const GURL& lhs, const GURL& rhs); | 94 static bool EqualsIgnoringFragment(const GURL& lhs, const GURL& rhs); |
| 91 | 95 |
| 92 static void StartOfflinePageDownload(content::BrowserContext* context, | 96 static void StartOfflinePageDownload(content::BrowserContext* context, |
| 93 const GURL& url); | 97 const GURL& url); |
| 94 }; | 98 }; |
| 95 | 99 |
| 96 } // namespace offline_pages | 100 } // namespace offline_pages |
| 97 | 101 |
| 98 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_UTILS_H_ | 102 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_UTILS_H_ |
| OLD | NEW |