Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1433)

Side by Side Diff: chrome/browser/android/instantapps/instant_apps_infobar_delegate.h

Issue 2379783002: Instant App Banner logic. (Closed)
Patch Set: Alphabetize and rename constants Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_ANDROID_INSTANTAPPS_INSTANT_APPS_INFOBAR_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_ANDROID_INSTANTAPPS_INSTANT_APPS_INFOBAR_DELEGATE_H_
6 #define CHROME_BROWSER_ANDROID_INSTANTAPPS_INSTANT_APPS_INFOBAR_DELEGATE_H_ 6 #define CHROME_BROWSER_ANDROID_INSTANTAPPS_INSTANT_APPS_INFOBAR_DELEGATE_H_
7 7
8 #include <string>
9
8 #include "base/android/jni_android.h" 10 #include "base/android/jni_android.h"
9 #include "base/strings/string16.h" 11 #include "base/strings/string16.h"
10 #include "components/infobars/core/confirm_infobar_delegate.h" 12 #include "components/infobars/core/confirm_infobar_delegate.h"
11 #include "components/infobars/core/infobar_delegate.h" 13 #include "components/infobars/core/infobar_delegate.h"
12 14
13 class InfoBarService; 15 class InfoBarService;
14 16
15 class InstantAppsInfoBarDelegate : public ConfirmInfoBarDelegate { 17 class InstantAppsInfoBarDelegate : public ConfirmInfoBarDelegate {
16 public: 18 public:
17 ~InstantAppsInfoBarDelegate() override; 19 ~InstantAppsInfoBarDelegate() override;
18 20
19 static void Create(InfoBarService* infobar_service, 21 static void Create(InfoBarService* infobar_service,
20 jobject jdata); 22 const jobject jdata,
23 const std::string& url);
21 24
22 base::android::ScopedJavaGlobalRef<jobject> data() { return data_; } 25 base::android::ScopedJavaGlobalRef<jobject> data() { return data_; }
23 26
24 private: 27 private:
25 explicit InstantAppsInfoBarDelegate(jobject jdata); 28 explicit InstantAppsInfoBarDelegate(const jobject jdata,
29 const std::string& url);
26 30
27 // ConfirmInfoBarDelegate: 31 // ConfirmInfoBarDelegate:
28 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; 32 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override;
29 base::string16 GetMessageText() const override; 33 base::string16 GetMessageText() const override;
30 bool Accept() override; 34 bool Accept() override;
31 bool EqualsDelegate(infobars::InfoBarDelegate* delegate) const override; 35 bool EqualsDelegate(infobars::InfoBarDelegate* delegate) const override;
32 void InfoBarDismissed() override; 36 void InfoBarDismissed() override;
33 37
34 base::android::ScopedJavaGlobalRef<jobject> java_delegate_; 38 base::android::ScopedJavaGlobalRef<jobject> java_delegate_;
35 base::android::ScopedJavaGlobalRef<jobject> data_; 39 base::android::ScopedJavaGlobalRef<jobject> data_;
40 std::string url_;
36 41
37 DISALLOW_COPY_AND_ASSIGN(InstantAppsInfoBarDelegate); 42 DISALLOW_COPY_AND_ASSIGN(InstantAppsInfoBarDelegate);
38 }; 43 };
39 44
40 // Register native methods. 45 // Register native methods.
41 bool RegisterInstantAppsInfoBarDelegate(JNIEnv* env); 46 bool RegisterInstantAppsInfoBarDelegate(JNIEnv* env);
42 47
43 #endif // CHROME_BROWSER_ANDROID_INSTANTAPPS_INSTANT_APPS_INFOBAR_DELEGATE_H_ 48 #endif // CHROME_BROWSER_ANDROID_INSTANTAPPS_INSTANT_APPS_INFOBAR_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698