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

Unified Diff: trunk/src/chrome/renderer/extensions/notifications_native_handler.cc

Issue 296113009: Revert 272211 "Allow high-res bitmaps to be passed in from notif..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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: trunk/src/chrome/renderer/extensions/notifications_native_handler.cc
===================================================================
--- trunk/src/chrome/renderer/extensions/notifications_native_handler.cc (revision 272269)
+++ trunk/src/chrome/renderer/extensions/notifications_native_handler.cc (working copy)
@@ -1,48 +0,0 @@
-// 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.
-
-#include "chrome/renderer/extensions/notifications_native_handler.h"
-
-#include <string>
-
-#include "base/logging.h"
-#include "base/values.h"
-#include "chrome/common/extensions/api/notifications/notification_style.h"
-#include "chrome/renderer/extensions/chrome_v8_context.h"
-#include "content/public/renderer/v8_value_converter.h"
-#include "ui/base/layout.h"
-
-namespace extensions {
-
-NotificationsNativeHandler::NotificationsNativeHandler(ScriptContext* context)
- : ObjectBackedNativeHandler(context) {
- RouteFunction(
- "GetNotificationImageSizes",
- base::Bind(&NotificationsNativeHandler::GetNotificationImageSizes,
- base::Unretained(this)));
-}
-
-void NotificationsNativeHandler::GetNotificationImageSizes(
- const v8::FunctionCallbackInfo<v8::Value>& args) {
- NotificationBitmapSizes bitmap_sizes = NotificationBitmapSizes();
-
- float scale_factor =
- ui::GetScaleForScaleFactor(ui::GetSupportedScaleFactors().back());
-
- scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue);
- dict->SetDouble("scaleFactor", scale_factor);
- dict->SetInteger("icon.width", bitmap_sizes.icon_size.width());
- dict->SetInteger("icon.height", bitmap_sizes.icon_size.height());
- dict->SetInteger("image.width", bitmap_sizes.image_size.width());
- dict->SetInteger("image.height", bitmap_sizes.image_size.height());
- dict->SetInteger("buttonIcon.width", bitmap_sizes.button_icon_size.width());
- dict->SetInteger("buttonIcon.height", bitmap_sizes.button_icon_size.height());
-
- scoped_ptr<content::V8ValueConverter> converter(
- content::V8ValueConverter::create());
- args.GetReturnValue().Set(
- converter->ToV8Value(dict.get(), context()->v8_context()));
-}
-
-} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698