Chromium Code Reviews| Index: chrome/browser/previews/previews_infobar_delegate.cc |
| diff --git a/chrome/browser/previews/previews_infobar_delegate.cc b/chrome/browser/previews/previews_infobar_delegate.cc |
| index f37679a55693404c4be770b863392d30c37d2faa..a58498c8eadb4ee62503823546a3dbc2108cc7aa 100644 |
| --- a/chrome/browser/previews/previews_infobar_delegate.cc |
| +++ b/chrome/browser/previews/previews_infobar_delegate.cc |
| @@ -28,6 +28,10 @@ const char kUMAPreviewsInfoBarActionLoFi[] = "Previews.InfoBarAction.LoFi"; |
| const char kUMAPreviewsInfoBarActionOffline[] = |
| "Previews.InfoBarAction.Offline"; |
| +// Key of the UMA Previews.InfoBarAction.ClientLoFi histogram. |
| +const char kUMAPreviewsInfoBarActionClientLoFi[] = |
| + "Previews.InfoBarAction.ClientLoFi"; |
| + |
| // Key of the UMA Previews.InfoBarAction.LitePage histogram. |
| const char kUMAPreviewsInfoBarActionLitePage[] = |
| "Previews.InfoBarAction.LitePage"; |
| @@ -44,6 +48,9 @@ void RecordPreviewsInfoBarAction( |
| } else if (infobar_type == PreviewsInfoBarDelegate::OFFLINE) { |
| UMA_HISTOGRAM_ENUMERATION(kUMAPreviewsInfoBarActionOffline, action, |
| PreviewsInfoBarDelegate::INFOBAR_INDEX_BOUNDARY); |
| + } else if (infobar_type == PreviewsInfoBarDelegate::CLIENT_LOFI) { |
| + UMA_HISTOGRAM_ENUMERATION(kUMAPreviewsInfoBarActionClientLoFi, action, |
| + PreviewsInfoBarDelegate::INFOBAR_INDEX_BOUNDARY); |
| } |
| } |
| @@ -164,11 +171,14 @@ bool PreviewsInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) { |
| infobar_tab_helper->committed_data_saver_navigation_id().value()); |
| } |
| - if (infobar_type_ == LITE_PAGE) |
| + if (infobar_type_ == LITE_PAGE) { |
| web_contents->GetController().Reload( |
| content::ReloadType::DISABLE_LOFI_MODE, true); |
| - else if (infobar_type_ == LOFI) |
| + } else if (infobar_type_ == LOFI) { |
| web_contents->ReloadLoFiImages(); |
| + } |
| + } else if (infobar_type_ == CLIENT_LOFI) { |
| + web_contents->ReloadLoFiImages(); |
|
sclittle
2017/05/03 18:40:21
If "Show Original" is clicked on a page with both
RyanSturm
2017/05/03 18:48:52
Yes. It's definitely a race between the two. What
sclittle
2017/05/03 19:02:46
http:// pages with ads/analytics/social widgets ar
|
| } else if (infobar_type_ == OFFLINE) { |
| // Prevent LoFi and lite page modes from showing after reload. |
| // TODO(ryansturm): rename DISABLE_LOFI_MODE to DISABLE_PREVIEWS. |