Index: chrome/browser/net/spdyproxy/data_reduction_promo_infobar_delegate_android.h |
diff --git a/chrome/browser/net/spdyproxy/data_reduction_promo_infobar_delegate_android.h b/chrome/browser/net/spdyproxy/data_reduction_promo_infobar_delegate_android.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f2740114b40e83ca62c81bb08c337ef9d4c215b4 |
--- /dev/null |
+++ b/chrome/browser/net/spdyproxy/data_reduction_promo_infobar_delegate_android.h |
@@ -0,0 +1,61 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROMO_INFOBAR_DELEGATE_ANDROID_H_ |
+#define CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROMO_INFOBAR_DELEGATE_ANDROID_H_ |
+ |
+#include <memory> |
+ |
+#include "base/android/jni_android.h" |
+#include "base/macros.h" |
+#include "components/infobars/core/confirm_infobar_delegate.h" |
+#include "components/infobars/core/infobar_delegate.h" |
+ |
+namespace content { |
+class WebContents; |
+} |
+ |
+namespace infobars { |
+class InfoBarManager; |
+} |
+ |
+// Configures an infobar with two buttons that stays visible until it is |
Peter Kasting
2016/06/29 06:44:44
Nit: I don't know what "configures" means here. R
megjablon
2016/06/29 17:01:52
Done.
|
+// explicitly dismissed. This infobar is suitable for displaying a message |
+// and two action buttons, and is used to promote data reduction proxy to |
Peter Kasting
2016/06/29 06:44:43
Nit: Why talk about "displaying a message and two
megjablon
2016/06/29 17:01:52
Done.
|
+// non-users of it. |
+class DataReductionPromoInfoBarDelegateAndroid : public ConfirmInfoBarDelegate { |
+ public: |
+ // Creates the infobar and adds it to the provided |web_contents|. |
+ static void Create(content::WebContents* web_contents); |
+ |
+ ~DataReductionPromoInfoBarDelegateAndroid() override; |
+ |
+ static bool Register(JNIEnv* env); |
+ |
+ static void Launch(JNIEnv* env, |
+ jclass, |
+ jobject jweb_contents); |
+ |
+ base::android::ScopedJavaLocalRef<jobject> CreateRenderInfoBar(JNIEnv* env); |
+ |
+ private: |
+ DataReductionPromoInfoBarDelegateAndroid(); |
+ |
+ // Returns a Data Reduction Proxy infobar that owns |delegate|. |
+ static std::unique_ptr<infobars::InfoBar> CreateInfoBar( |
+ infobars::InfoBarManager* infobar_manager, |
+ std::unique_ptr<DataReductionPromoInfoBarDelegateAndroid> delegate); |
+ |
+ // ConfirmInfoBarDelegate |
Peter Kasting
2016/06/29 06:44:43
Nit: Trailing colon
megjablon
2016/06/29 17:01:52
Done.
|
+ infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; |
+ bool Accept() override; |
Peter Kasting
2016/06/29 06:44:44
Nit: This goes below the next function (maintain b
megjablon
2016/06/29 17:01:52
Done.
|
+ base::string16 GetMessageText() const override; |
+ |
+ base::android::ScopedJavaGlobalRef<jobject> |
+ java_data_reduction_promo_delegate_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(DataReductionPromoInfoBarDelegateAndroid); |
+}; |
+ |
+#endif // CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROMO_INFOBAR_DELEGATE_ANDROID_H_ |