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