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 "components/infobars/core/confirm_infobar_delegate.h" | |
13 #include "components/infobars/core/infobar_delegate.h" | |
14 | |
15 namespace content { | |
16 class WebContents; | |
17 } | |
18 | |
19 namespace infobars { | |
20 class InfoBarManager; | |
21 } | |
22 | |
23 // 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.
| |
24 // explicitly dismissed. This infobar is suitable for displaying a message | |
25 // 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.
| |
26 // non-users of it. | |
27 class DataReductionPromoInfoBarDelegateAndroid : public ConfirmInfoBarDelegate { | |
28 public: | |
29 // Creates the infobar and adds it to the provided |web_contents|. | |
30 static void Create(content::WebContents* web_contents); | |
31 | |
32 ~DataReductionPromoInfoBarDelegateAndroid() override; | |
33 | |
34 static bool Register(JNIEnv* env); | |
35 | |
36 static void Launch(JNIEnv* env, | |
37 jclass, | |
38 jobject jweb_contents); | |
39 | |
40 base::android::ScopedJavaLocalRef<jobject> CreateRenderInfoBar(JNIEnv* env); | |
41 | |
42 private: | |
43 DataReductionPromoInfoBarDelegateAndroid(); | |
44 | |
45 // Returns a Data Reduction Proxy infobar that owns |delegate|. | |
46 static std::unique_ptr<infobars::InfoBar> CreateInfoBar( | |
47 infobars::InfoBarManager* infobar_manager, | |
48 std::unique_ptr<DataReductionPromoInfoBarDelegateAndroid> delegate); | |
49 | |
50 // ConfirmInfoBarDelegate | |
Peter Kasting
2016/06/29 06:44:43
Nit: Trailing colon
megjablon
2016/06/29 17:01:52
Done.
| |
51 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; | |
52 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.
| |
53 base::string16 GetMessageText() const override; | |
54 | |
55 base::android::ScopedJavaGlobalRef<jobject> | |
56 java_data_reduction_promo_delegate_; | |
57 | |
58 DISALLOW_COPY_AND_ASSIGN(DataReductionPromoInfoBarDelegateAndroid); | |
59 }; | |
60 | |
61 #endif // CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROMO_INFOBAR_DELEGATE_AN DROID_H_ | |
OLD | NEW |