| 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 #include "chrome/browser/page_load_metrics/observers/google_captcha_observer.h" | 5 #include "chrome/browser/page_load_metrics/observers/google_captcha_observer.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "components/page_load_metrics/browser/page_load_metrics_util.h" | 9 #include "chrome/browser/page_load_metrics/page_load_metrics_util.h" |
| 10 #include "components/page_load_metrics/common/page_load_timing.h" | 10 #include "chrome/common/page_load_metrics/page_load_timing.h" |
| 11 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 11 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
| 12 | 12 |
| 13 namespace google_captcha_observer { | 13 namespace google_captcha_observer { |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 const char kGoogleCaptchaEvents[] = "PageLoad.Clients.GoogleCaptcha.Events"; | 17 const char kGoogleCaptchaEvents[] = "PageLoad.Clients.GoogleCaptcha.Events"; |
| 18 | 18 |
| 19 enum GoogleCaptchaEvent { | 19 enum GoogleCaptchaEvent { |
| 20 // A Google CAPTCHA page was shown to the user. | 20 // A Google CAPTCHA page was shown to the user. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 void GoogleCaptchaObserver::OnRedirect( | 55 void GoogleCaptchaObserver::OnRedirect( |
| 56 content::NavigationHandle* navigation_handle) { | 56 content::NavigationHandle* navigation_handle) { |
| 57 if (IsGoogleCaptcha(navigation_handle->GetReferrer().url) && !saw_solution_) { | 57 if (IsGoogleCaptcha(navigation_handle->GetReferrer().url) && !saw_solution_) { |
| 58 RecordGoogleCaptchaEvent(GOOGLE_CAPTCHA_SOLVED); | 58 RecordGoogleCaptchaEvent(GOOGLE_CAPTCHA_SOLVED); |
| 59 saw_solution_ = true; | 59 saw_solution_ = true; |
| 60 } | 60 } |
| 61 } | 61 } |
| 62 | 62 |
| 63 } // namespace google_captcha_observer | 63 } // namespace google_captcha_observer |
| OLD | NEW |