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/android/jni_android.h" |
| 11 #include "base/macros.h" |
| 12 #include "base/strings/string16.h" |
| 13 #include "components/infobars/core/confirm_infobar_delegate.h" |
| 14 #include "components/infobars/core/infobar_delegate.h" |
| 15 |
| 16 namespace content { |
| 17 class WebContents; |
| 18 } |
| 19 |
| 20 namespace infobars { |
| 21 class InfoBarManager; |
| 22 } |
| 23 |
| 24 // An infobar that prompts the user to enable the data reduction proxy. |
| 25 class DataReductionPromoInfoBarDelegateAndroid : public ConfirmInfoBarDelegate { |
| 26 public: |
| 27 // Creates the infobar and adds it to the provided |web_contents|. |
| 28 static void Create(content::WebContents* web_contents); |
| 29 |
| 30 DataReductionPromoInfoBarDelegateAndroid(); |
| 31 ~DataReductionPromoInfoBarDelegateAndroid() override; |
| 32 |
| 33 static bool Register(JNIEnv* env); |
| 34 |
| 35 static void Launch(JNIEnv* env, |
| 36 jclass, |
| 37 jobject jweb_contents); |
| 38 |
| 39 base::android::ScopedJavaLocalRef<jobject> CreateRenderInfoBar(JNIEnv* env); |
| 40 |
| 41 private: |
| 42 // Returns a Data Reduction Proxy infobar that owns |delegate|. |
| 43 static std::unique_ptr<infobars::InfoBar> CreateInfoBar( |
| 44 infobars::InfoBarManager* infobar_manager, |
| 45 std::unique_ptr<DataReductionPromoInfoBarDelegateAndroid> delegate); |
| 46 |
| 47 // ConfirmInfoBarDelegate: |
| 48 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; |
| 49 base::string16 GetMessageText() const override; |
| 50 bool Accept() override; |
| 51 |
| 52 DISALLOW_COPY_AND_ASSIGN(DataReductionPromoInfoBarDelegateAndroid); |
| 53 }; |
| 54 |
| 55 #endif // CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROMO_INFOBAR_DELEGATE_AN
DROID_H_ |
OLD | NEW |