Index: chrome/browser/page_load_metrics/observers/previews_page_load_metrics_observer.cc |
diff --git a/chrome/browser/page_load_metrics/observers/previews_page_load_metrics_observer.cc b/chrome/browser/page_load_metrics/observers/previews_page_load_metrics_observer.cc |
index 4b5b431d0629c7146668e8a856fa3e51ac45cfce..eba83de498a0fb1f1b506f1645e5c0f583a05fde 100644 |
--- a/chrome/browser/page_load_metrics/observers/previews_page_load_metrics_observer.cc |
+++ b/chrome/browser/page_load_metrics/observers/previews_page_load_metrics_observer.cc |
@@ -4,8 +4,6 @@ |
#include "chrome/browser/page_load_metrics/observers/previews_page_load_metrics_observer.h" |
-#include <string> |
- |
#include "base/optional.h" |
#include "base/time/time.h" |
#include "chrome/browser/page_load_metrics/page_load_metrics_util.h" |
@@ -50,6 +48,17 @@ PreviewsPageLoadMetricsObserver::OnCommit( |
: STOP_OBSERVING; |
} |
+page_load_metrics::PageLoadMetricsObserver::ObservePolicy |
+PreviewsPageLoadMetricsObserver::ShouldObserveMimeType( |
+ const std::string& mime_type) const { |
+ // Support observing HTML, XHTML, and MHTML. Offline previews are served as |
+ // MHTML (multipart/related). |
+ return mime_type == "text/html" || mime_type == "application/xhtml+xml" || |
Bryan McQuade
2017/02/21 18:50:15
let's have this chain to the base class impl first
|
+ mime_type == "multipart/related" |
+ ? CONTINUE_OBSERVING |
+ : STOP_OBSERVING; |
+} |
+ |
void PreviewsPageLoadMetricsObserver::OnDomContentLoadedEventStart( |
const page_load_metrics::PageLoadTiming& timing, |
const page_load_metrics::PageLoadExtraInfo& info) { |