| 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 #include "grit/components_strings.h" | |
| 13 #include "ui/base/l10n/l10n_util.h" | |
| 14 #include "url/gurl.h" | |
| 15 | |
| 16 // static | |
| 17 void DataReductionProxyInfoBarDelegate::Create( | |
| 18 content::WebContents* web_contents, const std::string& link_url) { | |
| 19 InfoBarService* infobar_service = | |
| 20 InfoBarService::FromWebContents(web_contents); | |
| 21 infobar_service->AddInfoBar( | |
| 22 DataReductionProxyInfoBarDelegate::CreateInfoBar( | |
| 23 infobar_service, | |
| 24 scoped_ptr<DataReductionProxyInfoBarDelegate>( | |
| 25 new DataReductionProxyInfoBarDelegate(link_url)))); | |
| 26 } | |
| 27 | |
| 28 DataReductionProxyInfoBarDelegate::~DataReductionProxyInfoBarDelegate() { | |
| 29 } | |
| 30 | |
| 31 DataReductionProxyInfoBarDelegate::DataReductionProxyInfoBarDelegate( | |
| 32 const std::string& link_url) | |
| 33 : ConfirmInfoBarDelegate(), | |
| 34 link_url_(link_url) { | |
| 35 } | |
| 36 | |
| 37 bool DataReductionProxyInfoBarDelegate::ShouldExpire( | |
| 38 const NavigationDetails& details) const { | |
| 39 return false; | |
| 40 } | |
| 41 | |
| 42 base::string16 DataReductionProxyInfoBarDelegate::GetMessageText() const { | |
| 43 return base::string16(); | |
| 44 } | |
| 45 | |
| 46 int DataReductionProxyInfoBarDelegate::GetButtons() const { | |
| 47 return BUTTON_NONE; | |
| 48 } | |
| 49 | |
| 50 GURL DataReductionProxyInfoBarDelegate::GetLinkURL() const { | |
| 51 return GURL(link_url_); | |
| 52 } | |
| 53 | |
| 54 bool DataReductionProxyInfoBarDelegate::LinkClicked( | |
| 55 WindowOpenDisposition disposition) { | |
| 56 ConfirmInfoBarDelegate::LinkClicked(disposition); | |
| 57 return true; | |
| 58 } | |
| OLD | NEW |