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

Unified Diff: chrome/browser/android/shortcut_helper.h

Issue 880203004: Break out manifest icon logic from ShortcutHelper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing 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
Index: chrome/browser/android/shortcut_helper.h
diff --git a/chrome/browser/android/shortcut_helper.h b/chrome/browser/android/shortcut_helper.h
index 7c7b749f3ddce8dcad1d00425de850d18a64c363..910373018ad5b907bc6dbb143f4dc73f5c2b26a9 100644
--- a/chrome/browser/android/shortcut_helper.h
+++ b/chrome/browser/android/shortcut_helper.h
@@ -10,6 +10,7 @@
#include "base/basictypes.h"
#include "base/strings/string16.h"
#include "base/task/cancelable_task_tracker.h"
+#include "chrome/browser/android/manifest_icon_selector.h"
#include "chrome/common/web_application_info.h"
#include "components/favicon_base/favicon_types.h"
#include "content/public/browser/web_contents_observer.h"
@@ -114,31 +115,6 @@ class ShortcutHelper : public content::WebContentsObserver {
void Destroy();
- // Runs the algorithm to find the best matching icon in the icons listed in
- // the Manifest.
- // Returns the icon url if a suitable icon is found. An empty URL otherwise.
- GURL FindBestMatchingIcon(
- const std::vector<content::Manifest::Icon>& icons) const;
-
- // Runs an algorithm only based on icon declared sizes. It will try to find
- // size that is the closest to preferred_icon_size_in_px_ but bigger than
- // preferred_icon_size_in_px_ if possible.
- // Returns the icon url if a suitable icon is found. An empty URL otherwise.
- GURL FindBestMatchingIcon(const std::vector<content::Manifest::Icon>& icons,
- float density) const;
-
- // Returns an array containing the items in |icons| without the unsupported
- // image MIME types.
- static std::vector<content::Manifest::Icon> FilterIconsByType(
- const std::vector<content::Manifest::Icon>& icons);
-
- // Returns whether the preferred_icon_size_in_px_ is in the given |sizes|.
- bool IconSizesContainsPreferredSize(
- const std::vector<gfx::Size>& sizes) const;
-
- // Returns whether the 'any' (ie. gfx::Size(0,0)) is in the given |sizes|.
- bool IconSizesContainsAny(const std::vector<gfx::Size>& sizes) const;
-
JavaObjectWeakGlobalRef java_ref_;
GURL url_;
@@ -150,13 +126,13 @@ class ShortcutHelper : public content::WebContentsObserver {
bool add_shortcut_requested_;
+ ManifestIconSelector manifest_icon_selector_;
ManifestIconStatus manifest_icon_status_;
const int preferred_icon_size_in_px_;
static const int kPreferredIconSizeInDp;
base::WeakPtrFactory<ShortcutHelper> weak_ptr_factory_;
- friend class ShortcutHelperTest;
DISALLOW_COPY_AND_ASSIGN(ShortcutHelper);
};

Powered by Google App Engine
This is Rietveld 408576698