Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 */, |
|
megjablon
2017/05/11 23:49:45
#include "components/previews/core/previews_experi
RyanSturm
2017/05/15 16:23:08
Already included
| |
| 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 Loading... | |
| 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 } |
| OLD | NEW |