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

Side by Side Diff: chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_io_data.cc

Issue 2581533003: Show the Data Saver string for offline previews when Data Saver is enabled (Closed)
Patch Set: bengr comments Created 4 years 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.h » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/net/spdyproxy/data_reduction_proxy_chrome_io_data.h" 5 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_io_data.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 24 matching lines...) Expand all
35 using data_reduction_proxy::DataReductionProxyParams; 35 using data_reduction_proxy::DataReductionProxyParams;
36 36
37 namespace { 37 namespace {
38 38
39 // If this is the first Lo-Fi response for a page load, a 39 // If this is the first Lo-Fi response for a page load, a
40 // PreviewsInfoBarDelegate is created, which handles showing Lo-Fi UI. 40 // PreviewsInfoBarDelegate is created, which handles showing Lo-Fi UI.
41 void OnLoFiResponseReceivedOnUI(content::WebContents* web_contents) { 41 void OnLoFiResponseReceivedOnUI(content::WebContents* web_contents) {
42 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 42 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
43 PreviewsInfoBarDelegate::Create( 43 PreviewsInfoBarDelegate::Create(
44 web_contents, PreviewsInfoBarDelegate::LOFI, 44 web_contents, PreviewsInfoBarDelegate::LOFI,
45 true /* is_data_saver_user */,
45 PreviewsInfoBarDelegate::OnDismissPreviewsInfobarCallback()); 46 PreviewsInfoBarDelegate::OnDismissPreviewsInfobarCallback());
46 } 47 }
47 48
48 } // namespace 49 } // namespace
49 50
50 std::unique_ptr<data_reduction_proxy::DataReductionProxyIOData> 51 std::unique_ptr<data_reduction_proxy::DataReductionProxyIOData>
51 CreateDataReductionProxyChromeIOData( 52 CreateDataReductionProxyChromeIOData(
52 net::NetLog* net_log, 53 net::NetLog* net_log,
53 PrefService* prefs, 54 PrefService* prefs,
54 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner, 55 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner,
(...skipping 27 matching lines...) Expand all
82 data_reduction_proxy_io_data->set_lofi_decider( 83 data_reduction_proxy_io_data->set_lofi_decider(
83 base::MakeUnique<data_reduction_proxy::ContentLoFiDecider>()); 84 base::MakeUnique<data_reduction_proxy::ContentLoFiDecider>());
84 data_reduction_proxy_io_data->set_lofi_ui_service( 85 data_reduction_proxy_io_data->set_lofi_ui_service(
85 base::MakeUnique<data_reduction_proxy::ContentLoFiUIService>( 86 base::MakeUnique<data_reduction_proxy::ContentLoFiUIService>(
86 ui_task_runner, base::Bind(&OnLoFiResponseReceivedOnUI))); 87 ui_task_runner, base::Bind(&OnLoFiResponseReceivedOnUI)));
87 data_reduction_proxy_io_data->set_data_usage_source_provider( 88 data_reduction_proxy_io_data->set_data_usage_source_provider(
88 base::MakeUnique<ChromeDataUseGroupProvider>()); 89 base::MakeUnique<ChromeDataUseGroupProvider>());
89 90
90 return data_reduction_proxy_io_data; 91 return data_reduction_proxy_io_data;
91 } 92 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/previews/previews_infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698