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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 } | 55 } |
56 } | 56 } |
57 | 57 |
58 // If this is the first Lo-Fi response for a page load, a | 58 // If this is the first Lo-Fi response for a page load, a |
59 // PreviewsInfoBarDelegate is created, which handles showing Lo-Fi UI. | 59 // PreviewsInfoBarDelegate is created, which handles showing Lo-Fi UI. |
60 void OnLoFiResponseReceivedOnUI(content::WebContents* web_contents) { | 60 void OnLoFiResponseReceivedOnUI(content::WebContents* web_contents) { |
61 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 61 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
62 PreviewsInfoBarDelegate::Create( | 62 PreviewsInfoBarDelegate::Create( |
63 web_contents, previews::PreviewsType::LOFI, | 63 web_contents, previews::PreviewsType::LOFI, |
64 base::Time() /* previews_freshness */, true /* is_data_saver_user */, | 64 base::Time() /* previews_freshness */, true /* is_data_saver_user */, |
| 65 false /* is_reload */, |
65 base::Bind(&AddPreviewNavigationToBlackListCallback, | 66 base::Bind(&AddPreviewNavigationToBlackListCallback, |
66 web_contents->GetBrowserContext(), | 67 web_contents->GetBrowserContext(), |
67 web_contents->GetController() | 68 web_contents->GetController() |
68 .GetLastCommittedEntry() | 69 .GetLastCommittedEntry() |
69 ->GetRedirectChain()[0], | 70 ->GetRedirectChain()[0], |
70 previews::PreviewsType::LOFI)); | 71 previews::PreviewsType::LOFI)); |
71 } | 72 } |
72 | 73 |
73 } // namespace | 74 } // namespace |
74 | 75 |
(...skipping 19 matching lines...) Expand all Loading... |
94 data_reduction_proxy_io_data->set_lofi_decider( | 95 data_reduction_proxy_io_data->set_lofi_decider( |
95 base::MakeUnique<data_reduction_proxy::ContentLoFiDecider>()); | 96 base::MakeUnique<data_reduction_proxy::ContentLoFiDecider>()); |
96 data_reduction_proxy_io_data->set_resource_type_provider( | 97 data_reduction_proxy_io_data->set_resource_type_provider( |
97 base::MakeUnique<data_reduction_proxy::ContentResourceTypeProvider>()); | 98 base::MakeUnique<data_reduction_proxy::ContentResourceTypeProvider>()); |
98 data_reduction_proxy_io_data->set_lofi_ui_service( | 99 data_reduction_proxy_io_data->set_lofi_ui_service( |
99 base::MakeUnique<data_reduction_proxy::ContentLoFiUIService>( | 100 base::MakeUnique<data_reduction_proxy::ContentLoFiUIService>( |
100 ui_task_runner, base::Bind(&OnLoFiResponseReceivedOnUI))); | 101 ui_task_runner, base::Bind(&OnLoFiResponseReceivedOnUI))); |
101 | 102 |
102 return data_reduction_proxy_io_data; | 103 return data_reduction_proxy_io_data; |
103 } | 104 } |
OLD | NEW |