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

Side by Side Diff: chrome/browser/safe_browsing/ui_manager.h

Issue 2241673002: Make UnsafeResource hold a WebContents getter instead of RenderFrame ids (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 4 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // The Safe Browsing service is responsible for downloading anti-phishing and 5 // The Safe Browsing service is responsible for downloading anti-phishing and
6 // anti-malware tables and checking urls against them. 6 // anti-malware tables and checking urls against them.
7 7
8 #ifndef CHROME_BROWSER_SAFE_BROWSING_UI_MANAGER_H_ 8 #ifndef CHROME_BROWSER_SAFE_BROWSING_UI_MANAGER_H_
9 #define CHROME_BROWSER_SAFE_BROWSING_UI_MANAGER_H_ 9 #define CHROME_BROWSER_SAFE_BROWSING_UI_MANAGER_H_
10 10
(...skipping 12 matching lines...) Expand all
23 #include "content/public/browser/browser_thread.h" 23 #include "content/public/browser/browser_thread.h"
24 #include "content/public/browser/permission_type.h" 24 #include "content/public/browser/permission_type.h"
25 #include "url/gurl.h" 25 #include "url/gurl.h"
26 26
27 namespace base { 27 namespace base {
28 class Thread; 28 class Thread;
29 } // namespace base 29 } // namespace base
30 30
31 namespace content { 31 namespace content {
32 class NavigationEntry; 32 class NavigationEntry;
33 class WebContents;
33 } // namespace content 34 } // namespace content
34 35
35 namespace net { 36 namespace net {
36 class SSLInfo; 37 class SSLInfo;
37 } // namespace net 38 } // namespace net
38 39
39 namespace safe_browsing { 40 namespace safe_browsing {
40 41
41 class SafeBrowsingService; 42 class SafeBrowsingService;
42 43
(...skipping 24 matching lines...) Expand all
67 // "valid". 68 // "valid".
68 // I.e, 69 // I.e,
69 // For MainPageLoadBlocked resources, it must not be called if the load 70 // For MainPageLoadBlocked resources, it must not be called if the load
70 // was aborted (going back or replaced with a different navigation), 71 // was aborted (going back or replaced with a different navigation),
71 // or resumed (proceeded through warning or matched whitelist). 72 // or resumed (proceeded through warning or matched whitelist).
72 // For non-MainPageLoadBlocked resources, it must not be called if any 73 // For non-MainPageLoadBlocked resources, it must not be called if any
73 // other navigation has committed (whether by going back or unrelated 74 // other navigation has committed (whether by going back or unrelated
74 // navigations), though a pending navigation is okay. 75 // navigations), though a pending navigation is okay.
75 content::NavigationEntry* GetNavigationEntryForResource() const; 76 content::NavigationEntry* GetNavigationEntryForResource() const;
76 77
78 // Helper to build a getter for WebContents* from render frame id.
79 static base::Callback<content::WebContents*(void)> GetWebContentsGetter(
80 int render_process_host_id,
81 int render_frame_id);
82
77 GURL url; 83 GURL url;
78 GURL original_url; 84 GURL original_url;
79 std::vector<GURL> redirect_urls; 85 std::vector<GURL> redirect_urls;
80 bool is_subresource; 86 bool is_subresource;
81 bool is_subframe; 87 bool is_subframe;
82 SBThreatType threat_type; 88 SBThreatType threat_type;
83 ThreatMetadata threat_metadata; 89 ThreatMetadata threat_metadata;
84 UrlCheckCallback callback; // This is called back on |callback_thread|. 90 UrlCheckCallback callback; // This is called back on |callback_thread|.
85 scoped_refptr<base::SingleThreadTaskRunner> callback_thread; 91 scoped_refptr<base::SingleThreadTaskRunner> callback_thread;
86 int render_process_host_id; 92 base::Callback<content::WebContents*(void)> web_contents_getter;
87 int render_frame_id;
88 safe_browsing::ThreatSource threat_source; 93 safe_browsing::ThreatSource threat_source;
89 }; 94 };
90 95
91 // Observer class can be used to get notified when a SafeBrowsing hit 96 // Observer class can be used to get notified when a SafeBrowsing hit
92 // was found. 97 // was found.
93 class Observer { 98 class Observer {
94 public: 99 public:
95 // The |resource| was classified as unsafe by SafeBrowsing, and is 100 // The |resource| was classified as unsafe by SafeBrowsing, and is
96 // not whitelisted. 101 // not whitelisted.
97 // The |resource| must not be accessed after OnSafeBrowsingHit returns. 102 // The |resource| must not be accessed after OnSafeBrowsingHit returns.
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 scoped_refptr<SafeBrowsingService> sb_service_; 199 scoped_refptr<SafeBrowsingService> sb_service_;
195 200
196 base::ObserverList<Observer> observer_list_; 201 base::ObserverList<Observer> observer_list_;
197 202
198 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingUIManager); 203 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingUIManager);
199 }; 204 };
200 205
201 } // namespace safe_browsing 206 } // namespace safe_browsing
202 207
203 #endif // CHROME_BROWSER_SAFE_BROWSING_UI_MANAGER_H_ 208 #endif // CHROME_BROWSER_SAFE_BROWSING_UI_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/threat_details_unittest.cc ('k') | chrome/browser/safe_browsing/ui_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698