| 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/previews/previews_infobar_delegate.h" | 5 #include "chrome/browser/previews/previews_infobar_delegate.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram_macros.h" | 7 #include "base/metrics/histogram_macros.h" |
| 8 #include "base/optional.h" | 8 #include "base/optional.h" |
| 9 #include "chrome/browser/android/android_theme_resources.h" | 9 #include "chrome/browser/android/android_theme_resources.h" |
| 10 #include "chrome/browser/infobars/infobar_service.h" | 10 #include "chrome/browser/infobars/infobar_service.h" |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 PreviewsInfoBarTabHelper* infobar_tab_helper = | 157 PreviewsInfoBarTabHelper* infobar_tab_helper = |
| 158 PreviewsInfoBarTabHelper::FromWebContents(web_contents); | 158 PreviewsInfoBarTabHelper::FromWebContents(web_contents); |
| 159 if (infobar_tab_helper && | 159 if (infobar_tab_helper && |
| 160 infobar_tab_helper->committed_data_saver_navigation_id()) { | 160 infobar_tab_helper->committed_data_saver_navigation_id()) { |
| 161 data_reduction_proxy_settings->data_reduction_proxy_service() | 161 data_reduction_proxy_settings->data_reduction_proxy_service() |
| 162 ->pingback_client() | 162 ->pingback_client() |
| 163 ->AddOptOut( | 163 ->AddOptOut( |
| 164 infobar_tab_helper->committed_data_saver_navigation_id().value()); | 164 infobar_tab_helper->committed_data_saver_navigation_id().value()); |
| 165 } | 165 } |
| 166 | 166 |
| 167 if (infobar_type_ == LITE_PAGE) | 167 if (infobar_type_ == LITE_PAGE) { |
| 168 web_contents->GetController().Reload( | 168 web_contents->GetController().Reload( |
| 169 content::ReloadType::DISABLE_LOFI_MODE, true); | 169 content::ReloadType::DISABLE_LOFI_MODE, true); |
| 170 else if (infobar_type_ == LOFI) | 170 } else if (infobar_type_ == LOFI) { |
| 171 web_contents->ReloadLoFiImages(); | 171 web_contents->ReloadLoFiImages(); |
| 172 } |
| 172 } else if (infobar_type_ == OFFLINE) { | 173 } else if (infobar_type_ == OFFLINE) { |
| 173 // Prevent LoFi and lite page modes from showing after reload. | 174 // Prevent LoFi and lite page modes from showing after reload. |
| 174 // TODO(ryansturm): rename DISABLE_LOFI_MODE to DISABLE_PREVIEWS. | 175 // TODO(ryansturm): rename DISABLE_LOFI_MODE to DISABLE_PREVIEWS. |
| 175 // crbug.com/707272 | 176 // crbug.com/707272 |
| 176 web_contents->GetController().Reload(content::ReloadType::DISABLE_LOFI_MODE, | 177 web_contents->GetController().Reload(content::ReloadType::DISABLE_LOFI_MODE, |
| 177 true); | 178 true); |
| 178 } | 179 } |
| 179 | 180 |
| 180 return true; | 181 return true; |
| 181 } | 182 } |
| OLD | NEW |