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

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

Issue 2046423003: Make OutputDeveloperMessageCode an enum class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge branch 'master' into create_webapk_requirements_enum_class 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
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 2b647326e23d618c591d55348a9d47c8026b3cd5..09bc96fa963f59b40d2341d91fcbf7e0338619e5 100644
--- a/chrome/browser/banners/app_banner_data_fetcher.cc
+++ b/chrome/browser/banners/app_banner_data_fetcher.cc
@@ -190,8 +190,9 @@ void AppBannerDataFetcher::OnBannerPromptReply(
!page_requested_prompt_) {
was_canceled_by_page_ = true;
referrer_ = referrer;
- OutputDeveloperNotShownMessage(web_contents, kRendererRequestCancel,
- is_debug_mode_);
+ OutputDeveloperNotShownMessage(
+ web_contents, OutputDeveloperMessageCode::kRendererRequestCancel,
+ is_debug_mode_);
return;
}
@@ -257,7 +258,9 @@ void AppBannerDataFetcher::OnDidHasManifest(bool has_manifest) {
if (!CheckFetcherIsStillAlive(web_contents) || !has_manifest) {
if (!has_manifest)
- OutputDeveloperNotShownMessage(web_contents, kNoManifest, is_debug_mode_);
+ OutputDeveloperNotShownMessage(web_contents,
+ OutputDeveloperMessageCode::kNoManifest,
+ is_debug_mode_);
Cancel();
return;
@@ -276,7 +279,8 @@ void AppBannerDataFetcher::OnDidGetManifest(
return;
}
if (manifest.IsEmpty()) {
- OutputDeveloperNotShownMessage(web_contents, kManifestEmpty,
+ OutputDeveloperNotShownMessage(web_contents,
+ OutputDeveloperMessageCode::kManifestEmpty,
is_debug_mode_);
Cancel();
return;
@@ -339,8 +343,9 @@ void AppBannerDataFetcher::OnDidCheckHasServiceWorker(
if (!has_service_worker) {
TrackDisplayEvent(DISPLAY_EVENT_LACKS_SERVICE_WORKER);
- OutputDeveloperNotShownMessage(web_contents, kNoMatchingServiceWorker,
- is_debug_mode_);
+ OutputDeveloperNotShownMessage(
+ web_contents, OutputDeveloperMessageCode::kNoMatchingServiceWorker,
+ is_debug_mode_);
Cancel();
return;
}
@@ -356,14 +361,15 @@ void AppBannerDataFetcher::OnHasServiceWorker(
if (icon_url.is_empty()) {
OutputDeveloperNotShownMessage(
web_contents,
- kNoIconMatchingRequirements,
+ OutputDeveloperMessageCode::kNoIconMatchingRequirements,
base::IntToString(ManifestIconSelector::ConvertIconSizeFromDpToPx(
minimum_icon_size_in_dp_)),
is_debug_mode_);
Cancel();
} else if (!FetchAppIcon(web_contents, icon_url)) {
- OutputDeveloperNotShownMessage(web_contents, kCannotDownloadIcon,
- is_debug_mode_);
+ OutputDeveloperNotShownMessage(
+ web_contents, OutputDeveloperMessageCode::kCannotDownloadIcon,
+ is_debug_mode_);
Cancel();
}
}
@@ -385,7 +391,8 @@ void AppBannerDataFetcher::OnAppIconFetched(const SkBitmap& bitmap) {
return;
}
if (bitmap.drawsNothing()) {
- OutputDeveloperNotShownMessage(web_contents, kNoIconAvailable,
+ OutputDeveloperNotShownMessage(web_contents,
+ OutputDeveloperMessageCode::kNoIconAvailable,
is_debug_mode_);
Cancel();
return;
@@ -435,7 +442,9 @@ bool AppBannerDataFetcher::CheckFetcherIsStillAlive(
content::WebContents* web_contents) {
if (!is_active_) {
OutputDeveloperNotShownMessage(
- web_contents, kUserNavigatedBeforeBannerShown, is_debug_mode_);
+ web_contents,
+ OutputDeveloperMessageCode::kUserNavigatedBeforeBannerShown,
+ is_debug_mode_);
return false;
}
if (!web_contents) {
@@ -450,18 +459,23 @@ bool AppBannerDataFetcher::IsManifestValidForWebApp(
content::WebContents* web_contents,
bool is_debug_mode) {
if (manifest.IsEmpty()) {
- OutputDeveloperNotShownMessage(web_contents, kManifestEmpty, is_debug_mode);
+ OutputDeveloperNotShownMessage(web_contents,
+ OutputDeveloperMessageCode::kManifestEmpty,
+ is_debug_mode);
return false;
}
if (!manifest.start_url.is_valid()) {
- OutputDeveloperNotShownMessage(web_contents, kStartURLNotValid,
- is_debug_mode);
+ OutputDeveloperNotShownMessage(
+ web_contents, OutputDeveloperMessageCode::kStartURLNotValid,
+ is_debug_mode);
return false;
}
if ((manifest.name.is_null() || manifest.name.string().empty()) &&
(manifest.short_name.is_null() || manifest.short_name.string().empty())) {
OutputDeveloperNotShownMessage(
- web_contents, kManifestMissingNameOrShortName, is_debug_mode);
+ web_contents,
+ OutputDeveloperMessageCode::kManifestMissingNameOrShortName,
+ is_debug_mode);
return false;
}
@@ -471,13 +485,16 @@ bool AppBannerDataFetcher::IsManifestValidForWebApp(
if (manifest.display != blink::WebDisplayModeStandalone &&
manifest.display != blink::WebDisplayModeFullscreen) {
OutputDeveloperNotShownMessage(
- web_contents, kManifestDisplayStandaloneFullscreen, is_debug_mode);
+ web_contents,
+ OutputDeveloperMessageCode::kManifestDisplayStandaloneFullscreen,
+ is_debug_mode);
return false;
}
if (!DoesManifestContainRequiredIcon(manifest)) {
- OutputDeveloperNotShownMessage(web_contents, kManifestMissingSuitableIcon,
- is_debug_mode);
+ OutputDeveloperNotShownMessage(
+ web_contents, OutputDeveloperMessageCode::kManifestMissingSuitableIcon,
+ is_debug_mode);
return false;
}
return true;
« no previous file with comments | « chrome/browser/android/banners/app_banner_manager_android.cc ('k') | chrome/browser/banners/app_banner_debug_log.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698