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

Unified Diff: chrome/browser/banners/app_banner_data_fetcher.h

Issue 1569893003: Add "Request app banner" context menu in DevTools (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporated pfeldman's comment Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/banners/app_banner_data_fetcher.h
diff --git a/chrome/browser/banners/app_banner_data_fetcher.h b/chrome/browser/banners/app_banner_data_fetcher.h
index fe943f25037d3fc81edcc32d82ee6ee3cb50839a..194bf0b7f53f4bd56335241d86b739b8021a6275 100644
--- a/chrome/browser/banners/app_banner_data_fetcher.h
+++ b/chrome/browser/banners/app_banner_data_fetcher.h
@@ -49,7 +49,8 @@ class AppBannerDataFetcher : public base::RefCountedThreadSafe<
// handled, and the fetcher needs to remain active and wait for a callback.
virtual bool HandleNonWebApp(const std::string& platform,
const GURL& url,
- const std::string& id) = 0;
+ const std::string& id,
+ bool is_debug_mode) = 0;
};
// Returns the current time.
@@ -61,7 +62,8 @@ class AppBannerDataFetcher : public base::RefCountedThreadSafe<
AppBannerDataFetcher(content::WebContents* web_contents,
base::WeakPtr<Delegate> weak_delegate,
int ideal_icon_size_in_dp,
- int minimum_icon_size_in_dp);
+ int minimum_icon_size_in_dp,
+ bool is_debug_mode);
// Begins creating a banner for the URL being displayed by the Delegate's
// WebContents.
@@ -89,6 +91,10 @@ class AppBannerDataFetcher : public base::RefCountedThreadSafe<
// by calling prompt() on the beforeinstallprompt Javascript event.
bool page_requested_prompt() { return page_requested_prompt_; }
+ // Returns true when it was created by the user action in DevTools or
+ // "bypass-app-banner-engagement-checks" flag is set.
+ bool is_debug_mode() const { return is_debug_mode_; }
+
// Returns the type of transition which triggered this fetch.
ui::PageTransition transition_type() { return transition_type_; }
@@ -172,7 +178,8 @@ class AppBannerDataFetcher : public base::RefCountedThreadSafe<
// Returns whether the given Manifest is following the requirements to show
// a web app banner.
static bool IsManifestValidForWebApp(const content::Manifest& manifest,
- content::WebContents* web_contents);
+ content::WebContents* web_contents,
+ bool is_debug_mode);
const base::WeakPtr<Delegate> weak_delegate_;
const int ideal_icon_size_in_dp_;
@@ -181,6 +188,7 @@ class AppBannerDataFetcher : public base::RefCountedThreadSafe<
bool is_active_;
bool was_canceled_by_page_;
bool page_requested_prompt_;
+ const bool is_debug_mode_;
ui::PageTransition transition_type_;
int event_request_id_;
scoped_ptr<SkBitmap> app_icon_;
« no previous file with comments | « chrome/browser/android/tab_web_contents_delegate_android.cc ('k') | chrome/browser/banners/app_banner_data_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698