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

Unified Diff: chrome/browser/android/banners/app_banner_manager.cc

Issue 880203004: Break out manifest icon logic from ShortcutHelper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changing unittest Created 5 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
« no previous file with comments | « no previous file | chrome/browser/android/manifest_icon_selector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/banners/app_banner_manager.cc
diff --git a/chrome/browser/android/banners/app_banner_manager.cc b/chrome/browser/android/banners/app_banner_manager.cc
index 316a036d4277724cd41664d716715645e759c14c..6ac43a046c9abd3a123519763f116fb4f1e7aa06 100644
--- a/chrome/browser/android/banners/app_banner_manager.cc
+++ b/chrome/browser/android/banners/app_banner_manager.cc
@@ -12,6 +12,7 @@
#include "chrome/browser/android/banners/app_banner_infobar_delegate.h"
#include "chrome/browser/android/banners/app_banner_metrics_ids.h"
#include "chrome/browser/android/banners/app_banner_utilities.h"
+#include "chrome/browser/android/manifest_icon_selector.h"
#include "chrome/browser/banners/app_banner_settings_helper.h"
#include "chrome/browser/bitmap_fetcher/bitmap_fetcher.h"
#include "chrome/browser/infobars/infobar_service.h"
@@ -28,6 +29,7 @@
#include "jni/AppBannerManager_jni.h"
#include "net/base/load_flags.h"
#include "ui/gfx/android/java_bitmap.h"
+#include "ui/gfx/screen.h"
using base::android::ConvertJavaStringToUTF8;
using base::android::ConvertUTF8ToJavaString;
@@ -139,17 +141,13 @@ void AppBannerManager::OnDidGetManifest(const content::Manifest& manifest) {
// Create an infobar to promote the manifest's app.
manifest_ = manifest;
- /* TODO(dfalcantara): Use after landing https://crrev.com/880203004.
GURL icon_url =
- ManifestIconSelector::FindBestMatchingIcon(manifest.icons,
- GetPreferredIconSize(),
- web_contents());
+ ManifestIconSelector::FindBestMatchingIcon(
+ manifest.icons,
+ GetPreferredIconSize(),
+ gfx::Screen::GetScreenFor(web_contents()->GetNativeView()));
if (icon_url.is_empty())
return;
- */
- if (manifest.icons.empty())
- return;
- GURL icon_url = manifest.icons.back().src;
FetchIcon(icon_url);
}
« no previous file with comments | « no previous file | chrome/browser/android/manifest_icon_selector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698