Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_OMNIBOX_WATCHER_H_ | |
| 6 #define CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_OMNIBOX_WATCHER_H_ | |
| 7 | |
| 8 #include "base/callback.h" | |
| 9 #include "base/macros.h" | |
| 10 #include "chrome/browser/safe_browsing/incident_reporting/add_incident_callback. h" | |
| 11 #include "content/public/browser/notification_observer.h" | |
| 12 #include "content/public/browser/notification_registrar.h" | |
| 13 | |
| 14 namespace safe_browsing { | |
| 15 | |
| 16 class OmniboxWatcher : public content::NotificationObserver { | |
|
grt (UTC plus 2)
2014/12/05 18:40:56
// Observes all URLs opened via the Omnibox popup,
Mark P
2014/12/09 19:23:30
Done.
| |
| 17 public: | |
| 18 OmniboxWatcher(const AddIncidentCallback& callback); | |
|
grt (UTC plus 2)
2014/12/05 18:40:56
explicit OmniboxWatcher(const AddIncidentCallback&
Mark P
2014/12/09 19:23:30
Done.
| |
| 19 ~OmniboxWatcher() override; | |
| 20 | |
| 21 private: | |
| 22 // content::NotificationObserver: | |
| 23 void Observe(int type, | |
| 24 const content::NotificationSource& source, | |
| 25 const content::NotificationDetails& details) override; | |
| 26 | |
| 27 // The place to send a callback when we witness a suspicious omnibox | |
| 28 // navigation. | |
| 29 AddIncidentCallback incident_callback_; | |
| 30 | |
| 31 // Registrar for receiving Omnibox event notifications. | |
| 32 content::NotificationRegistrar registrar_; | |
| 33 | |
| 34 DISALLOW_COPY_AND_ASSIGN(OmniboxWatcher); | |
| 35 }; | |
| 36 | |
| 37 } // namespace safe_browsing | |
| 38 | |
| 39 #endif // CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_OMNIBOX_WATCHER_H_ | |
| OLD | NEW |