Chromium Code Reviews| Index: chrome/browser/page_load_metrics/observers/google_captcha_observer.h |
| diff --git a/chrome/browser/page_load_metrics/observers/google_captcha_observer.h b/chrome/browser/page_load_metrics/observers/google_captcha_observer.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..44d1921e6a15488da8fcf0300de65af90fb9f8ff |
| --- /dev/null |
| +++ b/chrome/browser/page_load_metrics/observers/google_captcha_observer.h |
| @@ -0,0 +1,35 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_GOOGLE_CAPTCHA_OBSERVER_H_ |
| +#define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_GOOGLE_CAPTCHA_OBSERVER_H_ |
| + |
| +#include "base/macros.h" |
| +#include "components/page_load_metrics/browser/page_load_metrics_observer.h" |
| + |
| +namespace google_captcha_observer { |
| + |
| +// Returns true if the given URL matches a Google CAPTCHA page. |
| +bool IsGoogleCaptcha(const GURL& url); |
|
Bryan McQuade
2015/11/16 18:58:55
re: removing the namespace, could we make this a s
Charlie Harrison
2015/11/16 19:12:38
There was a discussion about this in the original
|
| + |
| +class GoogleCaptchaObserver |
| + : public page_load_metrics::PageLoadMetricsObserver { |
| + public: |
| + explicit GoogleCaptchaObserver( |
| + page_load_metrics::PageLoadMetricsObservable* metrics); |
| + |
| + // page_load_metrics::PageLoadMetricsObserver implementation: |
| + void OnCommit(content::NavigationHandle* navigation_handle) override; |
| + void OnRedirect(content::NavigationHandle* navigation_handle) override; |
| + void OnPageLoadMetricsGoingAway() override; |
| + |
| + private: |
| + page_load_metrics::PageLoadMetricsObservable* const metrics_; |
| + DISALLOW_COPY_AND_ASSIGN(GoogleCaptchaObserver); |
| + |
| +}; |
| + |
| +} // namespace google_captcha_observer |
|
Charlie Harrison
2015/11/16 19:12:38
nit: space after }. I just tested git cl format an
|
| + |
| +#endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_GOOGLE_CAPTCHA_OBSERVER_H_ |