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

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

Issue 2875993002: Converging the two previews type enums (Closed)
Patch Set: megjablon nit Created 3 years, 7 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.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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 previews_service->previews_ui_service()->AddPreviewNavigation(url, type, 58 previews_service->previews_ui_service()->AddPreviewNavigation(url, type,
59 opt_out); 59 opt_out);
60 } 60 }
61 } 61 }
62 62
63 // If this is the first Lo-Fi response for a page load, a 63 // If this is the first Lo-Fi response for a page load, a
64 // PreviewsInfoBarDelegate is created, which handles showing Lo-Fi UI. 64 // PreviewsInfoBarDelegate is created, which handles showing Lo-Fi UI.
65 void OnLoFiResponseReceivedOnUI(content::WebContents* web_contents) { 65 void OnLoFiResponseReceivedOnUI(content::WebContents* web_contents) {
66 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 66 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
67 PreviewsInfoBarDelegate::Create( 67 PreviewsInfoBarDelegate::Create(
68 web_contents, PreviewsInfoBarDelegate::LOFI, 68 web_contents, previews::PreviewsType::LOFI, true /* is_data_saver_user */,
69 true /* is_data_saver_user */,
70 base::Bind(&AddPreviewNavigationToBlackListCallback, 69 base::Bind(&AddPreviewNavigationToBlackListCallback,
71 web_contents->GetBrowserContext(), 70 web_contents->GetBrowserContext(),
72 web_contents->GetController() 71 web_contents->GetController()
73 .GetLastCommittedEntry() 72 .GetLastCommittedEntry()
74 ->GetRedirectChain()[0], 73 ->GetRedirectChain()[0],
75 previews::PreviewsType::LOFI)); 74 previews::PreviewsType::LOFI));
76 } 75 }
77 76
78 } // namespace 77 } // namespace
79 78
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 data_reduction_proxy_io_data->set_resource_type_provider( 112 data_reduction_proxy_io_data->set_resource_type_provider(
114 base::MakeUnique<data_reduction_proxy::ContentResourceTypeProvider>()); 113 base::MakeUnique<data_reduction_proxy::ContentResourceTypeProvider>());
115 data_reduction_proxy_io_data->set_lofi_ui_service( 114 data_reduction_proxy_io_data->set_lofi_ui_service(
116 base::MakeUnique<data_reduction_proxy::ContentLoFiUIService>( 115 base::MakeUnique<data_reduction_proxy::ContentLoFiUIService>(
117 ui_task_runner, base::Bind(&OnLoFiResponseReceivedOnUI))); 116 ui_task_runner, base::Bind(&OnLoFiResponseReceivedOnUI)));
118 data_reduction_proxy_io_data->set_data_usage_source_provider( 117 data_reduction_proxy_io_data->set_data_usage_source_provider(
119 base::MakeUnique<ChromeDataUseGroupProvider>()); 118 base::MakeUnique<ChromeDataUseGroupProvider>());
120 119
121 return data_reduction_proxy_io_data; 120 return data_reduction_proxy_io_data;
122 } 121 }
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