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

Unified Diff: chrome/renderer/extensions/notifications_native_handler.h

Issue 256503004: Allow high-res bitmaps to be passed in from notifications API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Restructure code so chrome_child.dll links Created 6 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/renderer/extensions/notifications_native_handler.h
diff --git a/chrome/renderer/extensions/notifications_native_handler.h b/chrome/renderer/extensions/notifications_native_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..79cdf78484050fd7038e1d6759a371d259d6b4ed
--- /dev/null
+++ b/chrome/renderer/extensions/notifications_native_handler.h
@@ -0,0 +1,42 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_RENDERER_EXTENSIONS_NOTIFICATIONS_NATIVE_HANDLER_H_
+#define CHROME_RENDERER_EXTENSIONS_NOTIFICATIONS_NATIVE_HANDLER_H_
+
+#include "base/compiler_specific.h"
+#include "extensions/renderer/object_backed_native_handler.h"
+
+namespace base {
+class Value;
+}
+
+namespace extensions {
+
+class NotificationsNativeHandler : public ObjectBackedNativeHandler {
+ public:
+ explicit NotificationsNativeHandler(ScriptContext* context);
+
+ private:
+ // This implements notifications_private.GetImageSizes() which
+ // informs the renderer of the actual rendered size of each
+ // component of a notification. It additionally includes
+ // information about the system's maximum scale factor so that
+ // larger images specified in DP can be interpreted as scaled
+ // versions of the DIP size.
+ // * |args| is used only to get the return value.
+ // * The return value contains the following keys:
+ // scaleFactor - a float a la devicePixelRatio
+ // icon - a dictionary with integer keys "height" and "width" (DIPs)
+ // image - a dictionary of the same format as |icon|
+ // buttonIcon - a dictionary of the same format as |icon|
+ void GetNotificationImageSizes(
+ const v8::FunctionCallbackInfo<v8::Value>& args);
+
+ DISALLOW_COPY_AND_ASSIGN(NotificationsNativeHandler);
+};
+
+} // namespace extensions
+
+#endif // CHROME_RENDERER_EXTENSIONS_NOTIFICATIONS_NATIVE_HANDLER_H_

Powered by Google App Engine
This is Rietveld 408576698