Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Side by Side Diff: android_webview/browser/aw_safe_browsing_ui_manager.cc

Issue 2635693002: [WebView] initial webview-side implementation of safebrowsing (Closed)
Patch Set: rename lock, add crbug comment Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698