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

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: 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
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 23 matching lines...) Expand all
34 34
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, true /* is_data_saver_user*/,
bengr 2016/12/16 16:45:30 nit: Add a space after 'user'
RyanSturm 2016/12/16 19:02:09 Done.
45 PreviewsInfoBarDelegate::OnDismissPreviewsInfobarCallback()); 45 PreviewsInfoBarDelegate::OnDismissPreviewsInfobarCallback());
46 } 46 }
47 47
48 } // namespace 48 } // namespace
49 49
50 std::unique_ptr<data_reduction_proxy::DataReductionProxyIOData> 50 std::unique_ptr<data_reduction_proxy::DataReductionProxyIOData>
51 CreateDataReductionProxyChromeIOData( 51 CreateDataReductionProxyChromeIOData(
52 net::NetLog* net_log, 52 net::NetLog* net_log,
53 PrefService* prefs, 53 PrefService* prefs,
54 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner, 54 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner,
(...skipping 27 matching lines...) Expand all
82 data_reduction_proxy_io_data->set_lofi_decider( 82 data_reduction_proxy_io_data->set_lofi_decider(
83 base::MakeUnique<data_reduction_proxy::ContentLoFiDecider>()); 83 base::MakeUnique<data_reduction_proxy::ContentLoFiDecider>());
84 data_reduction_proxy_io_data->set_lofi_ui_service( 84 data_reduction_proxy_io_data->set_lofi_ui_service(
85 base::MakeUnique<data_reduction_proxy::ContentLoFiUIService>( 85 base::MakeUnique<data_reduction_proxy::ContentLoFiUIService>(
86 ui_task_runner, base::Bind(&OnLoFiResponseReceivedOnUI))); 86 ui_task_runner, base::Bind(&OnLoFiResponseReceivedOnUI)));
87 data_reduction_proxy_io_data->set_data_usage_source_provider( 87 data_reduction_proxy_io_data->set_data_usage_source_provider(
88 base::MakeUnique<ChromeDataUseGroupProvider>()); 88 base::MakeUnique<ChromeDataUseGroupProvider>());
89 89
90 return data_reduction_proxy_io_data; 90 return data_reduction_proxy_io_data;
91 } 91 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698