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/renderer/page_load_metrics/renderer_page_track_decider.h" | 5 #include "chrome/renderer/page_load_metrics/renderer_page_track_decider.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "chrome/renderer/searchbox/search_bouncer.h" | 9 #include "chrome/renderer/searchbox/search_bouncer.h" |
10 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 10 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 return data_source_->hasUnreachableURL(); | 38 return data_source_->hasUnreachableURL(); |
39 } | 39 } |
40 | 40 |
41 int RendererPageTrackDecider::GetHttpStatusCode() { | 41 int RendererPageTrackDecider::GetHttpStatusCode() { |
42 return data_source_->response().httpStatusCode(); | 42 return data_source_->response().httpStatusCode(); |
43 } | 43 } |
44 | 44 |
45 bool RendererPageTrackDecider::IsHtmlOrXhtmlPage() { | 45 bool RendererPageTrackDecider::IsHtmlOrXhtmlPage() { |
46 // Ignore non-HTML documents (e.g. SVG). Note that images are treated by | 46 // Ignore non-HTML documents (e.g. SVG). Note that images are treated by |
47 // Blink as HTML documents, so to exclude images, we must perform | 47 // Blink as HTML documents, so to exclude images, we must perform |
48 // additional mime type checking below. | 48 // additional mime type checking below. MHTML is tracked as HTML in blink. |
49 if (!document_->isHTMLDocument() && !document_->isXHTMLDocument()) | 49 if (!document_->isHTMLDocument() && !document_->isXHTMLDocument()) |
50 return false; | 50 return false; |
51 | 51 |
52 // Ignore non-HTML mime types (e.g. images). | 52 // Ignore non-HTML mime types (e.g. images). |
53 blink::WebString mime_type = data_source_->response().mimeType(); | 53 blink::WebString mime_type = data_source_->response().mimeType(); |
54 return mime_type == "text/html" || mime_type == "application/xhtml+xml"; | 54 return mime_type == "text/html" || mime_type == "application/xhtml+xml" || |
| 55 mime_type == "multipart/related"; |
55 } | 56 } |
56 | 57 |
57 } // namespace page_load_metrics | 58 } // namespace page_load_metrics |
OLD | NEW |