OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 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_PAGE_LOAD_METRICS_OBSERVERS_GOOGLE_CAPTCHA_OBSERVER_H_ | |
6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_GOOGLE_CAPTCHA_OBSERVER_H_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "components/page_load_metrics/browser/page_load_metrics_observer.h" | |
10 | |
11 namespace google_captcha_observer { | |
Alexei Svitkine (slow)
2015/11/16 16:54:59
I'll leave it up to owners of this, but I'm not su
Matt Welsh
2015/11/16 18:30:53
So I'm happy to do whatever makes sense. There is
Charlie Harrison
2015/11/16 19:12:38
I'm fine with the google_captcha_observer namespac
| |
12 | |
13 // Returns true if the given URL matches a Google CAPTCHA page. | |
14 bool IsGoogleCaptcha(const GURL& url); | |
15 | |
16 enum GoogleCaptchaEvent { | |
Alexei Svitkine (slow)
2015/11/16 16:54:59
Nit: This can probably live in the .cc if you're n
Matt Welsh
2015/11/16 18:30:53
Done.
| |
17 // A Google CAPTCHA page was shown to the user. | |
18 GOOGLE_CAPTCHA_SHOWN, | |
19 // A Google CAPTCHA page was solved by the user. | |
20 GOOGLE_CAPTCHA_SOLVED, | |
21 // Add new values before this final count. | |
22 GOOGLE_CAPTCHA_EVENT_BOUNDARY, | |
23 }; | |
24 | |
25 class GoogleCaptchaObserver | |
26 : public page_load_metrics::PageLoadMetricsObserver { | |
27 public: | |
28 explicit GoogleCaptchaObserver( | |
29 page_load_metrics::PageLoadMetricsObservable* metrics); | |
30 | |
31 // page_load_metrics::PageLoadMetricsObserver implementation: | |
32 void OnCommit(content::NavigationHandle* navigation_handle) override; | |
33 void OnRedirect(content::NavigationHandle* navigation_handle) override; | |
34 void OnPageLoadMetricsGoingAway() override; | |
35 | |
36 private: | |
37 page_load_metrics::PageLoadMetricsObservable* const metrics_; | |
38 DISALLOW_COPY_AND_ASSIGN(GoogleCaptchaObserver); | |
Alexei Svitkine (slow)
2015/11/16 16:54:59
Nit: Add an empty line above this.
Matt Welsh
2015/11/16 18:30:53
Done. Is there a tool to format code according to
| |
39 }; | |
40 | |
41 } // namespace google_captcha_observer | |
42 | |
43 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_GOOGLE_CAPTCHA_OBSERVER_H_ | |
OLD | NEW |