| 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 "content/browser/renderer_host/render_view_host_impl.h" | 5 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 1515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1526 #if defined(OS_MACOSX) | 1526 #if defined(OS_MACOSX) |
| 1527 void RenderViewHostImpl::DidSelectPopupMenuItem(int selected_index) { | 1527 void RenderViewHostImpl::DidSelectPopupMenuItem(int selected_index) { |
| 1528 Send(new ViewMsg_SelectPopupMenuItem(GetRoutingID(), selected_index)); | 1528 Send(new ViewMsg_SelectPopupMenuItem(GetRoutingID(), selected_index)); |
| 1529 } | 1529 } |
| 1530 | 1530 |
| 1531 void RenderViewHostImpl::DidCancelPopupMenu() { | 1531 void RenderViewHostImpl::DidCancelPopupMenu() { |
| 1532 Send(new ViewMsg_SelectPopupMenuItem(GetRoutingID(), -1)); | 1532 Send(new ViewMsg_SelectPopupMenuItem(GetRoutingID(), -1)); |
| 1533 } | 1533 } |
| 1534 #endif | 1534 #endif |
| 1535 | 1535 |
| 1536 #if defined(OS_ANDROID) |
| 1537 void RenderViewHostImpl::DidSelectPopupMenuItems( |
| 1538 const std::vector<int>& selected_indices) { |
| 1539 Send(new ViewMsg_SelectPopupMenuItems(GetRoutingID(), false, |
| 1540 selected_indices)); |
| 1541 } |
| 1542 |
| 1543 void RenderViewHostImpl::DidCancelPopupMenu() { |
| 1544 Send(new ViewMsg_SelectPopupMenuItems(GetRoutingID(), true, |
| 1545 std::vector<int>())); |
| 1546 } |
| 1547 #endif |
| 1548 |
| 1536 void RenderViewHostImpl::SendOrientationChangeEvent(int orientation) { | 1549 void RenderViewHostImpl::SendOrientationChangeEvent(int orientation) { |
| 1537 Send(new ViewMsg_OrientationChangeEvent(GetRoutingID(), orientation)); | 1550 Send(new ViewMsg_OrientationChangeEvent(GetRoutingID(), orientation)); |
| 1538 } | 1551 } |
| 1539 | 1552 |
| 1540 void RenderViewHostImpl::ToggleSpeechInput() { | 1553 void RenderViewHostImpl::ToggleSpeechInput() { |
| 1541 Send(new InputTagSpeechMsg_ToggleSpeechInput(GetRoutingID())); | 1554 Send(new InputTagSpeechMsg_ToggleSpeechInput(GetRoutingID())); |
| 1542 } | 1555 } |
| 1543 | 1556 |
| 1544 void RenderViewHostImpl::FilterURL(ChildProcessSecurityPolicyImpl* policy, | 1557 void RenderViewHostImpl::FilterURL(ChildProcessSecurityPolicyImpl* policy, |
| 1545 int renderer_id, | 1558 int renderer_id, |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1781 | 1794 |
| 1782 content::GetContentClient()->browser()->ShowDesktopNotification( | 1795 content::GetContentClient()->browser()->ShowDesktopNotification( |
| 1783 params, GetProcess()->GetID(), GetRoutingID(), false); | 1796 params, GetProcess()->GetID(), GetRoutingID(), false); |
| 1784 } | 1797 } |
| 1785 | 1798 |
| 1786 void RenderViewHostImpl::OnCancelDesktopNotification(int notification_id) { | 1799 void RenderViewHostImpl::OnCancelDesktopNotification(int notification_id) { |
| 1787 content::GetContentClient()->browser()->CancelDesktopNotification( | 1800 content::GetContentClient()->browser()->CancelDesktopNotification( |
| 1788 GetProcess()->GetID(), GetRoutingID(), notification_id); | 1801 GetProcess()->GetID(), GetRoutingID(), notification_id); |
| 1789 } | 1802 } |
| 1790 | 1803 |
| 1791 #if defined(OS_MACOSX) | 1804 #if defined(OS_MACOSX) || defined(OS_ANDROID) |
| 1792 void RenderViewHostImpl::OnMsgShowPopup( | 1805 void RenderViewHostImpl::OnMsgShowPopup( |
| 1793 const ViewHostMsg_ShowPopup_Params& params) { | 1806 const ViewHostMsg_ShowPopup_Params& params) { |
| 1794 PopupMenuHelper popup_menu_helper(this); | 1807 RenderViewHostDelegateView* view = delegate_->GetDelegateView(); |
| 1795 popup_menu_helper.ShowPopupMenu(params.bounds, params.item_height, | 1808 if (view) { |
| 1796 params.item_font_size, params.selected_item, | 1809 view->ShowPopupMenu(params.bounds, |
| 1797 params.popup_items, params.right_aligned); | 1810 params.item_height, |
| 1811 params.item_font_size, |
| 1812 params.selected_item, |
| 1813 params.popup_items, |
| 1814 params.right_aligned, |
| 1815 params.allow_multiple_selection); |
| 1816 } |
| 1798 } | 1817 } |
| 1799 #endif | 1818 #endif |
| 1800 | 1819 |
| 1801 void RenderViewHostImpl::OnRunFileChooser( | 1820 void RenderViewHostImpl::OnRunFileChooser( |
| 1802 const content::FileChooserParams& params) { | 1821 const content::FileChooserParams& params) { |
| 1803 delegate_->RunFileChooser(this, params); | 1822 delegate_->RunFileChooser(this, params); |
| 1804 } | 1823 } |
| 1805 | 1824 |
| 1806 void RenderViewHostImpl::OnDomOperationResponse( | 1825 void RenderViewHostImpl::OnDomOperationResponse( |
| 1807 const std::string& json_string, int automation_id) { | 1826 const std::string& json_string, int automation_id) { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1820 // can cause navigations to be ignored in OnMsgNavigate. | 1839 // can cause navigations to be ignored in OnMsgNavigate. |
| 1821 is_waiting_for_beforeunload_ack_ = false; | 1840 is_waiting_for_beforeunload_ack_ = false; |
| 1822 is_waiting_for_unload_ack_ = false; | 1841 is_waiting_for_unload_ack_ = false; |
| 1823 } | 1842 } |
| 1824 | 1843 |
| 1825 void RenderViewHostImpl::ClearPowerSaveBlockers() { | 1844 void RenderViewHostImpl::ClearPowerSaveBlockers() { |
| 1826 STLDeleteValues(&power_save_blockers_); | 1845 STLDeleteValues(&power_save_blockers_); |
| 1827 } | 1846 } |
| 1828 | 1847 |
| 1829 } // namespace content | 1848 } // namespace content |
| OLD | NEW |