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

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

Issue 2795183003: Adding logic to prevent offline previews fallback to LoFi/Weblite (Closed)
Patch Set: 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 web_contents->GetController().Reload( 144 web_contents->GetController().Reload(
145 content::ReloadType::DISABLE_LOFI_MODE, true); 145 content::ReloadType::DISABLE_LOFI_MODE, true);
146 else if (infobar_type_ == LOFI) 146 else if (infobar_type_ == LOFI)
147 web_contents->ReloadLoFiImages(); 147 web_contents->ReloadLoFiImages();
148 148
149 auto* data_reduction_proxy_settings = 149 auto* data_reduction_proxy_settings =
150 DataReductionProxyChromeSettingsFactory::GetForBrowserContext( 150 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(
151 web_contents->GetBrowserContext()); 151 web_contents->GetBrowserContext());
152 data_reduction_proxy_settings->IncrementLoFiUserRequestsForImages(); 152 data_reduction_proxy_settings->IncrementLoFiUserRequestsForImages();
153 } else if (infobar_type_ == OFFLINE) { 153 } else if (infobar_type_ == OFFLINE) {
154 web_contents->GetController().Reload(content::ReloadType::NORMAL, true); 154 // Prevent LoFi and lite page modes from showing after reload.
155 // TODO(ryansturm): rename DISABLE_LOFI_MODE to DISABLE_PREVIEWS.
156 // crbug.com/707272
157 web_contents->GetController().Reload(content::ReloadType::DISABLE_LOFI_MODE,
158 true);
155 } 159 }
156 160
157 return true; 161 return true;
158 } 162 }
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