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

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

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

Powered by Google App Engine
This is Rietveld 408576698