OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "android_webview/browser/aw_safe_browsing_blocking_page.h" | 5 #include "android_webview/browser/aw_safe_browsing_blocking_page.h" |
6 | 6 |
7 #include "android_webview/browser/aw_safe_browsing_ui_manager.h" | 7 #include "android_webview/browser/aw_safe_browsing_ui_manager.h" |
8 #include "components/security_interstitials/content/security_interstitial_contro
ller_client.h" | 8 #include "components/security_interstitials/content/security_interstitial_contro
ller_client.h" |
9 #include "components/security_interstitials/content/unsafe_resource.h" | 9 #include "components/security_interstitials/content/unsafe_resource.h" |
10 #include "components/security_interstitials/core/safe_browsing_error_ui.h" | 10 #include "components/security_interstitials/core/base_safe_browsing_error_ui.h" |
11 #include "content/public/browser/interstitial_page.h" | 11 #include "content/public/browser/interstitial_page.h" |
12 #include "content/public/browser/navigation_entry.h" | 12 #include "content/public/browser/navigation_entry.h" |
13 #include "content/public/browser/web_contents.h" | 13 #include "content/public/browser/web_contents.h" |
14 | 14 |
15 using content::InterstitialPage; | 15 using content::InterstitialPage; |
16 using content::WebContents; | 16 using content::WebContents; |
17 using security_interstitials::SafeBrowsingErrorUI; | 17 using security_interstitials::SafeBrowsingErrorUI; |
18 using security_interstitials::SecurityInterstitialControllerClient; | 18 using security_interstitials::SecurityInterstitialControllerClient; |
19 | 19 |
20 namespace android_webview { | 20 namespace android_webview { |
(...skipping 24 matching lines...) Expand all Loading... |
45 // This is an interstitial for a page's resource, let's queue it. | 45 // This is an interstitial for a page's resource, let's queue it. |
46 UnsafeResourceMap* unsafe_resource_map = GetUnsafeResourcesMap(); | 46 UnsafeResourceMap* unsafe_resource_map = GetUnsafeResourcesMap(); |
47 (*unsafe_resource_map)[web_contents].push_back(unsafe_resource); | 47 (*unsafe_resource_map)[web_contents].push_back(unsafe_resource); |
48 } else { | 48 } else { |
49 // There is no interstitial currently showing, or we are about to display a | 49 // There is no interstitial currently showing, or we are about to display a |
50 // new one for the main frame. If there is already an interstitial, showing | 50 // new one for the main frame. If there is already an interstitial, showing |
51 // the new one will automatically hide the old one. | 51 // the new one will automatically hide the old one. |
52 content::NavigationEntry* entry = | 52 content::NavigationEntry* entry = |
53 unsafe_resource.GetNavigationEntryForResource(); | 53 unsafe_resource.GetNavigationEntryForResource(); |
54 const UnsafeResourceList unsafe_resources{unsafe_resource}; | 54 const UnsafeResourceList unsafe_resources{unsafe_resource}; |
55 SafeBrowsingErrorUI::SBErrorDisplayOptions display_options = | 55 BaseSafeBrowsingErrorUI::SBErrorDisplayOptions display_options = |
56 SafeBrowsingErrorUI::SBErrorDisplayOptions( | 56 BaseSafeBrowsingErrorUI::SBErrorDisplayOptions( |
57 IsMainPageLoadBlocked(unsafe_resources), | 57 IsMainPageLoadBlocked(unsafe_resources), |
58 false, // kSafeBrowsingExtendedReportingOptInAllowed | 58 false, // kSafeBrowsingExtendedReportingOptInAllowed |
59 false, // is_off_the_record | 59 false, // is_off_the_record |
60 false, // is_extended_reporting | 60 false, // is_extended_reporting |
61 false, // is_scout | 61 false, // is_scout |
62 false, // kSafeBrowsingProceedAnywayDisabled | 62 false, // kSafeBrowsingProceedAnywayDisabled |
63 true); // is_resource_cancellable | 63 true); // is_resource_cancellable |
64 AwSafeBrowsingBlockingPage* blocking_page = new AwSafeBrowsingBlockingPage( | 64 AwSafeBrowsingBlockingPage* blocking_page = new AwSafeBrowsingBlockingPage( |
65 ui_manager, web_contents, entry ? entry->GetURL() : GURL(), | 65 ui_manager, web_contents, entry ? entry->GetURL() : GURL(), |
66 unsafe_resources, | 66 unsafe_resources, |
67 CreateControllerClient(web_contents, unsafe_resources, ui_manager), | 67 CreateControllerClient(web_contents, unsafe_resources, ui_manager), |
68 display_options); | 68 display_options); |
69 blocking_page->Show(); | 69 blocking_page->Show(); |
70 } | 70 } |
71 } | 71 } |
72 | 72 |
73 } // namespace android_webview | 73 } // namespace android_webview |
OLD | NEW |