Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/net/spdyproxy/data_reduction_promo_infobar_delegate_and roid.h" | |
| 6 | |
| 7 #include "chrome/browser/android/android_theme_resources.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 | |
| 15 // static | |
| 16 void DataReductionPromoInfoBarDelegateAndroid::Create( | |
| 17 content::WebContents* web_contents) { | |
| 18 InfoBarService* infobar_service = | |
| 19 InfoBarService::FromWebContents(web_contents); | |
| 20 infobar_service->AddInfoBar( | |
| 21 DataReductionPromoInfoBarDelegateAndroid::CreateInfoBar( | |
| 22 infobar_service, | |
| 23 std::unique_ptr<DataReductionPromoInfoBarDelegateAndroid>( | |
| 24 new DataReductionPromoInfoBarDelegateAndroid()))); | |
| 25 } | |
| 26 | |
| 27 DataReductionPromoInfoBarDelegateAndroid:: | |
| 28 ~DataReductionPromoInfoBarDelegateAndroid() {} | |
|
Raj
2016/06/13 17:52:18
nit: This could be inline in the header file.
megjablon
2016/06/23 23:17:30
Done.
| |
| 29 | |
| 30 DataReductionPromoInfoBarDelegateAndroid:: | |
| 31 DataReductionPromoInfoBarDelegateAndroid() | |
| 32 : ConfirmInfoBarDelegate() {} | |
| 33 | |
| 34 infobars::InfoBarDelegate::InfoBarIdentifier | |
| 35 DataReductionPromoInfoBarDelegateAndroid::GetIdentifier() const { | |
| 36 return DATA_REDUCTION_PROMO_INFOBAR_DELEGATE_ANDROID; | |
| 37 } | |
| 38 | |
| 39 bool DataReductionPromoInfoBarDelegateAndroid::ShouldExpire( | |
| 40 const NavigationDetails& details) const { | |
| 41 return false; | |
| 42 } | |
| 43 | |
| 44 base::string16 DataReductionPromoInfoBarDelegateAndroid::GetMessageText() | |
|
Raj
2016/06/13 17:52:18
Is this function needed ?
megjablon
2016/06/23 23:17:30
Yes, it is abstract so it needs to be overwritten.
| |
| 45 const { | |
| 46 return base::string16(); | |
| 47 } | |
| 48 | |
| 49 int DataReductionPromoInfoBarDelegateAndroid::GetButtons() const { | |
|
Raj
2016/06/13 17:52:18
Is this function needed ?
megjablon
2016/06/23 23:17:30
Nope removed.
| |
| 50 return BUTTON_OK | BUTTON_CANCEL; | |
| 51 } | |
| OLD | NEW |