| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "android_webview/browser/aw_safe_browsing_ui_manager.h" |
| 6 |
| 7 #include "content/public/browser/browser_thread.h" |
| 8 |
| 9 using content::BrowserThread; |
| 10 using content::WebContents; |
| 11 |
| 12 namespace android_webview { |
| 13 |
| 14 AwSafeBrowsingUIManager::AwSafeBrowsingUIManager() { |
| 15 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 16 } |
| 17 |
| 18 AwSafeBrowsingUIManager::~AwSafeBrowsingUIManager() {} |
| 19 |
| 20 void AwSafeBrowsingUIManager::DisplayBlockingPage( |
| 21 const UnsafeResource& resource) { |
| 22 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 23 |
| 24 WebContents* web_contents = resource.web_contents_getter.Run(); |
| 25 // Check the size of the view |
| 26 UIManagerClient* client = UIManagerClient::FromWebContents(web_contents); |
| 27 if (!client || !client->CanShowInterstitial()) { |
| 28 LOG(WARNING) << "The view is not suitable to show the SB interstitial"; |
| 29 OnBlockingPageDone(std::vector<UnsafeResource>{resource}, false, |
| 30 web_contents, resource.url.GetWithEmptyPath()); |
| 31 return; |
| 32 } |
| 33 safe_browsing::BaseUIManager::DisplayBlockingPage(resource); |
| 34 } |
| 35 |
| 36 } // namespace android_webview |
| OLD | NEW |