| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/browser_page_track_decider.h" | 5 #include "chrome/browser/page_load_metrics/browser_page_track_decider.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "chrome/browser/page_load_metrics/metrics_web_contents_observer.h" | 9 #include "chrome/browser/page_load_metrics/page_load_metrics_embedder_interface.
h" |
| 10 #include "content/public/browser/navigation_handle.h" | 10 #include "content/public/browser/navigation_handle.h" |
| 11 #include "content/public/browser/web_contents.h" | 11 #include "content/public/browser/web_contents.h" |
| 12 #include "net/http/http_response_headers.h" | 12 #include "net/http/http_response_headers.h" |
| 13 | 13 |
| 14 namespace page_load_metrics { | 14 namespace page_load_metrics { |
| 15 | 15 |
| 16 BrowserPageTrackDecider::BrowserPageTrackDecider( | 16 BrowserPageTrackDecider::BrowserPageTrackDecider( |
| 17 PageLoadMetricsEmbedderInterface* embedder_interface, | 17 PageLoadMetricsEmbedderInterface* embedder_interface, |
| 18 content::WebContents* web_contents, | 18 content::WebContents* web_contents, |
| 19 content::NavigationHandle* navigation_handle) | 19 content::NavigationHandle* navigation_handle) |
| (...skipping 29 matching lines...) Expand all Loading... |
| 49 return response_headers->response_code(); | 49 return response_headers->response_code(); |
| 50 } | 50 } |
| 51 | 51 |
| 52 bool BrowserPageTrackDecider::IsHtmlOrXhtmlPage() { | 52 bool BrowserPageTrackDecider::IsHtmlOrXhtmlPage() { |
| 53 DCHECK(HasCommitted()); | 53 DCHECK(HasCommitted()); |
| 54 const std::string& mime_type = web_contents_->GetContentsMimeType(); | 54 const std::string& mime_type = web_contents_->GetContentsMimeType(); |
| 55 return mime_type == "text/html" || mime_type == "application/xhtml+xml"; | 55 return mime_type == "text/html" || mime_type == "application/xhtml+xml"; |
| 56 } | 56 } |
| 57 | 57 |
| 58 } // namespace page_load_metrics | 58 } // namespace page_load_metrics |
| OLD | NEW |