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