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

Side by Side Diff: chrome/browser/notifications/notification_conversion_helper.h

Issue 441753002: Route newly created notifications to notification provider API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: changed AddToAlternateProvider Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_CONVERSION_HELPER_H_
6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_CONVERSION_HELPER_H_
7
8 #include "chrome/browser/notifications/notification.h"
9 #include "ui/message_center/notification_types.h"
10
11 namespace extensions {
12 namespace api {
13 namespace notifications {
14 struct NotificationOptions;
15 struct NotificationBitmap;
16 } // namespace notifications
17 } // namespace api
18 } // namespace extensions
19
20 namespace gfx {
21 class Image;
22 }
23
24 class NotificationConversionHelper {
dewittj 2014/08/13 18:30:18 please add a class comment
liyanhou 2014/08/13 20:28:57 Done.
25 public:
26 // Converts Notification::Notification data to
27 // extensions::api::notifications::NotificationOptions.
28 static void NotificationToNotificationOptions(
29 const Notification& notification,
30 extensions::api::notifications::NotificationOptions* options);
31
32 // Converts gfx::Image (in ARGB format) type to
33 // extensions::api::notifications::NotificationBitmap type (RGBA).
34 static void GfxImageToNotificationBitmap(
35 const gfx::Image* gfx_image,
36 extensions::api::notifications::NotificationBitmap* return_image_args);
37
38 // Converts an extensions::api::notifications::NotificationBitmap type object
39 // with width, height, and data in RGBA format into an gfx::Image (ARGB).
40 static bool NotificationBitmapToGfxImage(
41 float max_scale,
42 const gfx::Size& target_size_dips,
43 extensions::api::notifications::NotificationBitmap* notification_bitmap,
44 gfx::Image* return_image);
45
46 private:
47 // Conversts message_center::NotificationType to string type used to convert
48 // to extensions::api::notifications::TemplateType
49 static std::string MapTypeToString(message_center::NotificationType type);
50 };
51
52 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_CONVERSION_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698