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

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

Issue 2393513004: Convert app banners to use Mojo. (Closed)
Patch Set: Remove WebAppBannerPromptResult Created 4 years, 2 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_manager_desktop.cc
diff --git a/chrome/browser/banners/app_banner_manager_desktop.cc b/chrome/browser/banners/app_banner_manager_desktop.cc
index 710f25c65e781231d30c0258cdbacca073f2d926..dbefc92bddb52fc0af2ee6ffd78b08997f203ed1 100644
--- a/chrome/browser/banners/app_banner_manager_desktop.cc
+++ b/chrome/browser/banners/app_banner_manager_desktop.cc
@@ -4,8 +4,9 @@
#include "chrome/browser/banners/app_banner_manager_desktop.h"
+#include <utility>
+
#include "base/command_line.h"
-#include "base/strings/string_number_conversions.h"
#include "build/build_config.h"
#include "chrome/browser/banners/app_banner_infobar_delegate_desktop.h"
#include "chrome/browser/banners/app_banner_metrics.h"
@@ -13,7 +14,6 @@
#include "chrome/browser/extensions/bookmark_app_helper.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_switches.h"
-#include "chrome/common/render_messages.h"
#include "chrome/common/web_application_info.h"
#include "content/public/browser/render_frame_host.h"
#include "extensions/common/constants.h"
@@ -44,17 +44,12 @@ void AppBannerManagerDesktop::DidFinishCreatingBookmarkApp(
content::WebContents* contents = web_contents();
if (contents) {
// A null extension pointer indicates that the bookmark app install was
- // not successful.
+ // not successful. Call Stop() to terminate the flow. Don't record a dismiss
+ // metric here because the banner isn't necessarily dismissed.
if (extension == nullptr) {
- contents->GetMainFrame()->Send(new ChromeViewMsg_AppBannerDismissed(
- contents->GetMainFrame()->GetRoutingID(), event_request_id()));
-
- AppBannerSettingsHelper::RecordBannerDismissEvent(
- contents, GetAppIdentifier(), AppBannerSettingsHelper::WEB);
+ Stop();
} else {
- contents->GetMainFrame()->Send(new ChromeViewMsg_AppBannerAccepted(
- contents->GetMainFrame()->GetRoutingID(), event_request_id(),
- GetBannerType()));
+ SendBannerAccepted(event_request_id());
AppBannerSettingsHelper::RecordBannerInstallEvent(
contents, GetAppIdentifier(), AppBannerSettingsHelper::WEB);

Powered by Google App Engine
This is Rietveld 408576698