Chromium Code Reviews| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 61 | 61 |
| 62 // Returns true if download button is shown in the error page. | 62 // Returns true if download button is shown in the error page. |
| 63 static bool IsShowingDownloadButtonInErrorPage( | 63 static bool IsShowingDownloadButtonInErrorPage( |
| 64 content::WebContents* web_contents); | 64 content::WebContents* web_contents); |
| 65 | 65 |
| 66 // Gets an Android Tab ID from a tab containing |web_contents|. Returns false, | 66 // Gets an Android Tab ID from a tab containing |web_contents|. Returns false, |
| 67 // when tab is not available. Returns true otherwise and sets |tab_id| to the | 67 // when tab is not available. Returns true otherwise and sets |tab_id| to the |
| 68 // ID of the tab. | 68 // ID of the tab. |
| 69 static bool GetTabId(content::WebContents* web_contents, int* tab_id); | 69 static bool GetTabId(content::WebContents* web_contents, int* tab_id); |
| 70 | 70 |
| 71 // Returns true if the |web_contents| is currently being presented inside a | |
| 72 // custom tab. | |
| 73 static bool IsCurrentlyACustomTab(content::WebContents* web_contents); | |
|
dewittj
2017/03/27 20:37:45
nit: a web contents isn't a custom tab, it is show
gone
2017/03/27 22:22:10
+1
carlosk
2017/03/28 02:00:32
Done.
| |
| 74 | |
| 71 // Performs a check, whether pages with specified |url| and |name_space| | 75 // Performs a check, whether pages with specified |url| and |name_space| |
| 72 // already exist. Result is returned in a |callback|, where first parameter | 76 // already exist. Result is returned in a |callback|, where first parameter |
| 73 // indicates whether offline pages exist, while second is a helper value to | 77 // indicates whether offline pages exist, while second is a helper value to |
| 74 // report UMA, indicating the time the latest existing page with such | 78 // report UMA, indicating the time the latest existing page with such |
| 75 // parameters was saved. | 79 // parameters was saved. |
| 76 static void CheckExistenceOfPagesWithURL( | 80 static void CheckExistenceOfPagesWithURL( |
| 77 content::BrowserContext* browser_context, | 81 content::BrowserContext* browser_context, |
| 78 const std::string name_space, | 82 const std::string name_space, |
| 79 const GURL& url, | 83 const GURL& url, |
| 80 const PagesExistCallback& callback); | 84 const PagesExistCallback& callback); |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 96 const GURL& url); | 100 const GURL& url); |
| 97 | 101 |
| 98 // Returns original URL of the given web contents. Empty URL is returned if | 102 // Returns original URL of the given web contents. Empty URL is returned if |
| 99 // no redirect occurred. | 103 // no redirect occurred. |
| 100 static GURL GetOriginalURLFromWebContents(content::WebContents* web_contents); | 104 static GURL GetOriginalURLFromWebContents(content::WebContents* web_contents); |
| 101 }; | 105 }; |
| 102 | 106 |
| 103 } // namespace offline_pages | 107 } // namespace offline_pages |
| 104 | 108 |
| 105 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_UTILS_H_ | 109 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_UTILS_H_ |
| OLD | NEW |