| 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/observers/previews_page_load_metrics_
observer.h" | 5 #include "chrome/browser/page_load_metrics/observers/previews_page_load_metrics_
observer.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/optional.h" | 9 #include "base/optional.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 } | 105 } |
| 106 PAGE_LOAD_HISTOGRAM(internal::kHistogramOfflinePreviewsParseStart, | 106 PAGE_LOAD_HISTOGRAM(internal::kHistogramOfflinePreviewsParseStart, |
| 107 timing.parse_start.value()); | 107 timing.parse_start.value()); |
| 108 } | 108 } |
| 109 | 109 |
| 110 bool PreviewsPageLoadMetricsObserver::IsOfflinePreview( | 110 bool PreviewsPageLoadMetricsObserver::IsOfflinePreview( |
| 111 content::WebContents* web_contents) const { | 111 content::WebContents* web_contents) const { |
| 112 #if BUILDFLAG(ANDROID_JAVA_UI) | 112 #if BUILDFLAG(ANDROID_JAVA_UI) |
| 113 offline_pages::OfflinePageTabHelper* tab_helper = | 113 offline_pages::OfflinePageTabHelper* tab_helper = |
| 114 offline_pages::OfflinePageTabHelper::FromWebContents(web_contents); | 114 offline_pages::OfflinePageTabHelper::FromWebContents(web_contents); |
| 115 return tab_helper && tab_helper->IsShowingOfflinePreview(); | 115 return tab_helper && tab_helper->is_offline_preview(); |
| 116 #else | 116 #else |
| 117 return false; | 117 return false; |
| 118 #endif // BUILDFLAG(ANDROID_JAVA_UI) | 118 #endif // BUILDFLAG(ANDROID_JAVA_UI) |
| 119 } | 119 } |
| 120 | 120 |
| 121 } // namespace previews | 121 } // namespace previews |
| OLD | NEW |