| 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/base_safe_browsing_error_ui.h" | 10 #include "components/security_interstitials/core/base_safe_browsing_error_ui.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 std::move(controller_client), | 36 std::move(controller_client), |
| 37 display_options) { | 37 display_options) { |
| 38 if (errorUiType == ErrorUiType::QUIET_SMALL || | 38 if (errorUiType == ErrorUiType::QUIET_SMALL || |
| 39 errorUiType == ErrorUiType::QUIET_GIANT) { | 39 errorUiType == ErrorUiType::QUIET_GIANT) { |
| 40 set_sb_error_ui(base::MakeUnique<SafeBrowsingQuietErrorUI>( | 40 set_sb_error_ui(base::MakeUnique<SafeBrowsingQuietErrorUI>( |
| 41 unsafe_resources[0].url, main_frame_url, | 41 unsafe_resources[0].url, main_frame_url, |
| 42 GetInterstitialReason(unsafe_resources), display_options, | 42 GetInterstitialReason(unsafe_resources), display_options, |
| 43 ui_manager->app_locale(), base::Time::NowFromSystemTime(), controller(), | 43 ui_manager->app_locale(), base::Time::NowFromSystemTime(), controller(), |
| 44 errorUiType == ErrorUiType::QUIET_GIANT)); | 44 errorUiType == ErrorUiType::QUIET_GIANT)); |
| 45 } | 45 } |
| 46 // TODO(timvolodine): add call to |
| 47 // TriggerManager::StartCollectingThreatDetails(). |
| 46 } | 48 } |
| 47 | 49 |
| 48 // static | 50 // static |
| 49 void AwSafeBrowsingBlockingPage::ShowBlockingPage( | 51 void AwSafeBrowsingBlockingPage::ShowBlockingPage( |
| 50 AwSafeBrowsingUIManager* ui_manager, | 52 AwSafeBrowsingUIManager* ui_manager, |
| 51 const UnsafeResource& unsafe_resource) { | 53 const UnsafeResource& unsafe_resource) { |
| 52 DVLOG(1) << __func__ << " " << unsafe_resource.url.spec(); | 54 DVLOG(1) << __func__ << " " << unsafe_resource.url.spec(); |
| 53 WebContents* web_contents = unsafe_resource.web_contents_getter.Run(); | 55 WebContents* web_contents = unsafe_resource.web_contents_getter.Run(); |
| 54 | 56 |
| 55 if (InterstitialPage::GetInterstitialPage(web_contents) && | 57 if (InterstitialPage::GetInterstitialPage(web_contents) && |
| (...skipping 24 matching lines...) Expand all Loading... |
| 80 AwSafeBrowsingBlockingPage* blocking_page = new AwSafeBrowsingBlockingPage( | 82 AwSafeBrowsingBlockingPage* blocking_page = new AwSafeBrowsingBlockingPage( |
| 81 ui_manager, web_contents, entry ? entry->GetURL() : GURL(), | 83 ui_manager, web_contents, entry ? entry->GetURL() : GURL(), |
| 82 unsafe_resources, | 84 unsafe_resources, |
| 83 CreateControllerClient(web_contents, unsafe_resources, ui_manager), | 85 CreateControllerClient(web_contents, unsafe_resources, ui_manager), |
| 84 display_options, errorType); | 86 display_options, errorType); |
| 85 blocking_page->Show(); | 87 blocking_page->Show(); |
| 86 } | 88 } |
| 87 } | 89 } |
| 88 | 90 |
| 89 } // namespace android_webview | 91 } // namespace android_webview |
| OLD | NEW |