diff options
author | robertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-07 18:24:52 +0000 |
---|---|---|
committer | robertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-07 18:24:52 +0000 |
commit | 4475892162b7069ec333f3fc64d086ba3957b752 (patch) | |
tree | 5f85c72235b6425bc20fbf48da693003cf295d7d /win8/metro_driver/toast_notification_handler.h | |
parent | e6f1a6fbcc8869e27697b2bb548aa61e58f969a5 (diff) | |
download | chromium_src-4475892162b7069ec333f3fc64d086ba3957b752.zip chromium_src-4475892162b7069ec333f3fc64d086ba3957b752.tar.gz chromium_src-4475892162b7069ec333f3fc64d086ba3957b752.tar.bz2 |
Integrate the Windows 8 code into the Chromium tree.
BUG=127799
TEST=A Chromium build can run as the immersive browser on Windows 8.
Review URL: https://chromiumcodereview.appspot.com/10875008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155429 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'win8/metro_driver/toast_notification_handler.h')
-rw-r--r-- | win8/metro_driver/toast_notification_handler.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/win8/metro_driver/toast_notification_handler.h b/win8/metro_driver/toast_notification_handler.h new file mode 100644 index 0000000..f560e34 --- /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_ |