OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/previews/previews_infobar_tab_helper.h" | 5 #include "chrome/browser/previews/previews_infobar_tab_helper.h" |
6 | 6 |
7 #include "chrome/browser/previews/previews_infobar_delegate.h" | 7 #include "chrome/browser/previews/previews_infobar_delegate.h" |
8 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_heade
rs.h" | 8 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_heade
rs.h" |
9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
10 #include "content/public/browser/navigation_handle.h" | 10 #include "content/public/browser/navigation_handle.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 void PreviewsInfoBarTabHelper::DidFinishNavigation( | 36 void PreviewsInfoBarTabHelper::DidFinishNavigation( |
37 content::NavigationHandle* navigation_handle) { | 37 content::NavigationHandle* navigation_handle) { |
38 if (!navigation_handle->IsInMainFrame() || !navigation_handle->HasCommitted()) | 38 if (!navigation_handle->IsInMainFrame() || !navigation_handle->HasCommitted()) |
39 return; | 39 return; |
40 const net::HttpResponseHeaders* headers = | 40 const net::HttpResponseHeaders* headers = |
41 navigation_handle->GetResponseHeaders(); | 41 navigation_handle->GetResponseHeaders(); |
42 if (headers && | 42 if (headers && |
43 headers->HasHeaderValue( | 43 headers->HasHeaderValue( |
44 data_reduction_proxy::chrome_proxy_header(), | 44 data_reduction_proxy::chrome_proxy_header(), |
45 data_reduction_proxy::chrome_proxy_lo_fi_preview_directive())) { | 45 data_reduction_proxy::chrome_proxy_lite_page_directive())) { |
46 PreviewsInfoBarDelegate::Create(navigation_handle->GetWebContents(), | 46 PreviewsInfoBarDelegate::Create(navigation_handle->GetWebContents(), |
47 PreviewsInfoBarDelegate::LITE_PAGE); | 47 PreviewsInfoBarDelegate::LITE_PAGE); |
48 } | 48 } |
49 } | 49 } |
50 | 50 |
OLD | NEW |