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 #include "chrome/common/page_load_metrics/page_tracker_predicate.h" |
| 6 |
| 7 namespace page_load_metrics { |
| 8 |
| 9 PageTrackerPredicate::PageTrackerPredicate() {} |
| 10 PageTrackerPredicate::~PageTrackerPredicate() {} |
| 11 |
| 12 bool PageTrackerPredicate::ShouldTrackPage() { |
| 13 // Ignore non-HTTP schemes (e.g. chrome://). |
| 14 if (!IsHTTPOrHTTPSUrl()) |
| 15 return false; |
| 16 |
| 17 // Ignore NTP loads. |
| 18 if (IsNewTabPageUrl()) |
| 19 return false; |
| 20 |
| 21 if (HasCommitted()) { |
| 22 // Ignore Chrome error pages (e.g. No Internet connection). |
| 23 if (IsChromeErrorPage()) |
| 24 return false; |
| 25 |
| 26 // Ignore network error pages (e.g. 4xx, 5xx). |
| 27 if (IsNetworkErrorPage()) |
| 28 return false; |
| 29 |
| 30 // Ignore non-HTML documents (e.g. SVG, images). |
| 31 if (!IsHTMLOrXHTMLPage()) |
| 32 return false; |
| 33 } |
| 34 return true; |
| 35 } |
| 36 |
| 37 } // namespace page_load_metrics |
OLD | NEW |