| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 794 OnReceivedSerializedHtmlData); | 794 OnReceivedSerializedHtmlData); |
| 795 IPC_MESSAGE_HANDLER(ViewHostMsg_DidGetApplicationInfo, | 795 IPC_MESSAGE_HANDLER(ViewHostMsg_DidGetApplicationInfo, |
| 796 OnDidGetApplicationInfo); | 796 OnDidGetApplicationInfo); |
| 797 IPC_MESSAGE_FORWARD(ViewHostMsg_JSOutOfMemory, delegate_, | 797 IPC_MESSAGE_FORWARD(ViewHostMsg_JSOutOfMemory, delegate_, |
| 798 RenderViewHostDelegate::OnJSOutOfMemory); | 798 RenderViewHostDelegate::OnJSOutOfMemory); |
| 799 IPC_MESSAGE_HANDLER(ViewHostMsg_ShouldClose_ACK, OnMsgShouldCloseACK); | 799 IPC_MESSAGE_HANDLER(ViewHostMsg_ShouldClose_ACK, OnMsgShouldCloseACK); |
| 800 IPC_MESSAGE_HANDLER(ViewHostMsg_QueryFormFieldAutofill, | 800 IPC_MESSAGE_HANDLER(ViewHostMsg_QueryFormFieldAutofill, |
| 801 OnQueryFormFieldAutofill) | 801 OnQueryFormFieldAutofill) |
| 802 IPC_MESSAGE_HANDLER(ViewHostMsg_RemoveAutofillEntry, | 802 IPC_MESSAGE_HANDLER(ViewHostMsg_RemoveAutofillEntry, |
| 803 OnRemoveAutofillEntry) | 803 OnRemoveAutofillEntry) |
| 804 IPC_MESSAGE_HANDLER(ViewHostMsg_FillAutoFillFormData, |
| 805 OnFillAutoFillFormData) |
| 804 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowDesktopNotification, | 806 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowDesktopNotification, |
| 805 OnShowDesktopNotification) | 807 OnShowDesktopNotification) |
| 806 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowDesktopNotificationText, | 808 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowDesktopNotificationText, |
| 807 OnShowDesktopNotificationText) | 809 OnShowDesktopNotificationText) |
| 808 IPC_MESSAGE_HANDLER(ViewHostMsg_CancelDesktopNotification, | 810 IPC_MESSAGE_HANDLER(ViewHostMsg_CancelDesktopNotification, |
| 809 OnCancelDesktopNotification) | 811 OnCancelDesktopNotification) |
| 810 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestNotificationPermission, | 812 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestNotificationPermission, |
| 811 OnRequestNotificationPermission) | 813 OnRequestNotificationPermission) |
| 812 IPC_MESSAGE_HANDLER(ViewHostMsg_ExtensionRequest, OnExtensionRequest) | 814 IPC_MESSAGE_HANDLER(ViewHostMsg_ExtensionRequest, OnExtensionRequest) |
| 813 IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionChanged, OnMsgSelectionChanged) | 815 IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionChanged, OnMsgSelectionChanged) |
| (...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1583 } | 1585 } |
| 1584 | 1586 |
| 1585 void RenderViewHost::OnRemoveAutofillEntry(const string16& field_name, | 1587 void RenderViewHost::OnRemoveAutofillEntry(const string16& field_name, |
| 1586 const string16& value) { | 1588 const string16& value) { |
| 1587 RenderViewHostDelegate::FormFieldHistory* formfield_history_delegate = | 1589 RenderViewHostDelegate::FormFieldHistory* formfield_history_delegate = |
| 1588 delegate_->GetFormFieldHistoryDelegate(); | 1590 delegate_->GetFormFieldHistoryDelegate(); |
| 1589 if (formfield_history_delegate) | 1591 if (formfield_history_delegate) |
| 1590 formfield_history_delegate->RemoveFormFieldHistoryEntry(field_name, value); | 1592 formfield_history_delegate->RemoveFormFieldHistoryEntry(field_name, value); |
| 1591 } | 1593 } |
| 1592 | 1594 |
| 1595 void RenderViewHost::OnFillAutoFillFormData(int query_id, |
| 1596 const FormData& form, |
| 1597 const string16& name, |
| 1598 const string16& label) { |
| 1599 RenderViewHostDelegate::AutoFill* autofill_delegate = |
| 1600 delegate_->GetAutoFillDelegate(); |
| 1601 if (!autofill_delegate) |
| 1602 return; |
| 1603 |
| 1604 autofill_delegate->FillAutoFillFormData(query_id, form, name, label); |
| 1605 } |
| 1606 |
| 1593 void RenderViewHost::AutoFillSuggestionsReturned( | 1607 void RenderViewHost::AutoFillSuggestionsReturned( |
| 1594 int query_id, | 1608 int query_id, |
| 1595 const std::vector<string16>& names, | 1609 const std::vector<string16>& names, |
| 1596 const std::vector<string16>& labels, | 1610 const std::vector<string16>& labels, |
| 1597 int default_suggestion_index) { | 1611 int default_suggestion_index) { |
| 1598 Send(new ViewMsg_AutoFillSuggestionsReturned( | 1612 Send(new ViewMsg_AutoFillSuggestionsReturned( |
| 1599 routing_id(), query_id, names, labels, default_suggestion_index)); | 1613 routing_id(), query_id, names, labels, default_suggestion_index)); |
| 1600 } | 1614 } |
| 1601 | 1615 |
| 1602 void RenderViewHost::AutocompleteSuggestionsReturned( | 1616 void RenderViewHost::AutocompleteSuggestionsReturned( |
| 1603 int query_id, const std::vector<string16>& suggestions, | 1617 int query_id, const std::vector<string16>& suggestions, |
| 1604 int default_suggestion_index) { | 1618 int default_suggestion_index) { |
| 1605 Send(new ViewMsg_AutocompleteSuggestionsReturned( | 1619 Send(new ViewMsg_AutocompleteSuggestionsReturned( |
| 1606 routing_id(), query_id, suggestions, -1)); | 1620 routing_id(), query_id, suggestions, -1)); |
| 1607 // Default index -1 means no default suggestion. | 1621 // Default index -1 means no default suggestion. |
| 1608 } | 1622 } |
| 1609 | 1623 |
| 1624 void RenderViewHost::AutoFillFormDataFilled(int query_id, |
| 1625 const FormData& form) { |
| 1626 Send(new ViewMsg_AutoFillFormDataFilled(routing_id(), query_id, form)); |
| 1627 } |
| 1628 |
| 1610 void RenderViewHost::WindowMoveOrResizeStarted() { | 1629 void RenderViewHost::WindowMoveOrResizeStarted() { |
| 1611 Send(new ViewMsg_MoveOrResizeStarted(routing_id())); | 1630 Send(new ViewMsg_MoveOrResizeStarted(routing_id())); |
| 1612 } | 1631 } |
| 1613 | 1632 |
| 1614 void RenderViewHost::NotifyRendererUnresponsive() { | 1633 void RenderViewHost::NotifyRendererUnresponsive() { |
| 1615 delegate_->RendererUnresponsive( | 1634 delegate_->RendererUnresponsive( |
| 1616 this, is_waiting_for_beforeunload_ack_ || is_waiting_for_unload_ack_); | 1635 this, is_waiting_for_beforeunload_ack_ || is_waiting_for_unload_ack_); |
| 1617 } | 1636 } |
| 1618 | 1637 |
| 1619 void RenderViewHost::NotifyRendererResponsive() { | 1638 void RenderViewHost::NotifyRendererResponsive() { |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1826 integration_delegate->OnPageTranslated(page_id, | 1845 integration_delegate->OnPageTranslated(page_id, |
| 1827 original_lang, translated_lang); | 1846 original_lang, translated_lang); |
| 1828 } | 1847 } |
| 1829 | 1848 |
| 1830 void RenderViewHost::OnContentBlocked(ContentSettingsType type) { | 1849 void RenderViewHost::OnContentBlocked(ContentSettingsType type) { |
| 1831 RenderViewHostDelegate::Resource* resource_delegate = | 1850 RenderViewHostDelegate::Resource* resource_delegate = |
| 1832 delegate_->GetResourceDelegate(); | 1851 delegate_->GetResourceDelegate(); |
| 1833 if (resource_delegate) | 1852 if (resource_delegate) |
| 1834 resource_delegate->OnContentBlocked(type); | 1853 resource_delegate->OnContentBlocked(type); |
| 1835 } | 1854 } |
| OLD | NEW |