OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_infobar_delegate.h" |
| 6 |
| 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "chrome/browser/infobars/infobar_service.h" |
| 9 #include "components/infobars/core/infobar.h" |
| 10 #include "components/infobars/core/infobar_delegate.h" |
| 11 #include "content/public/browser/web_contents.h" |
| 12 |
| 13 // static |
| 14 void DataReductionProxyInfoBarDelegate::Create( |
| 15 content::WebContents* web_contents) { |
| 16 InfoBarService::FromWebContents(web_contents)->AddInfoBar( |
| 17 DataReductionProxyInfoBarDelegate::CreateInfoBar( |
| 18 scoped_ptr<DataReductionProxyInfoBarDelegate>( |
| 19 new DataReductionProxyInfoBarDelegate()))); |
| 20 } |
| 21 |
| 22 #if !defined(OS_ANDROID) |
| 23 // This infobar currently only supports Android. |
| 24 |
| 25 // static |
| 26 scoped_ptr<infobars::InfoBar> DataReductionProxyInfoBarDelegate::CreateInfoBar( |
| 27 scoped_ptr<DataReductionProxyInfoBarDelegate> delegate) { |
| 28 return ConfirmInfoBarDelegate::CreateInfoBar( |
| 29 delegate.PassAs<ConfirmInfoBarDelegate>()); |
| 30 } |
| 31 #endif |
| 32 |
| 33 DataReductionProxyInfoBarDelegate::~DataReductionProxyInfoBarDelegate() { |
| 34 } |
| 35 |
| 36 DataReductionProxyInfoBarDelegate::DataReductionProxyInfoBarDelegate() |
| 37 : ConfirmInfoBarDelegate() { |
| 38 } |
| 39 |
| 40 bool DataReductionProxyInfoBarDelegate::ShouldExpire( |
| 41 const NavigationDetails& details) const { |
| 42 return false; |
| 43 } |
| 44 |
| 45 base::string16 DataReductionProxyInfoBarDelegate::GetMessageText() const { |
| 46 return base::string16(); |
| 47 } |
| 48 |
| 49 int DataReductionProxyInfoBarDelegate::GetButtons() const { |
| 50 return BUTTON_NONE; |
| 51 } |
OLD | NEW |