| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/notifications/desktop_notification_service.h" | 5 #include "chrome/browser/notifications/desktop_notification_service.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/win/metro.h" | 8 #include "base/win/metro.h" |
| 9 #include "chrome/browser/notifications/notification.h" | 9 #include "chrome/browser/notifications/notification.h" |
| 10 #include "chrome/browser/notifications/notification_object_proxy.h" | 10 #include "chrome/browser/notifications/notification_object_proxy.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 const Notification& notification) { | 39 const Notification& notification) { |
| 40 if (win8::IsSingleWindowMetroMode()) { | 40 if (win8::IsSingleWindowMetroMode()) { |
| 41 MetroDisplayNotification display_metro_notification = | 41 MetroDisplayNotification display_metro_notification = |
| 42 reinterpret_cast<MetroDisplayNotification>(GetProcAddress( | 42 reinterpret_cast<MetroDisplayNotification>(GetProcAddress( |
| 43 base::win::GetMetroModule(), "DisplayNotification")); | 43 base::win::GetMetroModule(), "DisplayNotification")); |
| 44 DCHECK(display_metro_notification); | 44 DCHECK(display_metro_notification); |
| 45 if (!notification.is_html()) { | 45 if (!notification.is_html()) { |
| 46 display_metro_notification(notification.origin_url().spec().c_str(), | 46 display_metro_notification(notification.origin_url().spec().c_str(), |
| 47 notification.content_url().spec().c_str(), | 47 notification.content_url().spec().c_str(), |
| 48 notification.title().c_str(), | 48 notification.title().c_str(), |
| 49 notification.body().c_str(), | 49 notification.message().c_str(), |
| 50 notification.display_source().c_str(), | 50 notification.display_source().c_str(), |
| 51 notification.notification_id().c_str()); | 51 notification.notification_id().c_str()); |
| 52 return; | 52 return; |
| 53 } else { | 53 } else { |
| 54 NOTREACHED() << "We don't support HTML notifications in Windows 8 metro"; | 54 NOTREACHED() << "We don't support HTML notifications in Windows 8 metro"; |
| 55 } | 55 } |
| 56 } | 56 } |
| 57 GetUIManager()->Add(notification, profile_); | 57 GetUIManager()->Add(notification, profile_); |
| 58 } | 58 } |
| OLD | NEW |