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/page_load_metrics_embedder_interface.
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" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 const net::HttpResponseHeaders* response_headers = | 45 const net::HttpResponseHeaders* response_headers = |
46 navigation_handle_->GetResponseHeaders(); | 46 navigation_handle_->GetResponseHeaders(); |
47 if (!response_headers) | 47 if (!response_headers) |
48 return -1; | 48 return -1; |
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 mime_type == "multipart/related"; |
56 } | 57 } |
57 | 58 |
58 } // namespace page_load_metrics | 59 } // namespace page_load_metrics |
OLD | NEW |