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

Unified Diff: android_webview/browser/aw_safe_browsing_ui_manager.h

Issue 2932703003: Plumbing for safe browsing reporting for Android WebView. (Closed)
Patch Set: address comment Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: android_webview/browser/aw_safe_browsing_ui_manager.h
diff --git a/android_webview/browser/aw_safe_browsing_ui_manager.h b/android_webview/browser/aw_safe_browsing_ui_manager.h
index 79873c600ac10dc8b23ad22deac5bff6063e0b99..263f89a5e6ffbe9281cde81d52558f3dcf703d1e 100644
--- a/android_webview/browser/aw_safe_browsing_ui_manager.h
+++ b/android_webview/browser/aw_safe_browsing_ui_manager.h
@@ -12,7 +12,13 @@
#include "components/safe_browsing/base_ui_manager.h"
#include "content/public/browser/web_contents.h"
+namespace safe_browsing {
+class BasePingManager;
+class SafeBrowsingURLRequestContextGetter;
+} // namespace
+
namespace android_webview {
+class AwURLRequestContextGetter;
class AwSafeBrowsingUIManager : public safe_browsing::BaseUIManager {
public:
@@ -28,19 +34,33 @@ class AwSafeBrowsingUIManager : public safe_browsing::BaseUIManager {
};
// Construction needs to happen on the UI thread.
- AwSafeBrowsingUIManager();
-
- void DisplayBlockingPage(const UnsafeResource& resource) override;
+ explicit AwSafeBrowsingUIManager(
+ AwURLRequestContextGetter* browser_url_request_context_getter);
// Gets the correct ErrorUiType for the web contents
int GetErrorUiType(const UnsafeResource& resource) const;
+ // BaseUIManager methods:
+ void DisplayBlockingPage(const UnsafeResource& resource) override;
+
+ // Called on the IO thread by the ThreatDetails with the serialized
+ // protocol buffer, so the service can send it over.
+ void SendSerializedThreatDetails(const std::string& serialized) override;
+
protected:
~AwSafeBrowsingUIManager() override;
void ShowBlockingPageForResource(const UnsafeResource& resource) override;
private:
+ // Provides phishing and malware statistics. Accessed on IO thread.
+ std::unique_ptr<safe_browsing::BasePingManager> ping_manager_;
+
+ // The SafeBrowsingURLRequestContextGetter used to access
+ // |url_request_context_|. Accessed on UI thread.
+ scoped_refptr<safe_browsing::SafeBrowsingURLRequestContextGetter>
+ url_request_context_getter_;
+
DISALLOW_COPY_AND_ASSIGN(AwSafeBrowsingUIManager);
};

Powered by Google App Engine
This is Rietveld 408576698