OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_GOOGLE_CAPTCHA_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_GOOGLE_CAPTCHA_OBSERVER_H_ |
6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_GOOGLE_CAPTCHA_OBSERVER_H_ | 6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_GOOGLE_CAPTCHA_OBSERVER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "components/page_load_metrics/browser/page_load_metrics_observer.h" | 9 #include "components/page_load_metrics/browser/page_load_metrics_observer.h" |
10 | 10 |
11 namespace google_captcha_observer { | 11 namespace google_captcha_observer { |
12 | 12 |
13 // Returns true if the given URL matches a Google CAPTCHA page. | 13 // Returns true if the given URL matches a Google CAPTCHA page. |
14 bool IsGoogleCaptcha(const GURL& url); | 14 bool IsGoogleCaptcha(const GURL& url); |
15 | 15 |
16 class GoogleCaptchaObserver | 16 class GoogleCaptchaObserver |
17 : public page_load_metrics::PageLoadMetricsObserver { | 17 : public page_load_metrics::PageLoadMetricsObserver { |
18 public: | 18 public: |
19 explicit GoogleCaptchaObserver( | 19 GoogleCaptchaObserver(); |
20 page_load_metrics::PageLoadMetricsObservable* metrics); | |
21 | 20 |
22 // page_load_metrics::PageLoadMetricsObserver implementation: | 21 // page_load_metrics::PageLoadMetricsObserver implementation: |
23 void OnCommit(content::NavigationHandle* navigation_handle) override; | 22 void OnCommit(content::NavigationHandle* navigation_handle) override; |
24 void OnRedirect(content::NavigationHandle* navigation_handle) override; | 23 void OnRedirect(content::NavigationHandle* navigation_handle) override; |
25 void OnPageLoadMetricsGoingAway() override; | |
26 | 24 |
27 private: | 25 private: |
28 bool saw_solution_; | 26 bool saw_solution_; |
29 page_load_metrics::PageLoadMetricsObservable* const metrics_; | |
30 DISALLOW_COPY_AND_ASSIGN(GoogleCaptchaObserver); | 27 DISALLOW_COPY_AND_ASSIGN(GoogleCaptchaObserver); |
31 | |
32 }; | 28 }; |
33 | 29 |
34 } // namespace google_captcha_observer | 30 } // namespace google_captcha_observer |
35 | 31 |
36 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_GOOGLE_CAPTCHA_OBSERVER_H_ | 32 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_GOOGLE_CAPTCHA_OBSERVER_H_ |
OLD | NEW |