Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Side by Side Diff: chrome/browser/page_load_metrics/browser_page_track_decider.cc

Issue 2699213002: Adding MHTML support into Page Load Metrics (Closed)
Patch Set: Only observe MHTML for previews observer Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698