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

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: Merge branch 'create_webapk_requirements_enum_class' into create_webapk_requirements2 Created 4 years, 5 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 const GURL& app_icon_url, 38 const GURL& app_icon_url,
38 SkBitmap* app_icon, 39 SkBitmap* app_icon,
39 const GURL& manifest_url, 40 const GURL& manifest_url,
40 const content::Manifest& manifest); 41 const content::Manifest& manifest,
42 ShortcutInfo::Type webapp_type);
41 43
42 // Delegate for promoting an Android app. 44 // Delegate for promoting an Android app.
43 AppBannerInfoBarDelegateAndroid( 45 AppBannerInfoBarDelegateAndroid(
44 int event_request_id, 46 int event_request_id,
45 const base::string16& app_title, 47 const base::string16& app_title,
46 SkBitmap* app_icon, 48 SkBitmap* app_icon,
47 const base::android::ScopedJavaGlobalRef<jobject>& native_app_data, 49 const base::android::ScopedJavaGlobalRef<jobject>& native_app_data,
48 const std::string& native_app_package, 50 const std::string& native_app_package,
49 const std::string& referrer); 51 const std::string& referrer);
50 52
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 // Used to fetch the splash screen icon for webapps. 86 // Used to fetch the splash screen icon for webapps.
85 scoped_refptr<AppBannerDataFetcherAndroid> data_fetcher_; 87 scoped_refptr<AppBannerDataFetcherAndroid> data_fetcher_;
86 88
87 base::string16 app_title_; 89 base::string16 app_title_;
88 GURL app_icon_url_; 90 GURL app_icon_url_;
89 std::unique_ptr<SkBitmap> app_icon_; 91 std::unique_ptr<SkBitmap> app_icon_;
90 92
91 int event_request_id_; 93 int event_request_id_;
92 GURL manifest_url_; 94 GURL manifest_url_;
93 content::Manifest manifest_; 95 content::Manifest manifest_;
96 ShortcutInfo::Type webapp_type_;
94 97
95 base::android::ScopedJavaGlobalRef<jobject> native_app_data_; 98 base::android::ScopedJavaGlobalRef<jobject> native_app_data_;
96 std::string native_app_package_; 99 std::string native_app_package_;
97 std::string referrer_; 100 std::string referrer_;
98 bool has_user_interaction_; 101 bool has_user_interaction_;
99 102
100 DISALLOW_COPY_AND_ASSIGN(AppBannerInfoBarDelegateAndroid); 103 DISALLOW_COPY_AND_ASSIGN(AppBannerInfoBarDelegateAndroid);
101 }; // AppBannerInfoBarDelegateAndroid 104 }; // AppBannerInfoBarDelegateAndroid
102 105
103 // Register native methods. 106 // Register native methods.
104 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env); 107 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env);
105 108
106 } // namespace banners 109 } // namespace banners
107 110
108 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_ANDROID_H_ 111 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698