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

Unified Diff: third_party/WebKit/Source/modules/notifications/NotificationResourcesLoader.cpp

Issue 1901133002: Move the notification constants to Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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: third_party/WebKit/Source/modules/notifications/NotificationResourcesLoader.cpp
diff --git a/third_party/WebKit/Source/modules/notifications/NotificationResourcesLoader.cpp b/third_party/WebKit/Source/modules/notifications/NotificationResourcesLoader.cpp
index 15067b3b196c52f6b660687f3b0e5f7a2a5b4d9e..6e59fd3bcc556a32fc8e48bdc7cde746d53dd75d 100644
--- a/third_party/WebKit/Source/modules/notifications/NotificationResourcesLoader.cpp
+++ b/third_party/WebKit/Source/modules/notifications/NotificationResourcesLoader.cpp
@@ -5,6 +5,7 @@
#include "modules/notifications/NotificationResourcesLoader.h"
#include "platform/weborigin/KURL.h"
+#include "public/platform/modules/notifications/WebNotificationConstants.h"
#include "public/platform/modules/notifications/WebNotificationData.h"
#include "public/platform/modules/notifications/WebNotificationResources.h"
#include "skia/ext/image_operations.h"
@@ -14,20 +15,6 @@ namespace blink {
namespace {
-// TODO(mvanouwerkerk): Get icon dimensions from the embedder.
-
-// The maximum reasonable notification icon size, scaled from dip units to
-// pixels using the largest supported scaling factor.
-static const int kMaxIconSizePx = 320; // 80 dip * 4
-
-// The maximum reasonable badge size, scaled from dip units to pixels using the
-// largest supported scaling factor.
-static const int kMaxBadgeSizePx = 96; // 24 dip * 4
-
-// The maximum reasonable action icon size, scaled from dip units to pixels
-// using the largest supported scaling factor.
-static const int kMaxActionIconSizePx = 128; // 32 dip * 4
-
// Scales down |image| to fit within |maxSizePx| if its width or height is
// larger than |maxSizePx| and returns the result. Otherwise does nothing and
// returns |image| unchanged.
@@ -102,13 +89,13 @@ void NotificationResourcesLoader::loadImage(ExecutionContext* executionContext,
void NotificationResourcesLoader::didLoadIcon(const SkBitmap& image)
{
- m_icon = scaleDownIfNeeded(image, kMaxIconSizePx);
+ m_icon = scaleDownIfNeeded(image, kWebNotificationMaxIconSizePx);
didFinishRequest();
}
void NotificationResourcesLoader::didLoadBadge(const SkBitmap& image)
{
- m_badge = scaleDownIfNeeded(image, kMaxBadgeSizePx);
+ m_badge = scaleDownIfNeeded(image, kWebNotificationMaxBadgeSizePx);
didFinishRequest();
}
@@ -116,7 +103,7 @@ void NotificationResourcesLoader::didLoadActionIcon(size_t actionIndex, const Sk
{
DCHECK_LT(actionIndex, m_actionIcons.size());
- m_actionIcons[actionIndex] = scaleDownIfNeeded(image, kMaxActionIconSizePx);
+ m_actionIcons[actionIndex] = scaleDownIfNeeded(image, kWebNotificationMaxActionIconSizePx);
didFinishRequest();
}

Powered by Google App Engine
This is Rietveld 408576698