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

Side by Side Diff: chrome/browser/previews/previews_infobar_tab_helper.cc

Issue 2266653002: Previews infobar tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@newLoFiInfoBarAddUMA
Patch Set: clamy comments Created 4 years, 3 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
OLDNEW
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"
11 #include "content/public/browser/render_frame_host.h" 11 #include "content/public/browser/render_frame_host.h"
12 #include "content/public/browser/web_contents.h" 12 #include "content/public/browser/web_contents.h"
13 #include "content/public/common/referrer.h"
13 #include "net/http/http_response_headers.h" 14 #include "net/http/http_response_headers.h"
14 #include "url/gurl.h" 15 #include "url/gurl.h"
15 16
16 DEFINE_WEB_CONTENTS_USER_DATA_KEY(PreviewsInfoBarTabHelper); 17 DEFINE_WEB_CONTENTS_USER_DATA_KEY(PreviewsInfoBarTabHelper);
17 18
18 PreviewsInfoBarTabHelper::~PreviewsInfoBarTabHelper() {} 19 PreviewsInfoBarTabHelper::~PreviewsInfoBarTabHelper() {}
19 20
20 PreviewsInfoBarTabHelper::PreviewsInfoBarTabHelper( 21 PreviewsInfoBarTabHelper::PreviewsInfoBarTabHelper(
21 content::WebContents* web_contents) 22 content::WebContents* web_contents)
22 : content::WebContentsObserver(web_contents), 23 : content::WebContentsObserver(web_contents),
(...skipping 18 matching lines...) Expand all
41 navigation_handle->GetResponseHeaders(); 42 navigation_handle->GetResponseHeaders();
42 if (headers && 43 if (headers &&
43 headers->HasHeaderValue( 44 headers->HasHeaderValue(
44 data_reduction_proxy::chrome_proxy_header(), 45 data_reduction_proxy::chrome_proxy_header(),
45 data_reduction_proxy::chrome_proxy_lo_fi_preview_directive())) { 46 data_reduction_proxy::chrome_proxy_lo_fi_preview_directive())) {
46 PreviewsInfoBarDelegate::Create(navigation_handle->GetWebContents(), 47 PreviewsInfoBarDelegate::Create(navigation_handle->GetWebContents(),
47 PreviewsInfoBarDelegate::LITE_PAGE); 48 PreviewsInfoBarDelegate::LITE_PAGE);
48 } 49 }
49 } 50 }
50 51
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698