OLD | NEW |
1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2017 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 // The Safe Browsing service is responsible for downloading anti-phishing and | 5 // The Safe Browsing service is responsible for downloading anti-phishing and |
6 // anti-malware tables and checking urls against them. This is android_webview | 6 // anti-malware tables and checking urls against them. This is android_webview |
7 // specific ui_manager. | 7 // specific ui_manager. |
8 | 8 |
9 #ifndef ANDROID_WEBVIEW_BROWSER_AW_SAFE_BROWSING_UI_MANAGER_H_ | 9 #ifndef ANDROID_WEBVIEW_BROWSER_AW_SAFE_BROWSING_UI_MANAGER_H_ |
10 #define ANDROID_WEBVIEW_BROWSER_AW_SAFE_BROWSING_UI_MANAGER_H_ | 10 #define ANDROID_WEBVIEW_BROWSER_AW_SAFE_BROWSING_UI_MANAGER_H_ |
11 | 11 |
12 #include "components/safe_browsing/base_ui_manager.h" | 12 #include "components/safe_browsing/base_ui_manager.h" |
13 #include "content/public/browser/web_contents.h" | 13 #include "content/public/browser/web_contents.h" |
14 | 14 |
15 namespace android_webview { | 15 namespace android_webview { |
16 | 16 |
17 class AwSafeBrowsingUIManager : public safe_browsing::BaseUIManager { | 17 class AwSafeBrowsingUIManager : public safe_browsing::BaseUIManager { |
18 public: | 18 public: |
19 class UIManagerClient { | 19 class UIManagerClient { |
20 public: | 20 public: |
21 static UIManagerClient* FromWebContents(content::WebContents* web_contents); | 21 static UIManagerClient* FromWebContents(content::WebContents* web_contents); |
22 | 22 |
23 // Whether this web contents can show an interstitial | 23 // Whether this web contents can show a loud interstitial |
24 virtual bool CanShowBigInterstitial() = 0; | 24 virtual bool CanShowBigInterstitial() = 0; |
| 25 |
| 26 // Whether this web contents can show any sort of interstitial |
| 27 virtual bool CanShowInterstitial() = 0; |
| 28 |
| 29 // Whether this web contents extends outside of the application window |
| 30 virtual bool ExtendsOutOfWindow() = 0; |
25 }; | 31 }; |
26 | 32 |
27 // Construction needs to happen on the UI thread. | 33 // Construction needs to happen on the UI thread. |
28 AwSafeBrowsingUIManager(); | 34 AwSafeBrowsingUIManager(); |
29 | 35 |
30 void DisplayBlockingPage(const UnsafeResource& resource) override; | 36 void DisplayBlockingPage(const UnsafeResource& resource) override; |
31 | 37 |
| 38 // Indicates if we should use a loud or quiet error page |
| 39 bool IsLoud(const UnsafeResource& resource) const; |
| 40 |
| 41 // Indicates if the WebView extends off the screen or not |
| 42 bool IsGiant(const UnsafeResource& resource) const; |
| 43 |
32 protected: | 44 protected: |
33 ~AwSafeBrowsingUIManager() override; | 45 ~AwSafeBrowsingUIManager() override; |
34 | 46 |
35 void ShowBlockingPageForResource(const UnsafeResource& resource) override; | 47 void ShowBlockingPageForResource(const UnsafeResource& resource) override; |
36 | 48 |
37 private: | 49 private: |
38 DISALLOW_COPY_AND_ASSIGN(AwSafeBrowsingUIManager); | 50 DISALLOW_COPY_AND_ASSIGN(AwSafeBrowsingUIManager); |
39 }; | 51 }; |
40 | 52 |
41 } // namespace android_webview | 53 } // namespace android_webview |
42 | 54 |
43 #endif // ANDROID_WEBVIEW_BROWSER_AW_SAFE_BROWSING_UI_MANAGER_H_ | 55 #endif // ANDROID_WEBVIEW_BROWSER_AW_SAFE_BROWSING_UI_MANAGER_H_ |
OLD | NEW |