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 "chrome/browser/page_load_metrics/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 GoogleCaptchaObserver(); | 19 GoogleCaptchaObserver(); |
20 | 20 |
21 // page_load_metrics::PageLoadMetricsObserver implementation: | 21 // page_load_metrics::PageLoadMetricsObserver implementation: |
22 void OnCommit(content::NavigationHandle* navigation_handle) override; | 22 void OnCommit(content::NavigationHandle* navigation_handle) override; |
23 void OnRedirect(content::NavigationHandle* navigation_handle) override; | 23 void OnRedirect(content::NavigationHandle* navigation_handle) override; |
24 | 24 |
25 private: | 25 private: |
26 bool saw_solution_; | 26 bool saw_solution_; |
27 DISALLOW_COPY_AND_ASSIGN(GoogleCaptchaObserver); | 27 DISALLOW_COPY_AND_ASSIGN(GoogleCaptchaObserver); |
28 }; | 28 }; |
29 | 29 |
30 } // namespace google_captcha_observer | 30 } // namespace google_captcha_observer |
31 | 31 |
32 #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 |