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

Side by Side Diff: chrome/browser/previews/previews_infobar_delegate.cc

Issue 2792443002: Adding logic to prevent offline previews fallback to LoFi/Weblite (Closed)
Patch Set: plznavigate tests Created 3 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/previews/previews_infobar_delegate_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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 "chrome/browser/android/android_theme_resources.h" 8 #include "chrome/browser/android/android_theme_resources.h"
9 #include "chrome/browser/infobars/infobar_service.h" 9 #include "chrome/browser/infobars/infobar_service.h"
10 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" 10 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 web_contents->GetController().Reload( 148 web_contents->GetController().Reload(
149 content::ReloadType::DISABLE_LOFI_MODE, true); 149 content::ReloadType::DISABLE_LOFI_MODE, true);
150 else if (infobar_type_ == LOFI) 150 else if (infobar_type_ == LOFI)
151 web_contents->ReloadLoFiImages(); 151 web_contents->ReloadLoFiImages();
152 152
153 auto* data_reduction_proxy_settings = 153 auto* data_reduction_proxy_settings =
154 DataReductionProxyChromeSettingsFactory::GetForBrowserContext( 154 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(
155 web_contents->GetBrowserContext()); 155 web_contents->GetBrowserContext());
156 data_reduction_proxy_settings->IncrementLoFiUserRequestsForImages(); 156 data_reduction_proxy_settings->IncrementLoFiUserRequestsForImages();
157 } else if (infobar_type_ == OFFLINE) { 157 } else if (infobar_type_ == OFFLINE) {
158 web_contents->GetController().Reload(content::ReloadType::NORMAL, true); 158 // Prevent LoFi and lite page modes from showing after reload.
159 // TODO(ryansturm): rename DISABLE_LOFI_MODE to DISABLE_PREVIEWS.
160 // crbug.com/707272
161 web_contents->GetController().Reload(content::ReloadType::DISABLE_LOFI_MODE,
162 true);
159 } 163 }
160 164
161 return true; 165 return true;
162 } 166 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/previews/previews_infobar_delegate_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698