OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/renderer_host/render_view_host.h" | 5 #include "chrome/browser/renderer_host/render_view_host.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
824 RenderViewHostDelegate::OnJSOutOfMemory); | 824 RenderViewHostDelegate::OnJSOutOfMemory); |
825 IPC_MESSAGE_HANDLER(ViewHostMsg_ShouldClose_ACK, OnMsgShouldCloseACK); | 825 IPC_MESSAGE_HANDLER(ViewHostMsg_ShouldClose_ACK, OnMsgShouldCloseACK); |
826 IPC_MESSAGE_HANDLER(ViewHostMsg_QueryFormFieldAutofill, | 826 IPC_MESSAGE_HANDLER(ViewHostMsg_QueryFormFieldAutofill, |
827 OnQueryFormFieldAutofill) | 827 OnQueryFormFieldAutofill) |
828 IPC_MESSAGE_HANDLER(ViewHostMsg_RemoveAutofillEntry, | 828 IPC_MESSAGE_HANDLER(ViewHostMsg_RemoveAutofillEntry, |
829 OnRemoveAutofillEntry) | 829 OnRemoveAutofillEntry) |
830 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowDesktopNotification, | 830 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowDesktopNotification, |
831 OnShowDesktopNotification) | 831 OnShowDesktopNotification) |
832 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowDesktopNotificationText, | 832 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowDesktopNotificationText, |
833 OnShowDesktopNotificationText) | 833 OnShowDesktopNotificationText) |
| 834 IPC_MESSAGE_HANDLER(ViewHostMsg_CancelDesktopNotification, |
| 835 OnCancelDesktopNotification) |
834 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestNotificationPermission, | 836 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestNotificationPermission, |
835 OnRequestNotificationPermission) | 837 OnRequestNotificationPermission) |
836 IPC_MESSAGE_HANDLER(ViewHostMsg_ExtensionRequest, OnExtensionRequest) | 838 IPC_MESSAGE_HANDLER(ViewHostMsg_ExtensionRequest, OnExtensionRequest) |
837 IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionChanged, OnMsgSelectionChanged) | 839 IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionChanged, OnMsgSelectionChanged) |
838 IPC_MESSAGE_HANDLER(ViewHostMsg_ExtensionPostMessage, | 840 IPC_MESSAGE_HANDLER(ViewHostMsg_ExtensionPostMessage, |
839 OnExtensionPostMessage) | 841 OnExtensionPostMessage) |
840 IPC_MESSAGE_HANDLER(ViewHostMsg_AccessibilityFocusChange, | 842 IPC_MESSAGE_HANDLER(ViewHostMsg_AccessibilityFocusChange, |
841 OnAccessibilityFocusChange) | 843 OnAccessibilityFocusChange) |
842 IPC_MESSAGE_HANDLER(ViewHostMsg_OnCSSInserted, OnCSSInserted) | 844 IPC_MESSAGE_HANDLER(ViewHostMsg_OnCSSInserted, OnCSSInserted) |
843 // Have the super handle all other messages. | 845 // Have the super handle all other messages. |
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1670 void RenderViewHost::OnShowDesktopNotificationText(const GURL& source_origin, | 1672 void RenderViewHost::OnShowDesktopNotificationText(const GURL& source_origin, |
1671 const GURL& icon, const string16& title, const string16& text, | 1673 const GURL& icon, const string16& title, const string16& text, |
1672 int notification_id) { | 1674 int notification_id) { |
1673 DesktopNotificationService* service = | 1675 DesktopNotificationService* service = |
1674 process()->profile()->GetDesktopNotificationService(); | 1676 process()->profile()->GetDesktopNotificationService(); |
1675 service->ShowDesktopNotificationText(source_origin, icon, title, text, | 1677 service->ShowDesktopNotificationText(source_origin, icon, title, text, |
1676 process()->id(), routing_id(), | 1678 process()->id(), routing_id(), |
1677 DesktopNotificationService::PageNotification, notification_id); | 1679 DesktopNotificationService::PageNotification, notification_id); |
1678 } | 1680 } |
1679 | 1681 |
| 1682 void RenderViewHost::OnCancelDesktopNotification(int notification_id) { |
| 1683 DesktopNotificationService* service= |
| 1684 process()->profile()->GetDesktopNotificationService(); |
| 1685 service->CancelDesktopNotification( |
| 1686 process()->id(), routing_id(), notification_id); |
| 1687 } |
| 1688 |
1680 void RenderViewHost::OnRequestNotificationPermission( | 1689 void RenderViewHost::OnRequestNotificationPermission( |
1681 const GURL& source_origin, int callback_context) { | 1690 const GURL& source_origin, int callback_context) { |
1682 DesktopNotificationService* service = | 1691 DesktopNotificationService* service = |
1683 process()->profile()->GetDesktopNotificationService(); | 1692 process()->profile()->GetDesktopNotificationService(); |
1684 service->RequestPermission(source_origin, callback_context); | 1693 service->RequestPermission(source_origin, callback_context); |
1685 } | 1694 } |
1686 | 1695 |
1687 void RenderViewHost::OnExtensionRequest(const std::string& name, | 1696 void RenderViewHost::OnExtensionRequest(const std::string& name, |
1688 const ListValue& args_holder, | 1697 const ListValue& args_holder, |
1689 int request_id, | 1698 int request_id, |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1741 #endif | 1750 #endif |
1742 } | 1751 } |
1743 | 1752 |
1744 void RenderViewHost::OnCSSInserted() { | 1753 void RenderViewHost::OnCSSInserted() { |
1745 delegate_->DidInsertCSS(); | 1754 delegate_->DidInsertCSS(); |
1746 } | 1755 } |
1747 | 1756 |
1748 void RenderViewHost::UpdateBrowserWindowId(int window_id) { | 1757 void RenderViewHost::UpdateBrowserWindowId(int window_id) { |
1749 Send(new ViewMsg_UpdateBrowserWindowId(routing_id(), window_id)); | 1758 Send(new ViewMsg_UpdateBrowserWindowId(routing_id(), window_id)); |
1750 } | 1759 } |
OLD | NEW |