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

Unified Diff: win8/metro_driver/toast_notification_handler.h

Issue 10875008: Integrate the Windows 8 code into the Chromium tree. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove conflicting OWNERS file. Created 8 years, 3 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
« no previous file with comments | « win8/metro_driver/stdafx.h ('k') | win8/metro_driver/toast_notification_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: win8/metro_driver/toast_notification_handler.h
diff --git a/win8/metro_driver/toast_notification_handler.h b/win8/metro_driver/toast_notification_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..f560e340b7d30ae00e7134e6be34dde6825d5209
--- /dev/null
+++ b/win8/metro_driver/toast_notification_handler.h
@@ -0,0 +1,48 @@
+// Copyright (c) 2012 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_BROWSER_UI_METRO_DRIVER_TOAST_NOTIFICATION_HANDLER_H_
+#define CHROME_BROWSER_UI_METRO_DRIVER_TOAST_NOTIFICATION_HANDLER_H_
+
+#include <windows.ui.notifications.h>
+
+#include "base/string16.h"
+
+// Provides functionality to display a metro style toast notification.
+class ToastNotificationHandler {
+ public:
+ // Holds information about a desktop notification to be displayed.
+ struct DesktopNotification {
+ std::string origin_url;
+ std::string icon_url;
+ string16 title;
+ string16 body;
+ string16 display_source;
+ std::string id;
+
+ DesktopNotification(const char* notification_origin,
+ const char* notification_icon,
+ const wchar_t* notification_title,
+ const wchar_t* notification_body,
+ const wchar_t* notification_display_source,
+ const char* notification_id);
+ };
+
+ ToastNotificationHandler();
+ ~ToastNotificationHandler();
+
+ void DisplayNotification(const DesktopNotification& notification);
+ void CancelNotification();
+
+ HRESULT OnActivate(winui::Notifications::IToastNotification* notification,
+ IInspectable* inspectable);
+
+ private:
+ mswr::ComPtr<winui::Notifications::IToastNotifier> notifier_;
+ mswr::ComPtr<winui::Notifications::IToastNotification> notification_;
+
+ EventRegistrationToken activated_token_;
+};
+
+#endif // CHROME_BROWSER_UI_METRO_DRIVER_TOAST_NOTIFICATION_HANDLER_H_
« no previous file with comments | « win8/metro_driver/stdafx.h ('k') | win8/metro_driver/toast_notification_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698