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

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

Issue 2140463002: Remove WebContents::HasManifest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Explanatory comment for manifest_url_ resetting 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/banners/app_banner_data_fetcher.h ('k') | content/browser/manifest/manifest_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/banners/app_banner_data_fetcher.cc
diff --git a/chrome/browser/banners/app_banner_data_fetcher.cc b/chrome/browser/banners/app_banner_data_fetcher.cc
index fe4e87420dae9954868bc736959c9279f8675810..3cc28110a712364b55f59d0882d320ef6c75e952 100644
--- a/chrome/browser/banners/app_banner_data_fetcher.cc
+++ b/chrome/browser/banners/app_banner_data_fetcher.cc
@@ -106,8 +106,8 @@ void AppBannerDataFetcher::Start(const GURL& validated_url,
transition_type_ = transition_type;
validated_url_ = validated_url;
referrer_.erase();
- web_contents->HasManifest(
- base::Bind(&AppBannerDataFetcher::OnDidHasManifest, this));
+ web_contents->GetManifest(
+ base::Bind(&AppBannerDataFetcher::OnDidGetManifest, this));
}
void AppBannerDataFetcher::Cancel() {
@@ -270,21 +270,6 @@ void AppBannerDataFetcher::RecordDidShowBanner(const std::string& event_name) {
web_contents->GetURL());
}
-void AppBannerDataFetcher::OnDidHasManifest(bool has_manifest) {
- content::WebContents* web_contents = GetWebContents();
-
- if (!CheckFetcherIsStillAlive(web_contents) || !has_manifest) {
- if (!has_manifest)
- OutputDeveloperNotShownMessage(web_contents, kNoManifest, is_debug_mode_);
-
- Cancel();
- return;
- }
-
- web_contents->GetManifest(
- base::Bind(&AppBannerDataFetcher::OnDidGetManifest, this));
-}
-
void AppBannerDataFetcher::OnDidGetManifest(
const GURL& manifest_url,
const content::Manifest& manifest) {
@@ -293,6 +278,11 @@ void AppBannerDataFetcher::OnDidGetManifest(
Cancel();
return;
}
+ if (manifest_url.is_empty()) {
+ OutputDeveloperNotShownMessage(web_contents, kNoManifest, is_debug_mode_);
+ Cancel();
+ return;
+ }
if (manifest.IsEmpty()) {
OutputDeveloperNotShownMessage(web_contents, kManifestEmpty,
is_debug_mode_);
« no previous file with comments | « chrome/browser/banners/app_banner_data_fetcher.h ('k') | content/browser/manifest/manifest_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698