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_ |