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

Side by Side Diff: chrome/browser/ui/android/infobars/app_banner_infobar_android.h

Issue 2259553002: Make AppBannerInfoBar install WebAPK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 3 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_UI_ANDROID_INFOBARS_APP_BANNER_INFOBAR_ANDROID_H_ 5 #ifndef CHROME_BROWSER_UI_ANDROID_INFOBARS_APP_BANNER_INFOBAR_ANDROID_H_
6 #define CHROME_BROWSER_UI_ANDROID_INFOBARS_APP_BANNER_INFOBAR_ANDROID_H_ 6 #define CHROME_BROWSER_UI_ANDROID_INFOBARS_APP_BANNER_INFOBAR_ANDROID_H_
7 7
8 #include "base/android/scoped_java_ref.h" 8 #include "base/android/scoped_java_ref.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "chrome/browser/ui/android/infobars/confirm_infobar.h" 10 #include "chrome/browser/ui/android/infobars/confirm_infobar.h"
11 #include "url/gurl.h" 11 #include "url/gurl.h"
12 12
13 namespace banners { 13 namespace banners {
14 class AppBannerInfoBarDelegateAndroid; 14 class AppBannerInfoBarDelegateAndroid;
15 } // namespace banners 15 } // namespace banners
16 16
17 17
18 class AppBannerInfoBarAndroid : public ConfirmInfoBar { 18 class AppBannerInfoBarAndroid : public ConfirmInfoBar {
19 public: 19 public:
20 // Constructs an AppBannerInfoBarAndroid promoting a native app. 20 // Constructs an AppBannerInfoBarAndroid promoting a native app.
21 AppBannerInfoBarAndroid( 21 AppBannerInfoBarAndroid(
22 std::unique_ptr<banners::AppBannerInfoBarDelegateAndroid> delegate, 22 std::unique_ptr<banners::AppBannerInfoBarDelegateAndroid> delegate,
23 const base::android::ScopedJavaGlobalRef<jobject>& japp_data); 23 const base::android::ScopedJavaGlobalRef<jobject>& japp_data);
24 24
25 // Constructs an AppBannerInfoBarAndroid promoting a web app. 25 // Constructs an AppBannerInfoBarAndroid promoting a web app.
26 AppBannerInfoBarAndroid( 26 AppBannerInfoBarAndroid(
27 std::unique_ptr<banners::AppBannerInfoBarDelegateAndroid> delegate, 27 std::unique_ptr<banners::AppBannerInfoBarDelegateAndroid> delegate,
28 const GURL& app_url); 28 const GURL& app_url,
29 bool is_webapk);
29 30
30 ~AppBannerInfoBarAndroid() override; 31 ~AppBannerInfoBarAndroid() override;
31 32
32 // Called when the installation state of the app may have changed. 33 // Called when the installation state of the app may have changed.
33 // Updates the InfoBar visuals to match the new state and re-enables controls 34 // Updates the InfoBar visuals to match the new state and re-enables controls
34 // that may have been disabled. 35 // that may have been disabled.
35 void OnInstallStateChanged(int new_state); 36 void OnInstallStateChanged(int new_state);
36 37
37 private: 38 private:
38 // InfoBarAndroid overrides. 39 // InfoBarAndroid overrides.
39 base::android::ScopedJavaLocalRef<jobject> CreateRenderInfoBar( 40 base::android::ScopedJavaLocalRef<jobject> CreateRenderInfoBar(
40 JNIEnv* env) override; 41 JNIEnv* env) override;
41 42
42 // Native app: Details about the app. 43 // Native app: Details about the app.
43 base::android::ScopedJavaGlobalRef<jobject> japp_data_; 44 base::android::ScopedJavaGlobalRef<jobject> japp_data_;
44 45
45 // Web app: URL for the app. 46 // Web app: URL for the app.
46 GURL app_url_; 47 GURL app_url_;
47 48
49 // Indicates whether the info bar is for installing a WebAPK.
50 bool is_webapk_;
51
48 base::android::ScopedJavaGlobalRef<jobject> java_infobar_; 52 base::android::ScopedJavaGlobalRef<jobject> java_infobar_;
49 53
50 DISALLOW_COPY_AND_ASSIGN(AppBannerInfoBarAndroid); 54 DISALLOW_COPY_AND_ASSIGN(AppBannerInfoBarAndroid);
51 }; 55 };
52 56
53 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_APP_BANNER_INFOBAR_ANDROID_H_ 57 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_APP_BANNER_INFOBAR_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698