OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_infobar_delegate.h" | 5 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_infobar_delegate.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "chrome/browser/infobars/infobar_service.h" | 8 #include "chrome/browser/infobars/infobar_service.h" |
9 #include "components/infobars/core/infobar.h" | 9 #include "components/infobars/core/infobar.h" |
10 #include "components/infobars/core/infobar_delegate.h" | 10 #include "components/infobars/core/infobar_delegate.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 scoped_ptr<DataReductionProxyInfoBarDelegate>( | 21 scoped_ptr<DataReductionProxyInfoBarDelegate>( |
22 new DataReductionProxyInfoBarDelegate(link_url)))); | 22 new DataReductionProxyInfoBarDelegate(link_url)))); |
23 } | 23 } |
24 | 24 |
25 #if !defined(OS_ANDROID) | 25 #if !defined(OS_ANDROID) |
26 // This infobar currently only supports Android. | 26 // This infobar currently only supports Android. |
27 | 27 |
28 // static | 28 // static |
29 scoped_ptr<infobars::InfoBar> DataReductionProxyInfoBarDelegate::CreateInfoBar( | 29 scoped_ptr<infobars::InfoBar> DataReductionProxyInfoBarDelegate::CreateInfoBar( |
30 scoped_ptr<DataReductionProxyInfoBarDelegate> delegate) { | 30 scoped_ptr<DataReductionProxyInfoBarDelegate> delegate) { |
31 return ConfirmInfoBarDelegate::CreateInfoBar( | 31 return ConfirmInfoBarDelegate::CreateInfoBar(delegate.Pass()); |
32 delegate.PassAs<ConfirmInfoBarDelegate>()); | |
33 } | 32 } |
34 #endif | 33 #endif |
35 | 34 |
36 DataReductionProxyInfoBarDelegate::~DataReductionProxyInfoBarDelegate() { | 35 DataReductionProxyInfoBarDelegate::~DataReductionProxyInfoBarDelegate() { |
37 } | 36 } |
38 | 37 |
39 DataReductionProxyInfoBarDelegate::DataReductionProxyInfoBarDelegate( | 38 DataReductionProxyInfoBarDelegate::DataReductionProxyInfoBarDelegate( |
40 const std::string& link_url) | 39 const std::string& link_url) |
41 : ConfirmInfoBarDelegate(), | 40 : ConfirmInfoBarDelegate(), |
42 link_url_(link_url) { | 41 link_url_(link_url) { |
(...skipping 15 matching lines...) Expand all Loading... |
58 bool DataReductionProxyInfoBarDelegate::LinkClicked( | 57 bool DataReductionProxyInfoBarDelegate::LinkClicked( |
59 WindowOpenDisposition disposition) { | 58 WindowOpenDisposition disposition) { |
60 InfoBarService::WebContentsFromInfoBar(infobar())->OpenURL( | 59 InfoBarService::WebContentsFromInfoBar(infobar())->OpenURL( |
61 content::OpenURLParams( | 60 content::OpenURLParams( |
62 GURL(link_url_), | 61 GURL(link_url_), |
63 content::Referrer(), | 62 content::Referrer(), |
64 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, | 63 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, |
65 ui::PAGE_TRANSITION_LINK, false)); | 64 ui::PAGE_TRANSITION_LINK, false)); |
66 return true; | 65 return true; |
67 } | 66 } |
OLD | NEW |