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 "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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 bool PreviewsInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) { | 132 bool PreviewsInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) { |
133 RecordPreviewsInfoBarAction(infobar_type_, INFOBAR_LOAD_ORIGINAL_CLICKED); | 133 RecordPreviewsInfoBarAction(infobar_type_, INFOBAR_LOAD_ORIGINAL_CLICKED); |
134 if (!on_dismiss_callback_.is_null()) | 134 if (!on_dismiss_callback_.is_null()) |
135 on_dismiss_callback_.Run(true); | 135 on_dismiss_callback_.Run(true); |
136 on_dismiss_callback_.Reset(); | 136 on_dismiss_callback_.Reset(); |
137 | 137 |
138 content::WebContents* web_contents = | 138 content::WebContents* web_contents = |
139 InfoBarService::WebContentsFromInfoBar(infobar()); | 139 InfoBarService::WebContentsFromInfoBar(infobar()); |
140 if (infobar_type_ == LITE_PAGE || infobar_type_ == LOFI) { | 140 if (infobar_type_ == LITE_PAGE || infobar_type_ == LOFI) { |
141 if (infobar_type_ == LITE_PAGE) | 141 if (infobar_type_ == LITE_PAGE) |
142 web_contents->GetController().ReloadDisableLoFi(true); | 142 web_contents->GetController().Reload( |
| 143 content::ReloadType::DISABLE_LOFI_MODE, true); |
143 else if (infobar_type_ == LOFI) | 144 else if (infobar_type_ == LOFI) |
144 web_contents->ReloadLoFiImages(); | 145 web_contents->ReloadLoFiImages(); |
145 | 146 |
146 auto* data_reduction_proxy_settings = | 147 auto* data_reduction_proxy_settings = |
147 DataReductionProxyChromeSettingsFactory::GetForBrowserContext( | 148 DataReductionProxyChromeSettingsFactory::GetForBrowserContext( |
148 web_contents->GetBrowserContext()); | 149 web_contents->GetBrowserContext()); |
149 data_reduction_proxy_settings->IncrementLoFiUserRequestsForImages(); | 150 data_reduction_proxy_settings->IncrementLoFiUserRequestsForImages(); |
150 } else if (infobar_type_ == OFFLINE) { | 151 } else if (infobar_type_ == OFFLINE) { |
151 web_contents->GetController().Reload(true); | 152 web_contents->GetController().Reload(content::ReloadType::NORMAL, true); |
152 } | 153 } |
153 | 154 |
154 return true; | 155 return true; |
155 } | 156 } |
OLD | NEW |