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

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

Issue 1161233005: Implement app banner info bars on desktop. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@stop-icon-overgeneration
Patch Set: Moving feature enabling to existing #ifs Created 5 years, 7 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 8f973ce45678d382aa8013f8ff63d597bc113674..8507486b7dd56f534c17137f751a747bcba7bf5d 100644
--- a/chrome/browser/banners/app_banner_data_fetcher.cc
+++ b/chrome/browser/banners/app_banner_data_fetcher.cc
@@ -12,11 +12,9 @@
#include "chrome/browser/banners/app_banner_settings_helper.h"
#include "chrome/browser/bitmap_fetcher/bitmap_fetcher.h"
#include "chrome/browser/browser_process.h"
-#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/manifest/manifest_icon_selector.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/render_messages.h"
-#include "components/infobars/core/infobar.h"
#include "components/rappor/rappor_utils.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
@@ -158,11 +156,7 @@ void AppBannerDataFetcher::OnBannerPromptReply(
FOR_EACH_OBSERVER(Observer, observer_list_,
OnDecidedWhetherToShow(this, true));
- infobars::InfoBar* infobar = CreateBanner(app_icon_.get(), app_title_);
- if (infobar) {
- InfoBarService::FromWebContents(web_contents)->AddInfoBar(
- make_scoped_ptr(infobar));
- }
+ ShowBanner(app_icon_.get(), app_title_);
is_active_ = false;
}
@@ -205,18 +199,6 @@ bool AppBannerDataFetcher::FetchIcon(const GURL& image_url) {
return true;
}
-infobars::InfoBar* AppBannerDataFetcher::CreateBanner(
- const SkBitmap* icon,
- const base::string16& title) {
- content::WebContents* web_contents = GetWebContents();
- DCHECK(web_contents && !web_app_data_.IsEmpty());
-
- // TODO(dfalcantara): Desktop doesn't display app banners, yet. Just pretend
- // that a banner was shown for testing purposes.
- RecordDidShowBanner("AppBanner.WebApp.Shown");
- return nullptr;
-}
-
void AppBannerDataFetcher::RecordDidShowBanner(const std::string& event_name) {
content::WebContents* web_contents = GetWebContents();
DCHECK(web_contents);
@@ -310,12 +292,12 @@ void AppBannerDataFetcher::OnDidCheckHasServiceWorker(
void AppBannerDataFetcher::OnFetchComplete(const GURL& url,
const SkBitmap* icon) {
if (is_active_)
- ShowBanner(icon);
+ RequestShowBanner(icon);
Release();
}
-void AppBannerDataFetcher::ShowBanner(const SkBitmap* icon) {
+void AppBannerDataFetcher::RequestShowBanner(const SkBitmap* icon) {
content::WebContents* web_contents = GetWebContents();
if (!CheckFetcherIsStillAlive(web_contents)) {
Cancel();
« no previous file with comments | « chrome/browser/banners/app_banner_data_fetcher.h ('k') | chrome/browser/banners/app_banner_data_fetcher_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698