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 #ifndef CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROMO_INFOBAR_DELEGATE_ANDRO
ID_H_ |
| 6 #define CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROMO_INFOBAR_DELEGATE_ANDRO
ID_H_ |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "components/infobars/core/confirm_infobar_delegate.h" |
| 12 #include "components/infobars/core/infobar_delegate.h" |
| 13 |
| 14 namespace content { |
| 15 class WebContents; |
| 16 } |
| 17 |
| 18 namespace infobars { |
| 19 class InfoBarManager; |
| 20 } |
| 21 |
| 22 // Configures an InfoBar with two buttons that stays visible until it is |
| 23 // explicitly dismissed. This InfoBar is suitable for displaying a message |
| 24 // and two action buttons, and is used to promote data reduction proxy to |
| 25 // non-users of it. |
| 26 class DataReductionPromoInfoBarDelegateAndroid : public ConfirmInfoBarDelegate { |
| 27 public: |
| 28 // Creates the InfoBar and adds it to the provided |web_contents|. |
| 29 static void Create(content::WebContents* web_contents); |
| 30 |
| 31 ~DataReductionPromoInfoBarDelegateAndroid() {} |
| 32 |
| 33 private: |
| 34 DataReductionPromoInfoBarDelegateAndroid(); |
| 35 |
| 36 // Returns a Data Reduction Proxy InfoBar that owns |delegate|. |
| 37 static std::unique_ptr<infobars::InfoBar> CreateInfoBar( |
| 38 infobars::InfoBarManager* infobar_manager, |
| 39 std::unique_ptr<DataReductionPromoInfoBarDelegateAndroid> delegate); |
| 40 |
| 41 // ConfirmInfoBarDelegate |
| 42 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; |
| 43 base::string16 GetMessageText() const override; |
| 44 |
| 45 DISALLOW_COPY_AND_ASSIGN(DataReductionPromoInfoBarDelegateAndroid); |
| 46 }; |
| 47 |
| 48 #endif // CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROMO_INFOBAR_DELEGATE_AN
DROID_H_ |
OLD | NEW |