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

Unified Diff: chrome/browser/safe_browsing/safe_browsing_service.h

Issue 720163003: Safe Browsing: Add Omnibox Interaction Incident Reporter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: formatting Created 6 years 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: chrome/browser/safe_browsing/safe_browsing_service.h
diff --git a/chrome/browser/safe_browsing/safe_browsing_service.h b/chrome/browser/safe_browsing/safe_browsing_service.h
index 6230e7ac60746245ecf5dc1fc8cda5456c85d7f3..6e4537f268193b5c3df2c6081a2a6fdf13b41aa5 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service.h
+++ b/chrome/browser/safe_browsing/safe_browsing_service.h
@@ -58,6 +58,7 @@ class DownloadProtectionService;
#if defined(FULL_SAFE_BROWSING)
class IncidentReportingService;
+class OmniboxWatcher;
class OffDomainInclusionDetector;
#endif
}
@@ -206,6 +207,12 @@ class SafeBrowsingService
// Stop following the safe browsing preference on |pref_service|.
void RemovePrefService(PrefService* pref_service);
+ // Creates a OmniboxWatcher for the newly-instantiated |profile|.
+ void AddOmniboxWatcher(Profile* profile);
+
+ // Deletes the OmniboxWatcher associated with |profile|.
+ void RemoveOmniboxWatcher(Profile* profile);
+
// Checks if any profile is currently using the safe browsing service, and
// starts or stops the service accordingly.
void RefreshState();
@@ -239,6 +246,9 @@ class SafeBrowsingService
// Accessed on UI thread.
std::map<PrefService*, PrefChangeRegistrar*> prefs_map_;
+ // Tracks existing OmniboxWatchers. This is used to keep one per profile.
+ std::map<Profile*, safe_browsing::OmniboxWatcher*> omnibox_watcher_map_;
grt (UTC plus 2) 2014/12/05 18:40:56 how about putting a scoped_ptr<OmniboxWatcher> mem
Mark P 2014/12/09 19:23:30 Done. It is okay that one listens for NOTIFICATIO
Mark P 2014/12/09 19:24:48 Done. I love how I can offhandedly mention any is
grt (UTC plus 2) 2014/12/09 20:15:52 I think it's okay. PROFILE_ADDED happens when the
noms (inactive) 2014/12/09 20:35:52 Hmmm, so I think that this can happen for sure in
grt (UTC plus 2) 2014/12/10 15:13:16 Thanks for the info. I think this is okay, then.
+
// Used to track creation and destruction of profiles on the UI thread.
content::NotificationRegistrar prefs_registrar_;

Powered by Google App Engine
This is Rietveld 408576698