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

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

Issue 2250893002: Permission Action Reporting: Add num_prior_* fields. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@par-new-fields-proto
Patch Set: Also update browsertest 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 // be called on UI thread. 150 // be called on UI thread.
151 void ReportInvalidCertificateChain(const std::string& serialized_report, 151 void ReportInvalidCertificateChain(const std::string& serialized_report,
152 const base::Closure& callback); 152 const base::Closure& callback);
153 153
154 // Report permission action to SafeBrowsing servers. Can only be called on UI 154 // Report permission action to SafeBrowsing servers. Can only be called on UI
155 // thread. 155 // thread.
156 void ReportPermissionAction(const GURL& origin, 156 void ReportPermissionAction(const GURL& origin,
157 content::PermissionType permission, 157 content::PermissionType permission,
158 PermissionAction action, 158 PermissionAction action,
159 PermissionSourceUI source_ui, 159 PermissionSourceUI source_ui,
160 PermissionRequestGestureType gesture_type); 160 PermissionRequestGestureType gesture_type,
161 int num_prior_dismissals,
162 int num_prior_ignores);
161 163
162 // Add and remove observers. These methods must be invoked on the UI thread. 164 // Add and remove observers. These methods must be invoked on the UI thread.
163 void AddObserver(Observer* observer); 165 void AddObserver(Observer* observer);
164 void RemoveObserver(Observer* remove); 166 void RemoveObserver(Observer* remove);
165 167
166 protected: 168 protected:
167 virtual ~SafeBrowsingUIManager(); 169 virtual ~SafeBrowsingUIManager();
168 170
169 private: 171 private:
170 friend class base::RefCountedThreadSafe<SafeBrowsingUIManager>; 172 friend class base::RefCountedThreadSafe<SafeBrowsingUIManager>;
171 friend class SafeBrowsingUIManagerTest; 173 friend class SafeBrowsingUIManagerTest;
172 friend class TestSafeBrowsingUIManager; 174 friend class TestSafeBrowsingUIManager;
173 175
174 // Call protocol manager on IO thread to report hits of unsafe contents. 176 // Call protocol manager on IO thread to report hits of unsafe contents.
175 void ReportSafeBrowsingHitOnIOThread( 177 void ReportSafeBrowsingHitOnIOThread(
176 const safe_browsing::HitReport& hit_report); 178 const safe_browsing::HitReport& hit_report);
177 179
178 // Sends an invalid certificate chain report over the network. 180 // Sends an invalid certificate chain report over the network.
179 void ReportInvalidCertificateChainOnIOThread( 181 void ReportInvalidCertificateChainOnIOThread(
180 const std::string& serialized_report); 182 const std::string& serialized_report);
181 183
182 // Report permission action to SafeBrowsing servers. 184 // Report permission action to SafeBrowsing servers.
183 void ReportPermissionActionOnIOThread( 185 void ReportPermissionActionOnIOThread(
184 const GURL& origin, 186 const GURL& origin,
185 content::PermissionType permission, 187 content::PermissionType permission,
186 PermissionAction action, 188 PermissionAction action,
187 PermissionSourceUI source_ui, 189 PermissionSourceUI source_ui,
188 PermissionRequestGestureType gesture_type); 190 PermissionRequestGestureType gesture_type,
191 int num_prior_dismissals,
192 int num_prior_ignores);
189 193
190 // Updates the whitelist state. Called on the UI thread. 194 // Updates the whitelist state. Called on the UI thread.
191 void AddToWhitelist(const UnsafeResource& resource); 195 void AddToWhitelist(const UnsafeResource& resource);
192 196
193 // Safebrowsing service. 197 // Safebrowsing service.
194 scoped_refptr<SafeBrowsingService> sb_service_; 198 scoped_refptr<SafeBrowsingService> sb_service_;
195 199
196 base::ObserverList<Observer> observer_list_; 200 base::ObserverList<Observer> observer_list_;
197 201
198 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingUIManager); 202 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingUIManager);
199 }; 203 };
200 204
201 } // namespace safe_browsing 205 } // namespace safe_browsing
202 206
203 #endif // CHROME_BROWSER_SAFE_BROWSING_UI_MANAGER_H_ 207 #endif // CHROME_BROWSER_SAFE_BROWSING_UI_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698