1 // Copyright (c) 2012 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.
5 #ifndef CHROME_BROWSER_UI_METRO_DRIVER_TOAST_NOTIFICATION_HANDLER_H_
6 #define CHROME_BROWSER_UI_METRO_DRIVER_TOAST_NOTIFICATION_HANDLER_H_
8 #include <windows.ui.notifications.h>
10 #include "base/strings/string16.h"
11 #include "base/win/metro.h"
13 // Provides functionality to display a metro style toast notification.
14 class ToastNotificationHandler
{
16 // Holds information about a desktop notification to be displayed.
17 struct DesktopNotification
{
18 std::string origin_url
;
22 base::string16 display_source
;
24 base::win::MetroNotificationClickedHandler notification_handler
;
25 base::string16 notification_context
;
27 DesktopNotification(const char* notification_origin
,
28 const char* notification_icon
,
29 const wchar_t* notification_title
,
30 const wchar_t* notification_body
,
31 const wchar_t* notification_display_source
,
32 const char* notification_id
,
33 base::win::MetroNotificationClickedHandler handler
,
34 const wchar_t* handler_context
);
36 DesktopNotification();
39 ToastNotificationHandler();
40 ~ToastNotificationHandler();
42 void DisplayNotification(const DesktopNotification
& notification
);
43 void CancelNotification();
45 HRESULT
OnActivate(winui::Notifications::IToastNotification
* notification
,
46 IInspectable
* inspectable
);
49 mswr::ComPtr
<winui::Notifications::IToastNotifier
> notifier_
;
50 mswr::ComPtr
<winui::Notifications::IToastNotification
> notification_
;
51 EventRegistrationToken activated_token_
;
52 DesktopNotification notification_info_
;
55 #endif // CHROME_BROWSER_UI_METRO_DRIVER_TOAST_NOTIFICATION_HANDLER_H_