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

Side by Side Diff: chrome/browser/android/banners/app_banner_infobar_delegate_android.h

Issue 2050933002: Upstream: Add additional checks before creating a WebAPK after clicking "Add to Homescreen" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_ANDROID_H_ 5 #ifndef CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_ANDROID_H_
6 #define CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_ANDROID_H_ 6 #define CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_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 "base/strings/string16.h" 10 #include "base/strings/string16.h"
11 #include "chrome/browser/android/banners/app_banner_data_fetcher_android.h" 11 #include "chrome/browser/android/banners/app_banner_data_fetcher_android.h"
12 #include "chrome/browser/android/shortcut_info.h"
12 #include "components/infobars/core/confirm_infobar_delegate.h" 13 #include "components/infobars/core/confirm_infobar_delegate.h"
13 #include "content/public/common/manifest.h" 14 #include "content/public/common/manifest.h"
14 #include "ui/gfx/image/image.h" 15 #include "ui/gfx/image/image.h"
15 #include "url/gurl.h" 16 #include "url/gurl.h"
16 17
17 namespace content { 18 namespace content {
18 class WebContents; 19 class WebContents;
19 } 20 }
20 21
21 namespace infobars { 22 namespace infobars {
22 class InfoBarManager; 23 class InfoBarManager;
23 } // namespace infobars 24 } // namespace infobars
24 25
25 class AppBannerInfoBar; 26 class AppBannerInfoBar;
26 27
27 namespace banners { 28 namespace banners {
28 29
29 // Manages installation of an app being promoted by a webpage. 30 // Manages installation of an app being promoted by a webpage.
30 class AppBannerInfoBarDelegateAndroid : public ConfirmInfoBarDelegate { 31 class AppBannerInfoBarDelegateAndroid : public ConfirmInfoBarDelegate {
31 public: 32 public:
32 // Delegate for promoting a web app. 33 // Delegate for promoting a web app.
33 AppBannerInfoBarDelegateAndroid( 34 AppBannerInfoBarDelegateAndroid(
34 int event_request_id, 35 int event_request_id,
35 scoped_refptr<AppBannerDataFetcherAndroid> data_fetcher, 36 scoped_refptr<AppBannerDataFetcherAndroid> data_fetcher,
36 const base::string16& app_title, 37 const base::string16& app_title,
37 SkBitmap* app_icon, 38 SkBitmap* app_icon,
38 const content::Manifest& web_app_data); 39 const content::Manifest& web_app_data,
40 ShortcutInfo::Type webapp_type);
39 41
40 // Delegate for promoting an Android app. 42 // Delegate for promoting an Android app.
41 AppBannerInfoBarDelegateAndroid( 43 AppBannerInfoBarDelegateAndroid(
42 int event_request_id, 44 int event_request_id,
43 const base::string16& app_title, 45 const base::string16& app_title,
44 SkBitmap* app_icon, 46 SkBitmap* app_icon,
45 const base::android::ScopedJavaGlobalRef<jobject>& native_app_data, 47 const base::android::ScopedJavaGlobalRef<jobject>& native_app_data,
46 const std::string& native_app_package, 48 const std::string& native_app_package,
47 const std::string& referrer); 49 const std::string& referrer);
48 50
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 base::android::ScopedJavaGlobalRef<jobject> java_delegate_; 82 base::android::ScopedJavaGlobalRef<jobject> java_delegate_;
81 83
82 // Used to fetch the splash screen icon for webapps. 84 // Used to fetch the splash screen icon for webapps.
83 scoped_refptr<AppBannerDataFetcherAndroid> data_fetcher_; 85 scoped_refptr<AppBannerDataFetcherAndroid> data_fetcher_;
84 86
85 base::string16 app_title_; 87 base::string16 app_title_;
86 std::unique_ptr<SkBitmap> app_icon_; 88 std::unique_ptr<SkBitmap> app_icon_;
87 89
88 int event_request_id_; 90 int event_request_id_;
89 content::Manifest web_app_data_; 91 content::Manifest web_app_data_;
92 ShortcutInfo::Type webapp_type_;
90 93
91 base::android::ScopedJavaGlobalRef<jobject> native_app_data_; 94 base::android::ScopedJavaGlobalRef<jobject> native_app_data_;
92 std::string native_app_package_; 95 std::string native_app_package_;
93 std::string referrer_; 96 std::string referrer_;
94 bool has_user_interaction_; 97 bool has_user_interaction_;
95 98
96 DISALLOW_COPY_AND_ASSIGN(AppBannerInfoBarDelegateAndroid); 99 DISALLOW_COPY_AND_ASSIGN(AppBannerInfoBarDelegateAndroid);
97 }; // AppBannerInfoBarDelegateAndroid 100 }; // AppBannerInfoBarDelegateAndroid
98 101
99 // Register native methods. 102 // Register native methods.
100 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env); 103 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env);
101 104
102 } // namespace banners 105 } // namespace banners
103 106
104 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_ANDROID_H_ 107 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698